| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247 |
- /* eslint-disable no-useless-escape */
- import {
- packageSuggestionsForCommands,
- packageSuggestionsForEnvironments,
- } from './HumanReadableLogsPackageSuggestions'
- interface Rule {
- ruleId: string
- types?: string[]
- cascadesFrom?: string[]
- newMessage?: string
- regexToMatch: RegExp
- contentRegex?: RegExp
- improvedTitle?: (
- currentTitle: string,
- details?: [string]
- ) => string | [string, JSX.Element]
- package?: string
- highlightCommand?: (contentDetails: string[]) => string | undefined
- }
- const rules: Rule[] = [
- {
- ruleId: 'hint_misplaced_alignment_tab_character',
- regexToMatch: /Misplaced alignment tab character &/,
- },
- {
- ruleId: 'hint_extra_alignment_tab_has_been_changed',
- regexToMatch: /Extra alignment tab has been changed to \\cr/,
- },
- {
- ruleId: 'hint_display_math_should_end_with',
- regexToMatch: /Display math should end with \$\$/,
- },
- {
- ruleId: 'hint_missing_inserted',
- regexToMatch: /Missing [{$] inserted\./,
- },
- {
- ruleId: 'hint_reference_undefined',
- regexToMatch: /Reference.+undefined/,
- },
- {
- ruleId: 'hint_there_were_undefined_references',
- regexToMatch: /There were undefined references/,
- },
- {
- ruleId: 'hint_citation_on_page_undefined_on_input_line',
- regexToMatch: /Citation .+ on page .+ undefined on input line .+/,
- },
- {
- ruleId: 'hint_label_multiply_defined_labels',
- regexToMatch: /(Label .+)? multiply[ -]defined( labels)?/,
- },
- {
- ruleId: 'hint_float_specifier_changed',
- regexToMatch: /`!?h' float specifier changed to `!?ht/,
- },
- {
- ruleId: 'hint_no_positions_in_optional_float_specifier',
- regexToMatch: /No positions in optional float specifier/,
- },
- {
- ruleId: 'hint_undefined_control_sequence',
- regexToMatch: /Undefined control sequence/,
- // Match the last control sequence in the line
- contentRegex: /^[^\n]*(\\\S+)\s*[\n]/,
- improvedTitle: (currentTitle: string, details?: [string]) => {
- if (details?.length && packageSuggestionsForCommands.has(details[0])) {
- const command = details[0]
- const suggestion = packageSuggestionsForCommands.get(command)
- return [
- `Is ${suggestion.command} missing?`,
- // eslint-disable-next-line react/jsx-key
- <span>
- Is <code>{suggestion.command}</code> missing?
- </span>,
- ]
- }
- return currentTitle
- },
- highlightCommand(contentDetails) {
- return contentDetails[0]
- },
- },
- {
- ruleId: 'hint_undefined_environment',
- regexToMatch: /LaTeX Error: Environment .+ undefined/,
- contentRegex: /\\begin\{(\S+)\}/,
- improvedTitle: (currentTitle: string, details?: [string]) => {
- if (
- details?.length &&
- packageSuggestionsForEnvironments.has(details[0])
- ) {
- const environment = details[0]
- const suggestion = packageSuggestionsForEnvironments.get(environment)
- return [
- `Is ${suggestion.command} missing?`,
- // eslint-disable-next-line react/jsx-key
- <span>
- Is <code>{suggestion.command}</code> missing?
- </span>,
- ]
- }
- return currentTitle
- },
- },
- {
- ruleId: 'hint_file_not_found',
- regexToMatch: /File .+ not found/,
- },
- {
- ruleId: 'hint_unknown_graphics_extension',
- regexToMatch: /LaTeX Error: Unknown graphics extension: \..+/,
- },
- {
- ruleId: 'hint_unknown_float_option_h',
- regexToMatch: /LaTeX Error: Unknown float option `H/,
- },
- {
- ruleId: 'hint_unknown_float_option_q',
- regexToMatch: /LaTeX Error: Unknown float option `q/,
- },
- {
- ruleId: 'hint_math_allowed_only_in_math_mode',
- regexToMatch: /LaTeX Error: \\math.+ allowed only in math mode/,
- },
- {
- ruleId: 'hint_mismatched_environment',
- types: ['environment'],
- regexToMatch: /Error: `([^']{2,})' expected, found `([^']{2,})'.*/,
- newMessage: 'Error: environment does not match \\begin{$1} ... \\end{$2}',
- },
- {
- ruleId: 'hint_mismatched_brackets',
- types: ['environment'],
- regexToMatch: /Error: `([^a-zA-Z0-9])' expected, found `([^a-zA-Z0-9])'.*/,
- newMessage: "Error: brackets do not match, found '$2' instead of '$1'",
- },
- {
- ruleId: 'hint_can_be_used_only_in_preamble',
- regexToMatch: /LaTeX Error: Can be used only in preamble/,
- },
- {
- ruleId: 'hint_missing_right_inserted',
- regexToMatch: /Missing \\right inserted/,
- },
- {
- ruleId: 'hint_double_superscript',
- regexToMatch: /Double superscript/,
- },
- {
- ruleId: 'hint_double_subscript',
- regexToMatch: /Double subscript/,
- },
- {
- ruleId: 'hint_no_author_given',
- regexToMatch: /No \\author given/,
- },
- {
- ruleId: 'hint_somethings_wrong_perhaps_a_missing_item',
- regexToMatch: /LaTeX Error: Something's wrong--perhaps a missing \\item/,
- },
- {
- ruleId: 'hint_misplaced_noalign',
- regexToMatch: /Misplaced \\noalign/,
- },
- {
- ruleId: 'hint_no_line_here_to_end',
- regexToMatch: /LaTeX Error: There's no line here to end/,
- },
- {
- ruleId: 'hint_verb_ended_by_end_of_line',
- regexToMatch: /LaTeX Error: \\verb ended by end of line/,
- },
- {
- ruleId: 'hint_illegal_unit_of_measure_pt_inserted',
- regexToMatch: /Illegal unit of measure (pt inserted)/,
- },
- {
- ruleId: 'hint_extra_right',
- regexToMatch: /Extra \\right/,
- },
- {
- ruleId: 'hint_missing_begin_document',
- regexToMatch: /Missing \\begin{document}/,
- },
- {
- ruleId: 'hint_mismatched_environment2',
- types: ['environment'],
- cascadesFrom: ['environment'],
- regexToMatch:
- /Error: `\\end\{([^\}]+)\}' expected but found `\\end\{([^\}]+)\}'.*/,
- newMessage: 'Error: environments do not match: \\begin{$1} ... \\end{$2}',
- },
- {
- ruleId: 'hint_mismatched_environment3',
- types: ['environment'],
- cascadesFrom: ['environment'],
- regexToMatch:
- /Warning: No matching \\end found for `\\begin\{([^\}]+)\}'.*/,
- newMessage: 'Warning: No matching \\end found for \\begin{$1}',
- },
- {
- ruleId: 'hint_mismatched_environment4',
- types: ['environment'],
- cascadesFrom: ['environment'],
- regexToMatch:
- /Error: Found `\\end\{([^\}]+)\}' without corresponding \\begin.*/,
- newMessage: 'Error: found \\end{$1} without a corresponding \\begin{$1}',
- },
- ]
- const errors: Rule[] = [
- {
- ruleId: 'hint_character_invalid_at_this_point',
- regexToMatch: /^Package calc error: `(.+?)' invalid at this point/,
- package: 'calc',
- },
- {
- ruleId: 'hint_command_allowed_only_in_math_mode',
- regexToMatch: /^Package amsmath error: (.+?) allowed only in math mode/,
- package: 'amsmath',
- },
- {
- ruleId: 'hint_command_undefined',
- regexToMatch: /^LaTeX error: (.+?) undefined/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_lt_in_mid_line',
- regexToMatch: /^LaTeX error: \\< in mid line/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_a_box_was_supposed_to_be_here',
- regexToMatch: /^A <Box> was supposed to be here/i, // note: can be <box>
- package: 'TeX',
- },
- {
- ruleId: 'hint_accent_not_provided_by_font_family',
- regexToMatch:
- /^Package textcomp error: Accent (.+?) not provided by font family (.+)/,
- package: 'textcomp',
- },
- {
- ruleId: 'hint_argument_of_has_an_extra',
- regexToMatch: /^Argument of (.+?) has an extra }/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_bad_line_or_vector_argument',
- regexToMatch: /^LaTeX error: Bad \\line or \\vector argument/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_bad_math_environment_delimiter',
- regexToMatch: /^LaTeX error: Bad math environment delimiter/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_begin_env_allowed_only_in_paragraph_mode',
- regexToMatch:
- /^Package amsmath error: \\begin{(.+?)} allowed only in paragraph mode/,
- package: 'amsmath',
- },
- {
- ruleId: 'hint_begin_env_on_input_line_x_ended_by_end_x',
- regexToMatch:
- /^LaTeX error: \\begin{(.+?)} on input line (.+?) ended by \\end{(.+?)}/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_begin_split_wont_work_here',
- regexToMatch: /^Package amsmath error: \\begin{split} won't work here/,
- package: 'amsmath',
- },
- {
- ruleId: 'hint_can_be_used_only_in_preamble',
- regexToMatch: /^LaTeX error: Can be used only in preamble/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_cannot_be_used_in_preamble',
- regexToMatch: /^LaTeX error: Cannot be used in preamble/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_cannot_define_unicode_char_value_lt_00a0',
- regexToMatch:
- /^Package inputenc error: Cannot define Unicode char value < 00A0/,
- package: 'inputenc',
- },
- {
- ruleId: 'hint_cannot_determine_size_of_graphic_in_file',
- regexToMatch:
- /^Package (graphics|graphicx) error: Cannot determine size of graphic in (.+)/,
- package: 'graphics/graphicx',
- },
- {
- ruleId: 'hint_cannot_include_graphics_of_type',
- regexToMatch:
- /^Package (graphics|graphicx) error: Cannot include graphics of type\s*: (.+)/,
- package: 'graphics/graphicx',
- },
- {
- ruleId: 'hint_caption_outside_float',
- regexToMatch: /^LaTeX error: \\caption outside float/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_command_already_defined',
- regexToMatch: /^LaTeX error: Command (.+?) already defined/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_command_invalid_in_math_mode',
- regexToMatch: /^LaTeX error: Command (.+?) invalid in math mode/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_command_not_defined_as_a_math_alphabet',
- regexToMatch: /^LaTeX error: Command (.+?) not defined as a math alphabet/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_corrupted_nfss_tables',
- regexToMatch: /^LaTeX error: Corrupted NFSS tables/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_counter_too_large',
- regexToMatch: /^LaTeX error: Counter too large/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_dimension_too_large',
- regexToMatch: /^Dimension too large/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_displaybreak_cannot_be_applied_here',
- regexToMatch:
- /^Package amsmath error: \\displaybreak cannot be applied here/,
- package: 'amsmath',
- },
- {
- ruleId: 'hint_division_by_0',
- regexToMatch: /^Package (graphics|graphicx) error: Division by 0/,
- package: 'graphics/graphicx',
- },
- {
- ruleId: 'hint_double_subscript',
- regexToMatch: /^Double subscript/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_double_superscript',
- regexToMatch: /^Double superscript/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_encoding_file_not_found',
- regexToMatch: /^Package fontenc error: Encoding file `(.+?)' not found/,
- package: 'fontenc',
- },
- {
- ruleId: 'hint_encoding_scheme_unknown',
- regexToMatch: /^LaTeX error: Encoding scheme `(.+?)' unknown/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_environment_undefined',
- regexToMatch: /^LaTeX error: Environment (.+?) undefined/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_erroneous_nesting_of_equation_structures',
- regexToMatch:
- /^Package amsmath error: Erroneous nesting of equation structures/,
- package: 'amsmath',
- },
- {
- ruleId: 'hint_extra_on_this_line',
- regexToMatch: /^Package amsmath error: Extra & on this line/,
- package: 'amsmath',
- },
- {
- ruleId: 'hint_extra_alignment_tab_has_been_changed_to_cr',
- regexToMatch: /^Extra alignment tab has been changed to \\cr/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_extra_endgroup',
- regexToMatch: /^Extra \\endgroup/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_extra_or',
- regexToMatch: /^Extra \\or/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_extra_right',
- regexToMatch: /^Extra \\right/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_extra_or_forgotten',
- regexToMatch: /^Extra }, or forgotten \$/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_extra_or_forgotten_endgroup',
- regexToMatch: /^Extra }, or forgotten \\endgroup/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_file_not_found',
- regexToMatch: /^LaTeX error: File `(.+?)' not found/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_file_ended_while_scanning',
- regexToMatch: /^File ended while scanning (.+)/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_float_lost',
- regexToMatch: /^LaTeX error: Float\(s\) lost/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_font_family_unknown',
- regexToMatch: /^LaTeX error: Font family `(.+?)\+(.+?)' unknown/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_font_not_found',
- regexToMatch: /^LaTeX error: Font (.+?) not found/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_font_not_loaded_not_enough_room_left',
- regexToMatch: /^Font (.+?)=(.+?) not loaded: Not enough room left/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_font_shape_not_found',
- regexToMatch: /^LaTeX error: Font shape (.+?) not found/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_i_cant_find_file',
- regexToMatch: /^I can't find file `(.+?)'/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_i_cant_write_on_file',
- regexToMatch: /^I can't write on file `(.+?)'/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_illegal_character_in_array_arg',
- regexToMatch: /^LaTeX error: Illegal character in array arg/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_illegal_parameter_number_in_definition_of',
- regexToMatch: /^Illegal parameter number in definition of (.+)/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_illegal_unit_of_measure_pt_inserted',
- regexToMatch: /^Illegal unit of measure \(pt inserted\)/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_improper_argument_for_math_accent',
- regexToMatch: /^Package amsmath error: Improper argument for math accent/,
- package: 'amsmath',
- },
- {
- ruleId: 'hint_improper_discretionary_list',
- regexToMatch: /^Improper discretionary list/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_improper_hyphenation',
- regexToMatch: /^Improper \\hyphenation/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_improper_prevdepth',
- regexToMatch: /^Improper \\prevdepth/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_improper_spacefactor',
- regexToMatch: /^Improper \\spacefactor/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_include_cannot_be_nested',
- regexToMatch: /^LaTeX error: \\include cannot be nested/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_incompatible_list_cant_be_unboxed',
- regexToMatch: /^Incompatible list can't be unboxed/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_incomplete_all_text_was_ignored_after_line',
- regexToMatch: /^Incomplete (.+?); all text was ignored after line (.+)/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_infinite_glue_shrinkage_found',
- regexToMatch: /^Infinite glue shrinkage found (.+)/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_interruption',
- regexToMatch: /^Interruption/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_invalid_use_of_commande',
- regexToMatch: /^Package amsmath error: Invalid use of (.+)/,
- package: 'amsmath',
- },
- {
- ruleId: 'hint_keyboard_character_used_is_undefined_in_input_encoding',
- regexToMatch:
- /^Package inputenc error: Keyboard character used is undefined in input encoding (.+)/,
- package: 'inputenc',
- },
- {
- ruleId: 'hint_language_definition_file_not_found',
- regexToMatch:
- /^Package babel error: Language definition file (.+?)\.ldf not found /,
- package: 'babel',
- },
- {
- ruleId: 'hint_limit_controls_must_follow_a_math_operator',
- regexToMatch: /^Limit controls must follow a math operator/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_loadclass_in_package_file',
- regexToMatch: /^LaTeX error: \\LoadClass in package file/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_lonely_item_perhaps_a_missing_list_environment',
- regexToMatch:
- /^LaTeX error: Lonely \\item--perhaps a missing list environment/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_math_alphabet_identifier_is_undefined_in_math_version',
- regexToMatch:
- /^LaTeX error: Math alphabet identifier (.+?) is undefined in math version (.+)/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_math_version_is_not_defined',
- regexToMatch: /^LaTeX error: Math version (.+?) is not defined/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_misplaced_alignment_tab_character',
- regexToMatch: /^Misplaced alignment tab character &/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_misplaced_cr',
- regexToMatch: /^Misplaced \\cr/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_misplaced_crcr',
- regexToMatch: /^Misplaced \\crcr/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_misplaced_noalign',
- regexToMatch: /^Misplaced \\noalign/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_misplaced_omit',
- regexToMatch: /^Misplaced \\omit/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_missing_begin_document',
- regexToMatch: /^LaTeX error: Missing \\begin{document}/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_missing_control_sequence_inserted',
- regexToMatch: /^Missing control sequence inserted/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_missing_cr_inserted',
- regexToMatch: /^Missing \\cr inserted/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_missing_delimiter_inserted',
- regexToMatch: /^Missing delimiter \(. inserted\)/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_missing_endcsname_inserted',
- regexToMatch: /^Missing \\endcsname inserted/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_missing_number_treated_as_zero',
- regexToMatch: /^Missing number, treated as zero/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_missing_p_arg_in_array_arg',
- regexToMatch: /^LaTeX error: Missing p-arg in array arg/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_missing_exp_in_array_arg',
- regexToMatch: /^LaTeX error: Missing @-exp in array arg/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_missing_inserted_in_alignment_preamble',
- regexToMatch: /^Missing # inserted in alignment preamble/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_missing_inserted_for_ifnum',
- regexToMatch: /^Missing = inserted for \\ifnum/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_missing_inserted_for_ifdim',
- regexToMatch: /^Missing = inserted for \\ifdim/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_missing_inserted',
- regexToMatch: /^Missing \$ inserted/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_missing_endgroup_inserted',
- regexToMatch: /^Missing \\endgroup inserted/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_missing_right_inserted',
- regexToMatch: /^Missing \\right\. inserted/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_missing_inserted',
- regexToMatch: /^Missing \{ inserted/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_missing_inserted',
- regexToMatch: /^Missing } inserted/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_multiple_labels_label_tiquette_will_be_lost',
- regexToMatch:
- /^Package amsmath error: Multiple \\label's: label (.+?) will be lost/,
- package: 'amsmath',
- },
- {
- ruleId: 'hint_multiple_tag',
- regexToMatch: /^Package amsmath error: Multiple \\tag/,
- package: 'amsmath',
- },
- {
- ruleId: 'hint_no_counter_defined',
- regexToMatch: /^LaTeX error: No counter '(.+?)' defined/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_no_cyrillic_encoding_definition_files_were_found',
- regexToMatch:
- /^Package babel error: No Cyrillic encoding definition files were found/,
- package: 'babel',
- },
- {
- ruleId: 'hint_no_declaration_for_shape',
- regexToMatch: /^LaTeX error: No declaration for shape (.+)/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_no_driver_specified',
- regexToMatch:
- /^Package (color|graphics|graphicx) error: No driver specified/,
- package: 'color/graphics/graphicx',
- },
- {
- ruleId: 'hint_no_room_for_a_new_register',
- regexToMatch: /^No room for a new (.+)/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_no_title_given',
- regexToMatch: /^LaTeX error: No \\title given/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_not_a_letter',
- regexToMatch: /^Not a letter/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_not_in_outer_par_mode',
- regexToMatch: /^LaTeX error: Not in outer par mode/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_number_too_big',
- regexToMatch: /^Number too big/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_ok_see_the_transcript_file',
- regexToMatch: /^OK \(see the transcript file\)/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_old_form_should_be_begin',
- regexToMatch:
- /^Package amsmath error: Old form (.+?) should be \\begin{(.+?)} /,
- package: 'amsmath',
- },
- {
- ruleId: 'hint_only_one_is_allowed_per_tab',
- regexToMatch: /^Only one # is allowed per tab/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_option_clash_for_package',
- regexToMatch: /^LaTeX error: Option clash for package (.+)/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_page_height_already_too_large',
- regexToMatch: /^LaTeX error: Page height already too large/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_paragraph_ended_before_command_was_complete',
- regexToMatch: /^Paragraph ended before (.+?) was complete/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_please_type_a_command_or_say_end',
- regexToMatch: /^\(Please type a command or say `\\end'\)/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_pushtabs_and_poptabs_dont_match',
- regexToMatch: /^LaTeX error: \\pushtabs and \\poptabs don't match/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_requirepackage_or_loadclass_in_options_section',
- regexToMatch:
- /^LaTeX error: \\RequirePackage or \\LoadClass in Options Section/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_rotation_not_supported',
- regexToMatch: /^Package (graphics|graphicx) error: Rotation not supported/,
- package: 'graphics/graphicx',
- },
- {
- ruleId: 'hint_runaway',
- regexToMatch: /^Runaway (.+)/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_you_havent_specified_a_language_option',
- regexToMatch:
- /^Package babel error: You haven't specified a language option/,
- package: 'babel',
- },
- ]
- const warnings: Rule[] = [
- {
- ruleId: 'hint_calculating_math_sizes_for_size',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): Calculating math sizes for size (.+)/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_checking_defaults_for',
- regexToMatch: /^LaTeX (Font )?(Warning|Info): Checking defaults for (.+)/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_citation_on_page_undefined',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): Citation `(.+?)' on page (.+?) undefined/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_command_invalid_in_math_mode',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): Command (.+?) invalid in math mode/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_document_class',
- regexToMatch: /^LaTeX (Font )?(Warning|Info): Document Class\s*: (.+)/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_empty_thebibliography_environment',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): Empty `thebibliography' environment/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_encoding_has_changed_to_for',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): Encoding (.+?) has changed to (.+?) for/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_end_occurred_inside_a_group_at_level',
- regexToMatch: /^\(\\end occurred inside a group at level (.+)\)/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_when_condition_on_line_was_incomplete',
- regexToMatch: /^\(\\end occurred when (.+?) on line (.+) was incomplete\)/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_external_font_loaded_for_size',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): External font (.+?) loaded for size (.+)/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_faking_for_font_family_in_ts1_encoding',
- regexToMatch:
- /^Package TeXtcomp (Warning|Info): Faking (.+?) for font family (.+?) in TS1 encoding/,
- package: 'TeXtcomp',
- },
- {
- ruleId:
- 'hint_file_already_exists_on_the_system_not_generating_it_from_this_source',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): File `(.+?)' already exists on the system\.\nNot generating it from this source\./,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_file',
- regexToMatch: /^LaTeX (Font )?(Warning|Info): File\s*: (.+)/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_file_font_definition',
- regexToMatch: /^LaTeX (Font )?(Warning|Info): File\s*: (.+?)\.fd (.+)/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_float_too_large_for_page_by',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): Float too large for page by (.+)/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_font_shape_in_size_not_available_external_font_used',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): Font shape (.+?) in size (.+?) not available\nexternal font (.+?) used/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_font_shape_in_size_not_available_size_substituted',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): Font shape (.+?) in size (.+?) not available\nsize (.+?) substituted/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_font_shape_in_size_not_available_shape_forme_tried',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): Font shape (.+?) in size (.+?) not available\nshape (.+?) tried/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_font_shape_forme_undefined_using_autre_forme_instead',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): Font shape (.+?) undefined\. Using `(.+?)' instead/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_font_shape_forme_will_be_scaled_to_size_taille_',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): Font shape (.+?) will be scaled to size (.+)/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_foreign_command',
- regexToMatch: /^Package amsmath (Warning|Info): Foreign command (.+?);/,
- package: 'amsmath',
- },
- {
- ruleId: 'hint_form_feed_has_been_converted_to_blank_line',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): Form feed has been converted to Blank Line/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_float_specifier_changed',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): `(.+?)' float specifier changed to `(.+?)'/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_ignoring_text_after_end',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): Ignoring text `(.+?)' after \\end{(.+?)}/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_label_multiply_defined',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): Label `(.+?)' multiply defined/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_labels_may_have_changed_rerun_to_get_cross_references_right',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): Label\(s\) may have changed\. Rerun to get cross-references right\./,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_loose_hbox_badness',
- regexToMatch: /^Loose \\hbox \(badness (.+?)\) (.+)/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_loose_vbox_badness',
- regexToMatch: /^Loose \\vbox \(badness (.+?)\) (.+)/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_making_an_active_character',
- regexToMatch:
- /^Package babel (Warning|Info): Making (.+?) an active character/,
- package: 'babel',
- },
- {
- ruleId: 'hint_marginpar_on_page_moved',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): Marginpar on page (.+?) moved/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_missing_character_there_is_no_in_font',
- regexToMatch: /^Missing character\s*: There is no (.+?) in font (.+?)!/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_no_author_given',
- regexToMatch: /^LaTeX (Font )?(Warning|Info): No \\author given/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_no_auxiliary_output_files',
- regexToMatch: /^LaTeX (Font )?(Warning|Info): No auxiliary output files/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_no_characters_defined_by_input_encoding_change_to',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): No characters defined by input encoding change to (.+)/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_no_file',
- regexToMatch: /^LaTeX (Font )?(Warning|Info): No file (.+)/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_no_hyphenation_patterns_were_loaded_for_the_language',
- regexToMatch:
- /^Package babel (Warning|Info): No hyphenation patterns were loaded for the language `(.+?)'/,
- package: 'babel',
- },
- {
- ruleId: 'hint_no_input_encoding_specified_for_language',
- regexToMatch:
- /^Package babel (Warning|Info): No input encoding specified for (.+?) language/,
- package: 'babel',
- },
- {
- ruleId: 'hint_no_positions_in_optional_float_specifier',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): No positions in optional float specifier\./,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_oldstyle_digits_unavailable_for_family',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): Oldstyle digits unavailable for family (.+)/,
- package: 'Textcomp',
- },
- {
- ruleId: 'hint_optional_argument_of_twocolumn_too_tall_on_page',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): Optional argument of \\twocolumn too tall on page (.+)/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_oval_circle_or_line_size_unavailable',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): \\oval, \\circle, or \\line size unavailable/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_overfull_hbox_too_wide_quelque_part_',
- regexToMatch: /^Overfull \\hbox \((.+?)pt too wide\) (.+)/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_overfull_vbox_pt_too_wide',
- regexToMatch: /^Overfull \\vbox \((.+?)pt too wide\)\) (.+)/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_overwriting_encoding_scheme_quelque_chose_defaults',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): Overwriting encoding scheme (.+?) defaults/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_overwriting_in_version',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): Overwriting (.+?) in version `(.+)'/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_package',
- regexToMatch: /^LaTeX (Font )?(Warning|Info): Package: (.+)/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_redeclaring_font_encoding',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): Redeclaring font encoding (.+)/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_redeclaring_math_accent',
- regexToMatch: /^LaTeX (Font )?(Warning|Info): Redeclaring math accent (.+)/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_redeclaring_math_alphabet',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): Redeclaring math alphabet (.+)/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_redeclaring_math_symbol',
- regexToMatch: /^LaTeX (Font )?(Warning|Info): Redeclaring math symbol (.+)/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_redeclaring_math_version',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): Redeclaring math version (.+)/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_redeclaring_symbol_font',
- regexToMatch: /^LaTeX (Font )?(Warning|Info): Redeclaring symbol font (.+)/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_reference_on_page_undefined',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): Reference `(.+?)' on page (.+?) undefined/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_size_substitutions_with_differences_up_to_have_occurred',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): Size substitutions with differences up to (.+?) have occurred/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_some_font_shapes_were_not_available_defaults_substituted',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): Some font shapes were not available, defaults substituted/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_tab_has_been_converted_to_blank_space',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): Tab has been converted to Blank Space/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_text_page_contains_only_floats',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): text page (.+?) contains only floats/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_there_were_multiply_defined_labels',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): There were multiply-defined labels/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_there_were_undefined_references',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): There were undefined references/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_tight_hbox_badness',
- regexToMatch: /^Tight \\hbox \(badness (.+?)\) (.+)/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_tight_vbox_badness',
- regexToMatch: /^Tight \\vbox \(badness (.+?)\) (.+)/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_try_loading_font_information_for',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): Try loading font information for (.+?)\+(.+)/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_unable_to_redefine_math_accent',
- regexToMatch:
- /^Package amsmath (Warning|Info): Unable to redefine math accent (.+)/,
- package: 'amsmath',
- },
- {
- ruleId: 'hint_hbox_badness_detected_at_line',
- regexToMatch:
- /^Underfull \\hbox \(badness (.+?)\) (.+?) detected at line (.+)/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_hbox_badness_has_occurred_while_output_is_active',
- regexToMatch:
- /^Underfull \\hbox \(badness (.+?)\) (.+?) has occurred while \\output is active/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_hbox_badness_in_alignment_at_lines',
- regexToMatch:
- /^Underfull \\hbox \(badness (.+?)\) (.+?) in alignment at lines (.+)/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_hbox_badness_in_paragraph_at_lines',
- regexToMatch:
- /^Underfull \\hbox \(badness (.+?)\) (.+?) in paragraph at lines (.+)/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_vbox_badness_detected_at_line',
- regexToMatch:
- /^Underfull \\vbox \(badness (.+?)\) (.+?) detected at line (.+)/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_vbox_badness_has_occurred_while_output_is_active',
- regexToMatch:
- /^Underfull \\vbox \(badness (.+?)\) (.+?) has occurred while \\output is active/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_vbox_badness_in_alignment_at_lines',
- regexToMatch:
- /^Underfull \\vbox \(badness (.+?)\) (.+?) in alignment at lines (.+)/,
- package: 'TeX',
- },
- {
- ruleId: 'hint_unused_global_options',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): Unused global option\(s\)\s*: \[(.+?)]/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_writing_file',
- regexToMatch: /^LaTeX (Font )?(Warning|Info): Writing file `(.+?)'/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_writing_text_before_end_as_last_line_of',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): Writing text `(.+?)' before \\end{(.+?)} as last line of (.+)/,
- package: 'LaTeX',
- },
- {
- ruleId: 'hint_you_have_more_than_once_selected_the_attribute_for_language',
- regexToMatch:
- /^Package babel (Warning|Info): You have more than once selected the attribute `(.+?)' for language (.+)/,
- package: 'babel',
- },
- {
- ruleId:
- 'hint_you_have_requested_package_or_class_but_the_package_or_class_provides',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): You have requested (package|class) `(.+?)', but the (package|class) provides `(.+?)'/,
- package: 'LaTeX',
- },
- {
- ruleId:
- 'hint_you_have_requested_release_date_of_latex_but_only_release_ancienne_date_is_available',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): You have requested release `(.+?)' of LaTeX, but only release `(.+?)' is available/,
- package: 'LaTeX',
- },
- {
- ruleId:
- 'hint_you_have_requested_on_line_version_of_but_only_version_is_available',
- regexToMatch:
- /^LaTeX (Font )?(Warning|Info): You have requested, on line (.+?), version `(.+?)' of (.+?), but only version `(.+?)' is available/,
- package: 'LaTeX',
- },
- ]
- export default [...rules, ...errors, ...warnings]
|