]> git.lyx.org Git - features.git/commitdiff
tex2lyx: backport new features from master
authorUwe Stöhr <uwestoehr@lyx.org>
Mon, 10 Nov 2014 01:23:05 +0000 (02:23 +0100)
committerUwe Stöhr <uwestoehr@lyx.org>
Mon, 10 Nov 2014 01:23:05 +0000 (02:23 +0100)
- support for bibtopic, \nameref and 2 math fonts

src/tex2lyx/Preamble.cpp
src/tex2lyx/TODO.txt
src/tex2lyx/test/test-insets.lyx.lyx
src/tex2lyx/test/test-insets.tex
src/tex2lyx/text.cpp
status.21x

index c87b766d083a9d52458cfa677644d41d0b3d4d14..f138348b90111fac60d1026142a478c64c4b945f 100644 (file)
@@ -768,6 +768,14 @@ void Preamble::handle_package(Parser &p, string const & name,
                        h_font_math = "minion-ntxm";
        }
 
+       if (name == "iwona")
+               if (opts == "math")
+                       h_font_math = "iwona-math";
+
+       if (name == "kurier")
+               if (opts == "math")
+                       h_font_math = "kurier-math";
+
        // after the detection and handling of special cases, we can remove the
        // fonts, otherwise they would appear in the preamble, see bug #7856
        if (is_known(name, known_roman_fonts) || is_known(name, known_sans_fonts)
@@ -958,6 +966,9 @@ void Preamble::handle_package(Parser &p, string const & name,
                h_cite_engine_type = "authoryear";
        }
 
+       else if (name == "bibtopic")
+               h_use_bibtopic = "true";
+
        else if (name == "hyperref")
                handle_hyperref(options);
 
index 17979db98529625e3916234f4e0442e165adb9fc..afd7ce414bf69ba1284e67345e3c14ba7963a6f2 100644 (file)
@@ -18,7 +18,6 @@ Format LaTeX feature                        LyX feature
 226    nothing (impossible to import)       InsetBranch, \branch...\end_branch
 226    transformations                      InsetExternal
 228    draft                                InsetExternal
-232    bibtopic                             InsetBibTeX
 254    esint.sty                            \use_esint
 267    XeTeX                                utf8 encoding
 270    \alert, \structure (beamer)          layout
@@ -46,7 +45,6 @@ Format LaTeX feature                        LyX feature
 390    forward/reverse search               \forward_search, \forward_macro
 391    decimal alignment in tables          InsetTabular
 392    new beamer format                    InsetLayout
-396    nameref.sty                          InsetRef
 399    automatic mathdots loading           \use_mathdots
 407    vertical offset for multirows        InsetTabular
 411    support for polyglossia              \language_package  (the cases of no package, of babel and of custom package is supported)
@@ -80,7 +78,6 @@ Format LaTeX feature                        LyX feature
 459    beamer: \begin{frame},               \begin_layout Frame
        \begin{frame}[plain],                \begin_layout PlainFrame
        \begin{frame}[fragile]               \begin_layout FragileFrame
-461   support for kurier math font (the other kurier fonts are already supported)
 462    New libertine LaTeX fonts:
        \usepackage[scale|scaled|ttscale=$val]{libertineMono-type1}
                                             \font_typewriter
@@ -96,7 +93,6 @@ Format LaTeX feature                        LyX feature
       \twocolumn[]{}{}                      Layout Twocolumn, InsetArgument
       \item[]<>                             InsetArgument
       \begin{enumerate|itemize|...}[]       InsetArgument
-467   support for iwona math font (the other iwona fonts are already supported)
 
 
 General
index a90bec931514666888420a30268c9a9c6f40efae..25f372b5ddd1b1ba5fa7db4824ee6e709045a11e 100644 (file)
@@ -250,6 +250,18 @@ reference "lab:test"
 LatexCommand formatted
 reference "lab:test"
 
+\end_inset
+
+ as well as textual references like
+\begin_inset space ~
+
+\end_inset
+
+
+\begin_inset CommandInset ref
+LatexCommand nameref
+reference "lab:test"
+
 \end_inset
 
 . The command 
index 5009086cb9ea3f38b30db4a19b8d3e6f1af2a1d2..5fd393030788a0f4e54a13295768fae6e0d09980 100644 (file)
@@ -86,7 +86,8 @@ Of course there are other kind of references, like page
 reference~\pageref{lab:test}, but also equation
 reference~\eqref{lab:test} (from amsmath package), or varioref's
 equivalents~\vref{lab:test} and~\vpageref{lab:test}, without
-forgetting pretty references like~\prettyref{lab:test}.
+forgetting pretty references like~\prettyref{lab:test} as well as textual
+references like~\nameref{lab:test}.
 The command \secref{lab:test} will be parsed in ERT, since LyX
 does not support refstyle and prettyref natively at the same time.
 
index e5b720997d776cf9f384935350e4fdbb647175fd..6f88d8e414e21d1bf9206ce40845ec4d2d582003 100644 (file)
@@ -112,10 +112,10 @@ string parse_text_snippet(Parser & p, unsigned flags, const bool outer,
 
 
 char const * const known_ref_commands[] = { "ref", "pageref", "vref",
- "vpageref", "prettyref", "eqref", 0 };
+ "vpageref", "prettyref", "nameref", "eqref", 0 };
 
 char const * const known_coded_ref_commands[] = { "ref", "pageref", "vref",
- "vpageref", "formatted", "eqref", 0 };
+ "vpageref", "formatted", "nameref", "eqref", 0 };
 
 char const * const known_refstyle_commands[] = { "algref", "chapref", "corref",
  "eqref", "enuref", "figref", "fnref", "lemref", "parref", "partref", "propref",
@@ -1525,6 +1525,37 @@ void parse_environment(Parser & p, ostream & os, bool outer,
                        preamble.registerAutomaticallyLoadedPackage("color");
        }
 
+       else if (name == "btSect") {
+               eat_whitespace(p, os, parent_context, false);
+               parent_context.check_layout(os);
+               begin_command_inset(os, "bibtex", "bibtex");
+               string bibstyle = "plain";
+               if (p.hasOpt()) {
+                       bibstyle = p.getArg('[', ']');
+                       p.skip_spaces(true);
+               }
+               string const bibfile = p.getArg('{', '}');
+               eat_whitespace(p, os, parent_context, false);
+               Token t = p.get_token();
+               if (t.asInput() == "\\btPrintCited") {
+                       p.skip_spaces(true);
+                       os << "btprint " << '"' << "btPrintCited" << '"' << "\n";
+               }
+               if (t.asInput() == "\\btPrintNotCited") {
+                       p.skip_spaces(true);
+                       os << "btprint " << '"' << "btPrintNotCited" << '"' << "\n";
+               }
+               if (t.asInput() == "\\btPrintAll") {
+                       p.skip_spaces(true);
+                       os << "btprint " << '"' << "btPrintAll" << '"' << "\n";
+               }
+               os << "bibfiles " << '"' << bibfile << '"' << "\n";
+               os << "options " << '"' << bibstyle << '"' <<  "\n";
+               parse_text_in_inset(p, os, FLAG_END, outer, parent_context);
+               end_inset(os);
+               p.skip_spaces();
+       }
+
        else if (name == "framed" || name == "shaded") {
                eat_whitespace(p, os, parent_context, false);
                parse_outer_box(p, os, FLAG_END, outer, parent_context, name, "");
index 16c763b76f9b17644bffb50dc72082f6c06ae309..b58c57eea14c6e86cd4ebfcf0d0a798e6ba17897 100644 (file)
@@ -38,6 +38,12 @@ What's new
 
 * TEX2LYX IMPROVEMENTS
 
+- Sectioned bibliographies using the package bibtopic are now transformed.
+
+- Support for textual references (LaTeX-command \namref from the package
+  nameref).
+
+- Support for the Math fonts of the fonts Iwona and Kurier.
 
 
 * USER INTERFACE