]> git.lyx.org Git - features.git/commitdiff
tex2lyx: fix the preamble output
authorUwe Stöhr <uwestoehr@lyx.org>
Sat, 8 Apr 2017 02:55:22 +0000 (04:55 +0200)
committerUwe Stöhr <uwestoehr@lyx.org>
Sat, 8 Apr 2017 02:55:22 +0000 (04:55 +0200)
- LyX has new preamble tags. Although that they are not relevant for LaTeX they must be created by tex2lyx nevertheless
- also fix an issue that the formula indentation was always output
- update the tex2lyx tests accordingly

18 files changed:
src/tex2lyx/Preamble.cpp
src/tex2lyx/Preamble.h
src/tex2lyx/test/CJK.lyx.lyx
src/tex2lyx/test/CJKutf8.lyx.lyx
src/tex2lyx/test/DummyDocument.lyx.lyx
src/tex2lyx/test/Dummy~Document.lyx.lyx
src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx
src/tex2lyx/test/algo2e.lyx.lyx
src/tex2lyx/test/box-color-size-space-align.lyx.lyx
src/tex2lyx/test/test-insets-basic.lyx.lyx
src/tex2lyx/test/test-insets.lyx.lyx
src/tex2lyx/test/test-memoir.lyx.lyx
src/tex2lyx/test/test-modules.lyx.lyx
src/tex2lyx/test/test-refstyle-theorems.lyx.lyx
src/tex2lyx/test/test-scr.lyx.lyx
src/tex2lyx/test/test-structure.lyx.lyx
src/tex2lyx/test/test.lyx.lyx
src/tex2lyx/test/verbatim.lyx.lyx

index 93ddedfda9f22cef310a206d24a5d137a1ea3a7a..894e29e25cd8fb0b944713b6c887c43818087f15 100644 (file)
@@ -462,7 +462,7 @@ string remove_braces(string const & value)
 
 Preamble::Preamble() : one_language(true), explicit_babel(false),
        title_layout_found(false), index_number(0), h_font_cjk_set(false),
-       h_use_microtype(false)
+       h_use_microtype("false")
 {
        //h_backgroundcolor;
        //h_boxbgcolor;
@@ -472,6 +472,7 @@ Preamble::Preamble() : one_language(true), explicit_babel(false),
        h_cite_engine_type        = "default";
        h_color                   = "#008000";
        h_defskip                 = "medskip";
+       h_dynamic_quotes          = false;
        //h_float_placement;
        //h_fontcolor;
        h_fontencoding            = "default";
@@ -545,11 +546,12 @@ Preamble::Preamble() : one_language(true), explicit_babel(false),
        h_tocdepth                = "3";
        h_tracking_changes        = "false";
        h_use_bibtopic            = "false";
+       h_use_dash_ligatures      = "true";
        h_use_indices             = "false";
        h_use_geometry            = "false";
        h_use_default_options     = "false";
        h_use_hyperref            = "false";
-       h_use_microtype           = false;
+       h_use_microtype           = "false";
        h_use_refstyle            = false;
        h_use_packages["amsmath"]    = "1";
        h_use_packages["amssymb"]    = "0";
@@ -1055,7 +1057,7 @@ void Preamble::handle_package(Parser &p, string const & name,
        else if (name == "microtype") {
                //we internally support only microtype without params
                if (options.empty())
-                       h_use_microtype = true;
+                       h_use_microtype = "true";
                else
                        h_preamble << "\\usepackage[" << opts << "]{microtype}";
        }
@@ -1209,6 +1211,7 @@ bool Preamble::writeLyXHeader(ostream & os, bool subdoc, string const & outfiled
        if (!h_font_cjk.empty())
                os << "\\font_cjk " << h_font_cjk << '\n';
        os << "\\use_microtype " << h_use_microtype << '\n'
+          << "\\use_dash_ligatures " << h_use_dash_ligatures << '\n'
           << "\\graphics " << h_graphics << '\n'
           << "\\default_output_format " << h_default_output_format << "\n"
           << "\\output_sync " << h_output_sync << "\n";
@@ -1287,9 +1290,11 @@ bool Preamble::writeLyXHeader(ostream & os, bool subdoc, string const & outfiled
                os << "\\defskip " << h_defskip << "\n";
        else
                os << "\\paragraph_indentation " << h_paragraph_indentation << "\n";
-       os << "\\is_formula_indent " << h_is_formulaindent << "\n"
-          << "\\formula_indentation " << h_formulaindentation << "\n"
-          << "\\quotes_style " << h_quotes_style << "\n"
+       os << "\\is_formula_indent " << h_is_formulaindent << "\n";
+       if (!h_formulaindentation.empty())
+               os << "\\formula_indentation " << h_formulaindentation << "\n";
+       os << "\\quotes_style " << h_quotes_style << "\n"
+          << "\\dynamic_quotes " << h_dynamic_quotes << "\n"
           << "\\papercolumns " << h_papercolumns << "\n"
           << "\\papersides " << h_papersides << "\n"
           << "\\paperpagestyle " << h_paperpagestyle << "\n";
index 8b39c36c119c0bab0a3cf72c4ccec9157ce22dbf..567a97df839c2bbe0b745385f9b818b6f3364f95 100644 (file)
@@ -136,6 +136,7 @@ private:
        std::string h_cite_engine_type;
        std::string h_color;
        std::string h_defskip;
+       bool h_dynamic_quotes;
        std::string h_float_placement;
        std::string h_fontcolor;
        std::string h_fontencoding;
@@ -151,7 +152,7 @@ private:
        std::string h_font_tt_scale[2];
        bool h_font_cjk_set;
        std::string h_font_cjk;
-       bool h_use_microtype;
+       std::string h_use_microtype;
        std::string h_is_formulaindent;
        std::string h_formulaindentation;
        std::string h_graphics;
@@ -207,6 +208,7 @@ private:
        std::string h_tocdepth;
        std::string h_tracking_changes;
        std::string h_use_bibtopic;
+       std::string h_use_dash_ligatures;
        std::string h_use_indices;
        std::string h_use_geometry;
        std::map<std::string, std::string> h_use_packages;
index b574057079ae21898b96c92aa181fe25631a7522..919f894fd45dac5e1fb3d993dfeb938dbd22a61f 100644 (file)
@@ -32,7 +32,8 @@
 \font_osf false
 \font_sf_scale 100 100
 \font_tt_scale 100 100
-\use_microtype 0
+\use_microtype false
+\use_dash_ligatures true
 \graphics default
 \default_output_format default
 \output_sync 0
@@ -71,8 +72,8 @@
 \paragraph_separation indent
 \paragraph_indentation default
 \is_formula_indent 0
-\formula_indentation 
 \quotes_style english
+\dynamic_quotes 0
 \papercolumns 1
 \papersides 1
 \paperpagestyle default
index c844760a4cf5b11b97182618651e37d7b0548bce..adb1628cb9587818ea6cc3cc444ce72c12904ce3 100644 (file)
@@ -32,7 +32,8 @@
 \font_osf false
 \font_sf_scale 100 100
 \font_tt_scale 100 100
-\use_microtype 0
+\use_microtype false
+\use_dash_ligatures true
 \graphics default
 \default_output_format default
 \output_sync 0
@@ -71,8 +72,8 @@
 \paragraph_separation indent
 \paragraph_indentation default
 \is_formula_indent 0
-\formula_indentation 
 \quotes_style english
+\dynamic_quotes 0
 \papercolumns 1
 \papersides 1
 \paperpagestyle default
index de15cc16d77fd621973a8223be26a17d6a06a79e..e27caa81da980a4179765db0c6a096189ab8c666 100644 (file)
@@ -21,7 +21,8 @@
 \font_osf false
 \font_sf_scale 100 100
 \font_tt_scale 100 100
-\use_microtype 0
+\use_microtype false
+\use_dash_ligatures true
 \graphics default
 \default_output_format default
 \output_sync 0
@@ -77,8 +78,8 @@
 \paragraph_separation indent
 \paragraph_indentation 3mm
 \is_formula_indent 0
-\formula_indentation 
 \quotes_style english
+\dynamic_quotes 0
 \papercolumns 1
 \papersides 1
 \paperpagestyle default
index 052dfd5be85b6e8cf4b7c391a7422d42f66fec27..ccb6d40e3ff6f64a960862284cec30c1d5794538 100644 (file)
@@ -21,7 +21,8 @@
 \font_osf false
 \font_sf_scale 100 100
 \font_tt_scale 100 100
-\use_microtype 0
+\use_microtype false
+\use_dash_ligatures true
 \graphics default
 \default_output_format default
 \output_sync 0
@@ -77,8 +78,8 @@
 \paragraph_separation indent
 \paragraph_indentation 3mm
 \is_formula_indent 0
-\formula_indentation 
 \quotes_style english
+\dynamic_quotes 0
 \papercolumns 1
 \papersides 1
 \paperpagestyle default
index c857640ce982566ef0aa0a7c992ea171f4f36999..e49d74e633e85441031fb6671f3ab3e9fe80bccb 100644 (file)
@@ -31,7 +31,8 @@
 \font_osf false
 \font_sf_scale 100 75
 \font_tt_scale 100 100
-\use_microtype 0
+\use_microtype false
+\use_dash_ligatures true
 \graphics default
 \default_output_format pdf4
 \output_sync 0
@@ -70,8 +71,8 @@
 \paragraph_separation indent
 \paragraph_indentation default
 \is_formula_indent 0
-\formula_indentation 
 \quotes_style english
+\dynamic_quotes 0
 \papercolumns 1
 \papersides 1
 \paperpagestyle default
index 2ab963b047cd6320484e96a991b79e56b7231df2..30358f4538a0e49d4a3c783ac8d6dea0ef1fc459 100644 (file)
@@ -30,7 +30,8 @@ algorithm2e
 \font_osf false
 \font_sf_scale 100 100
 \font_tt_scale 100 100
-\use_microtype 0
+\use_microtype false
+\use_dash_ligatures true
 \graphics default
 \default_output_format default
 \output_sync 0
@@ -69,8 +70,8 @@ algorithm2e
 \paragraph_separation indent
 \paragraph_indentation default
 \is_formula_indent 0
-\formula_indentation 
 \quotes_style english
+\dynamic_quotes 0
 \papercolumns 1
 \papersides 1
 \paperpagestyle default
index 0438b29e5c99010c26148a048f9f53174c2a8dad..bdbfd2e99ea63c4d24a8caaddaf2cc4201abb3c7 100644 (file)
@@ -56,7 +56,8 @@
 \font_osf false
 \font_sf_scale 100 100
 \font_tt_scale 100 100
-\use_microtype 0
+\use_microtype false
+\use_dash_ligatures true
 \graphics default
 \default_output_format default
 \output_sync 0
 \paragraph_separation skip
 \defskip 3mm
 \is_formula_indent 0
-\formula_indentation 
 \quotes_style english
+\dynamic_quotes 0
 \papercolumns 2
 \papersides 2
 \paperpagestyle default
index 208a6a81cbd40eb4b9f880ecc5e470705dec9487..12ffb051e6840a4ac58bda7748946e0093307b47 100644 (file)
@@ -57,7 +57,8 @@
 \font_osf false
 \font_sf_scale 100 100
 \font_tt_scale 100 100
-\use_microtype 0
+\use_microtype false
+\use_dash_ligatures true
 \graphics default
 \default_output_format default
 \output_sync 0
 \paragraph_separation indent
 \paragraph_indentation 3mm
 \is_formula_indent 0
-\formula_indentation 
 \quotes_style english
+\dynamic_quotes 0
 \papercolumns 1
 \papersides 1
 \paperpagestyle default
index 5b5a22abd3b2b38907a439c434dd719d11273bee..6344e4c8949069b3476bf787a56162d1a92959f3 100644 (file)
@@ -33,7 +33,8 @@
 \font_osf false
 \font_sf_scale 100 100
 \font_tt_scale 100 100
-\use_microtype 0
+\use_microtype false
+\use_dash_ligatures true
 \graphics default
 \default_output_format default
 \output_sync 0
@@ -89,8 +90,8 @@
 \paragraph_separation indent
 \paragraph_indentation 3mm
 \is_formula_indent 0
-\formula_indentation 
 \quotes_style english
+\dynamic_quotes 0
 \papercolumns 1
 \papersides 1
 \paperpagestyle default
index 62e7def297ef33719c4405c88ec5bf3b22ad9d52..b153a78a0749417fe3c98236d08c1c96c7bff566 100644 (file)
@@ -28,7 +28,8 @@
 \font_osf false
 \font_sf_scale 100 100
 \font_tt_scale 100 100
-\use_microtype 0
+\use_microtype false
+\use_dash_ligatures true
 \graphics default
 \default_output_format default
 \output_sync 0
@@ -67,8 +68,8 @@
 \paragraph_separation indent
 \paragraph_indentation default
 \is_formula_indent 0
-\formula_indentation 
 \quotes_style english
+\dynamic_quotes 0
 \papercolumns 1
 \papersides 1
 \paperpagestyle default
index 94210d93e17b31ccee3a0ea1bba98022d77fb072..50ac72223541479ce21306d6a2aacb821786685b 100644 (file)
@@ -28,7 +28,8 @@ theorems-ams
 \font_osf false
 \font_sf_scale 100 100
 \font_tt_scale 100 100
-\use_microtype 0
+\use_microtype false
+\use_dash_ligatures true
 \graphics default
 \default_output_format default
 \output_sync 0
@@ -67,8 +68,8 @@ theorems-ams
 \paragraph_separation indent
 \paragraph_indentation default
 \is_formula_indent 0
-\formula_indentation 
 \quotes_style english
+\dynamic_quotes 0
 \papercolumns 1
 \papersides 1
 \paperpagestyle default
index 42dc89c78dab4bd9621e8721e15c33fba15dc92a..b3e95c847c5c246501a73a18b6f3f803817d6284 100644 (file)
@@ -28,7 +28,8 @@ theorems-ams
 \font_osf false
 \font_sf_scale 100 100
 \font_tt_scale 100 100
-\use_microtype 0
+\use_microtype false
+\use_dash_ligatures true
 \graphics default
 \default_output_format default
 \output_sync 0
@@ -67,8 +68,8 @@ theorems-ams
 \paragraph_separation indent
 \paragraph_indentation default
 \is_formula_indent 0
-\formula_indentation 
 \quotes_style english
+\dynamic_quotes 0
 \papercolumns 1
 \papersides 2
 \paperpagestyle default
index df551a7df0dd568850fe07de3cb121978198171b..73945fb354bf9b914326ce84ff58b19347d37ffa 100644 (file)
@@ -25,7 +25,8 @@
 \font_osf false
 \font_sf_scale 100 100
 \font_tt_scale 100 100
-\use_microtype 0
+\use_microtype false
+\use_dash_ligatures true
 \graphics default
 \default_output_format default
 \output_sync 0
@@ -64,8 +65,8 @@
 \paragraph_separation indent
 \paragraph_indentation default
 \is_formula_indent 0
-\formula_indentation 
 \quotes_style english
+\dynamic_quotes 0
 \papercolumns 1
 \papersides 2
 \paperpagestyle default
index 4823aa8f47be4ba2dbe9be72bdefa4842450b8ea..68e15e2c01930ac9e075e4ce70e67d4340381b36 100644 (file)
@@ -60,7 +60,8 @@ logicalmkup
 \font_osf false
 \font_sf_scale 100 100
 \font_tt_scale 100 100
-\use_microtype 0
+\use_microtype false
+\use_dash_ligatures true
 \graphics default
 \default_output_format default
 \output_sync 1
@@ -100,8 +101,8 @@ logicalmkup
 \paragraph_separation indent
 \paragraph_indentation default
 \is_formula_indent 0
-\formula_indentation 
 \quotes_style english
+\dynamic_quotes 0
 \papercolumns 1
 \papersides 1
 \paperpagestyle default
index 67f46f75f1fda6c01a93752a636148fa208aaa0b..03afa64bcd8d3753ec6ba425d2f7516d13c6accf 100644 (file)
@@ -32,7 +32,8 @@
 \font_osf false
 \font_sf_scale 100 100
 \font_tt_scale 100 100
-\use_microtype 0
+\use_microtype false
+\use_dash_ligatures true
 \graphics default
 \default_output_format default
 \output_sync 0
@@ -71,8 +72,8 @@
 \paragraph_separation indent
 \paragraph_indentation default
 \is_formula_indent 0
-\formula_indentation 
 \quotes_style english
+\dynamic_quotes 0
 \papercolumns 1
 \papersides 1
 \paperpagestyle default
index 7fbe6fdafae4da7cc4a145858dcb2adadb185649..1ba37bdfd1cdb5014988d29171d89ad72f8da048 100644 (file)
@@ -21,7 +21,8 @@
 \font_osf false
 \font_sf_scale 100 100
 \font_tt_scale 100 100
-\use_microtype 0
+\use_microtype false
+\use_dash_ligatures true
 \graphics default
 \default_output_format default
 \output_sync 0
@@ -60,8 +61,8 @@
 \paragraph_separation indent
 \paragraph_indentation default
 \is_formula_indent 0
-\formula_indentation 
 \quotes_style english
+\dynamic_quotes 0
 \papercolumns 1
 \papersides 1
 \paperpagestyle default