diff --git a/src/tex2lyx/TODO.txt b/src/tex2lyx/TODO.txt index 8cb0e6929b..36400ff170 100644 --- a/src/tex2lyx/TODO.txt +++ b/src/tex2lyx/TODO.txt @@ -95,4 +95,7 @@ Format LaTeX feature LyX feature 399 automatic mathdots loading \use_mathdots 400 other rules than \lyxline InsetLine 401 feyn.sty InsetMathDiagram +402 \addcontentsline InsetBibtex bibtotoc option +404 refstyle.sty InsetRef +405 author hash \author diff --git a/src/tex2lyx/preamble.cpp b/src/tex2lyx/preamble.cpp index cbdbb5de6e..9346049d01 100644 --- a/src/tex2lyx/preamble.cpp +++ b/src/tex2lyx/preamble.cpp @@ -205,6 +205,8 @@ string h_use_mathdots = "0"; string h_cite_engine = "basic"; string h_use_bibtopic = "false"; string h_paperorientation = "portrait"; +string h_suppress_date = "false"; +string h_use_refstyle = "0"; string h_notefontcolor; string h_secnumdepth = "3"; string h_tocdepth = "3"; @@ -734,7 +736,9 @@ void end_preamble(ostream & os, TextClass const & /*textclass*/) << "\\use_mathdots " << h_use_mathdots << "\n" << "\\cite_engine " << h_cite_engine << "\n" << "\\use_bibtopic " << h_use_bibtopic << "\n" - << "\\paperorientation " << h_paperorientation << '\n'; + << "\\paperorientation " << h_paperorientation << '\n' + << "\\suppress_date " << h_suppress_date << '\n' + << "\\use_refstyle " << h_use_refstyle << '\n'; if (!h_notefontcolor.empty()) os << "\\notefontcolor " << h_notefontcolor << '\n'; os << h_margins diff --git a/src/tex2lyx/tex2lyx.h b/src/tex2lyx/tex2lyx.h index 546c9211a8..551fb998ed 100644 --- a/src/tex2lyx/tex2lyx.h +++ b/src/tex2lyx/tex2lyx.h @@ -166,7 +166,7 @@ extern bool noweb_mode; /// Did we recognize any pdflatex-only construct? extern bool pdflatex; /// LyX format that is created by tex2lyx -int const LYX_FORMAT = 401; +int const LYX_FORMAT = 405; /// path of the master .tex file extern std::string getMasterFilePath(); diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index 930b318c53..75c5745c95 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -109,6 +109,9 @@ string parse_text_snippet(Parser & p, unsigned flags, const bool outer, char const * const known_ref_commands[] = { "ref", "pageref", "vref", "vpageref", "prettyref", "eqref", 0 }; +char const * const known_coded_ref_commands[] = { "ref", "pageref", "vref", + "vpageref", "formatted", "eqref", 0 }; + /*! * natbib commands. * The starred forms are also known except for "citefullauthor", @@ -2471,7 +2474,10 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, string const opt = p.getOpt(); if (opt.empty()) { context.check_layout(os); - begin_command_inset(os, "ref", t.cs()); + char const * const * where = is_known(t.cs(), + known_ref_commands); + begin_command_inset(os, "ref", + known_coded_ref_commands[where - known_ref_commands]); os << "reference \"" << convert_command_inset_arg(p.verbatim_item()) << "\"\n";