[LyX/master] Win installer: respect also 64bit MiKTeX
commit 9f9450cacdbbfa06f6234d733d01b7e563858b88 Author: Uwe Stöhr Date: Sun Mar 11 02:59:08 2018 +0100 Win installer: respect also 64bit MiKTeX --- .../Win32/packaging/installer/ChangeLog.txt|2 +- .../Win32/packaging/installer/include/LaTeX.nsh| 35 development/Win32/packaging/installer/settings.nsh |2 +- 3 files changed, 30 insertions(+), 9 deletions(-) diff --git a/development/Win32/packaging/installer/ChangeLog.txt b/development/Win32/packaging/installer/ChangeLog.txt index d42a6cb..d0ef0de 100644 --- a/development/Win32/packaging/installer/ChangeLog.txt +++ b/development/Win32/packaging/installer/ChangeLog.txt @@ -1,4 +1,4 @@ -Changelog for LyX-230-4: +Changelog for LyX-230-5: - installs LyX 2.3.0 - fix installation of Arabic spell checker - updated to MiKTeX 2.9 build 6615 diff --git a/development/Win32/packaging/installer/include/LaTeX.nsh b/development/Win32/packaging/installer/include/LaTeX.nsh index ab6775f..a9e29f8 100644 --- a/development/Win32/packaging/installer/include/LaTeX.nsh +++ b/development/Win32/packaging/installer/include/LaTeX.nsh @@ -422,19 +422,40 @@ Function UpdateMiKTeX ${andif} $MultiUser.Privileges != "Power" # call the non-admin version # the order of the different commands is important! - nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--update=miktex-bin-2.9"' - nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--install=miktex-console-bin-2.9"' - nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--uninstall=miktex-mpm-bin-2.9"' + ${if} $Is64bit == "true" +nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--update=miktex-bin-x64-2.9"' +nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--install=miktex-console-bin-x64-2.9"' +nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--uninstall=miktex-mpm-bin-x64-2.9"' + ${else} +nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--update=miktex-bin-2.9"' +nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--install=miktex-console-bin-2.9"' +nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--uninstall=miktex-mpm-bin-2.9"' + ${endif} nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--update"' ${else} ${if} $MiKTeXUser != "HKCU" # call the admin version # the order of the different commands is important! -nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--admin" "--update=miktex-bin-2.9"' -nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--admin" "--install=miktex-console-bin-2.9"' -nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--admin" "--uninstall=miktex-mpm-bin-2.9"' +${if} $Is64bit == "true" + nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--admin" "--update=miktex-bin-x64-2.9"' + nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--admin" "--install=miktex-console-bin-x64-2.9"' + nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--admin" "--uninstall=miktex-mpm-bin-x64-2.9"' +${else} + nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--admin" "--update=miktex-bin-2.9"' + nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--admin" "--install=miktex-console-bin-2.9"' + nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--admin" "--uninstall=miktex-mpm-bin-2.9"' +${endif} nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--admin" "--update"' ${else} - nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--update"' +${if} $Is64bit == "true" + nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--update=miktex-bin-x64-2.9"' + nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--install=miktex-console-bin-x64-2.9"' + nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--uninstall=miktex-mpm-bin-x64-2.9"' +${else} + nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--update=miktex-bin-2.9"' + nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--install=miktex-console-bin-2.9"' + nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--uninstall=miktex-mpm-bin-2.9"' +${endif} +nsExec::ExecToLog '"$PathLaTeX\mpm.exe" "--update"' ${endif} ${endif} # restore possibly broken internal MiKTeX links after the update diff --git a/development/Win32/packaging/installer/settings.nsh b/development/Win32/packaging/installer/settings.nsh index 87fb2a0..933d2ab 100644 --- a/development/Win32/packaging/installer/settings.nsh +++ b/development/Win32/packaging/installer/settings.nsh @@ -14,7 +14,7 @@ These typically need to be modified for each LyX release !define APP_VERSION_REVISION 0 !define APP_VERSION_EMERGENCY "" # use "1" for an emergency release of LyX otherwise "" !define APP_EMERGENCY_DOT "" # use "." for an emergency release of LyX otherwise "" -!define APP_VERSION_BUILD 4 # Start with 1 for the installer releases of each version +!define APP_VERSION_BUILD 5 # Start with 1 for the installer releases of each version !define APP_VERSION "${APP_VERSION_MAJOR}.${APP_VERSION_MINOR}.${APP_VERSION_REVISION}${APP_EMERGENCY_DOT}${APP_VERSION_EMERGENCY}" # Version to display
[LyX/master] add support for the PT fonts
commit d3c51876a902e5d41f79a559ffb2516674e55c1a Author: Uwe Stöhr Date: Sat Mar 10 19:59:48 2018 +0100 add support for the PT fonts - fileformat change - I also started https://wiki.lyx.org/LyX/NewInLyX24 for new features --- development/FORMAT |7 ++- lib/chkconfig.ltx |1 + lib/latexfonts | 30 lib/lyx2lyx/lyx_2_4.py | 49 ++-- src/tex2lyx/Preamble.cpp | 36 -- src/tex2lyx/test/CJK.lyx.lyx |4 +- src/tex2lyx/test/CJKutf8.lyx.lyx |4 +- src/tex2lyx/test/DummyDocument.lyx.lyx |4 +- src/tex2lyx/test/Dummy~Document.lyx.lyx|4 +- src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx |4 +- src/tex2lyx/test/algo2e.lyx.lyx|4 +- .../test/box-color-size-space-align.lyx.lyx|4 +- src/tex2lyx/test/test-insets-basic.lyx.lyx |4 +- src/tex2lyx/test/test-insets.lyx.lyx |4 +- src/tex2lyx/test/test-memoir.lyx.lyx |4 +- src/tex2lyx/test/test-minted.lyx.lyx |4 +- src/tex2lyx/test/test-modules.lyx.lyx |4 +- src/tex2lyx/test/test-refstyle-theorems.lyx.lyx|4 +- src/tex2lyx/test/test-scr.lyx.lyx |4 +- src/tex2lyx/test/test-structure.lyx.lyx|4 +- src/tex2lyx/test/test.lyx.lyx |4 +- src/tex2lyx/test/verbatim.lyx.lyx |4 +- src/version.h |4 +- 23 files changed, 149 insertions(+), 46 deletions(-) diff --git a/development/FORMAT b/development/FORMAT index 5058ee2..a57d3ed 100644 --- a/development/FORMAT +++ b/development/FORMAT @@ -7,8 +7,13 @@ changes happened in particular if possible. A good example would be --- -2018-02-23 Jürgen Spitzmüller +2018-03-10 Uwe Stöhr + * Format incremented to 546: support for ParaType fonts. + - \usepackage{PTSerif} > \font_roman "PTSerif-TLF" + - \usepackage[scaled=x.xx]{PTSans} > \font_sans "PTSans-TLF"" + - \usepackage[scaled=x.xx]{PTMono} > \font_typewriter "PTMono-TLF" +2018-02-23 Jürgen Spitzmüller * format incremented to 545: Add "literal" param to inset include This is used by the lstinput caption. diff --git a/lib/chkconfig.ltx b/lib/chkconfig.ltx index ef37440..0aa948c 100644 --- a/lib/chkconfig.ltx +++ b/lib/chkconfig.ltx @@ -464,6 +464,7 @@ \TestPackage{newtxmath} \TestPackage[binhex.tex]{binhex} % required by newtxmath \TestPackage{noto} +\TestPackage{paratype} \TestFont[psyr]{symbol} \TestPackage{tgadventor} \TestPackage{tgbonum} diff --git a/lib/latexfonts b/lib/latexfonts index a0a93ee..307b10e 100644 --- a/lib/latexfonts +++ b/lib/latexfonts @@ -356,6 +356,20 @@ AltFont pplj SwitchDefault1 EndFont +Font PTSerif-TLF + GuiName "ParaType Serif" + Family rm + Requiresparatype + Package PTSerif + CompleteFontparatype +EndFont + +AltFont paratype + GuiName "ParaType Serif" + Family rm + Package paratype +EndFont + Font times GuiName "Times Roman" Family rm @@ -582,6 +596,14 @@ Font NotoSans-TLF Requires noto EndFont +Font PTSans-TLF + GuiName "ParaType Sans" + Family sf + ScaleOption scaled=$$val + Requiresparatype + Package PTSans +EndFont + Font tgadventor GuiName "TeX Gyre Adventor" Family sf @@ -670,6 +692,14 @@ Font NotoMono-TLF Requires noto EndFont +Font PTMono-TLF + GuiName "ParaType Mono" + Family tt + ScaleOption scaled=$$val + Requiresparatype + Package PTMono +EndFont + Font tgcursor GuiName "TeX Gyre Cursor" Family tt diff --git a/lib/lyx2lyx/lyx_2_4.py b/lib/lyx2lyx/lyx_2_4.py index 21e0a08..536bf10 100644 --- a/lib/lyx2lyx/lyx_2_4.py +++ b/lib/lyx2lyx/lyx_2_4.py @@ -24,7 +24,7 @@ import sys, os # Uncomment only what you need to import, please. -from parser_tools import (find_end_of_inset, find_token) +from parser_tools import (find_end_of_inset, find_token, get_value) #del_token, del_value, del_complete_lines, #find_complete_lines, find_end_of, find_end_of_layout, #find_re, find_substring, find_token_backwards, @@ -32,8 +32,8 @@ from parser_tools import (find_end_of_inset, find_token) #get_quoted_value, is_in_inset, set_bool_value #find_tokens, find_token_exact, check_token, get_option_value -#from lyx2lyx_tools import (add_to_preamble, put_cmd_in_ert, revert_font_attrs, -#
[LyX/master] Update tex2lyx tests.
commit b8adb0f933942c9d73a528d864369169c637d328 Author: Juergen Spitzmueller Date: Sat Mar 10 16:15:29 2018 +0100 Update tex2lyx tests. --- src/tex2lyx/test/CJK.lyx.lyx | 24 +++- src/tex2lyx/test/CJKutf8.lyx.lyx |2 +- src/tex2lyx/test/DummyDocument.lyx.lyx |2 +- src/tex2lyx/test/Dummy~Document.lyx.lyx|2 +- src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx |2 +- src/tex2lyx/test/algo2e.lyx.lyx|2 +- .../test/box-color-size-space-align.lyx.lyx| 58 +++- src/tex2lyx/test/test-insets-basic.lyx.lyx | 149 ++- src/tex2lyx/test/test-insets.lyx.lyx | 154 ++-- src/tex2lyx/test/test-memoir.lyx.lyx |2 +- src/tex2lyx/test/test-minted.lyx.lyx |2 +- src/tex2lyx/test/test-modules.lyx.lyx |2 +- src/tex2lyx/test/test-refstyle-theorems.lyx.lyx|2 +- src/tex2lyx/test/test-scr.lyx.lyx |2 +- src/tex2lyx/test/test-structure.lyx.lyx| 13 +- src/tex2lyx/test/test.lyx.lyx |2 +- src/tex2lyx/test/verbatim.lyx.lyx |2 +- 17 files changed, 313 insertions(+), 109 deletions(-) diff --git a/src/tex2lyx/test/CJK.lyx.lyx b/src/tex2lyx/test/CJK.lyx.lyx index 59d3729..32109a0 100644 --- a/src/tex2lyx/test/CJK.lyx.lyx +++ b/src/tex2lyx/test/CJK.lyx.lyx @@ -1,5 +1,5 @@ #LyX file created by tex2lyx 2.3 -\lyxformat 544 +\lyxformat 545 \begin_document \begin_header \save_transient_properties true @@ -143,7 +143,27 @@ status collapsed \end_inset -texttt{hei} mapping, +texttt +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout +{ +\end_layout + +\end_inset + +hei +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout +} +\end_layout + +\end_inset + + mapping, and the first mapping is empty. \begin_inset ERT status collapsed diff --git a/src/tex2lyx/test/CJKutf8.lyx.lyx b/src/tex2lyx/test/CJKutf8.lyx.lyx index 7eeec41..aadef31 100644 --- a/src/tex2lyx/test/CJKutf8.lyx.lyx +++ b/src/tex2lyx/test/CJKutf8.lyx.lyx @@ -1,5 +1,5 @@ #LyX file created by tex2lyx 2.3 -\lyxformat 544 +\lyxformat 545 \begin_document \begin_header \save_transient_properties true diff --git a/src/tex2lyx/test/DummyDocument.lyx.lyx b/src/tex2lyx/test/DummyDocument.lyx.lyx index 03a67e0..5dddf53 100644 --- a/src/tex2lyx/test/DummyDocument.lyx.lyx +++ b/src/tex2lyx/test/DummyDocument.lyx.lyx @@ -1,5 +1,5 @@ #LyX file created by tex2lyx 2.3 -\lyxformat 544 +\lyxformat 545 \begin_document \begin_header \save_transient_properties true diff --git a/src/tex2lyx/test/Dummy~Document.lyx.lyx b/src/tex2lyx/test/Dummy~Document.lyx.lyx index 3019689..883fb4d 100644 --- a/src/tex2lyx/test/Dummy~Document.lyx.lyx +++ b/src/tex2lyx/test/Dummy~Document.lyx.lyx @@ -1,5 +1,5 @@ #LyX file created by tex2lyx 2.3 -\lyxformat 544 +\lyxformat 545 \begin_document \begin_header \save_transient_properties true diff --git a/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx b/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx index fac9a95..da2619f 100644 --- a/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx +++ b/src/tex2lyx/test/XeTeX-polyglossia.lyx.lyx @@ -1,5 +1,5 @@ #LyX file created by tex2lyx 2.3 -\lyxformat 544 +\lyxformat 545 \begin_document \begin_header \save_transient_properties true diff --git a/src/tex2lyx/test/algo2e.lyx.lyx b/src/tex2lyx/test/algo2e.lyx.lyx index fa60631..4db05e9 100644 --- a/src/tex2lyx/test/algo2e.lyx.lyx +++ b/src/tex2lyx/test/algo2e.lyx.lyx @@ -1,5 +1,5 @@ #LyX file created by tex2lyx 2.3 -\lyxformat 544 +\lyxformat 545 \begin_document \begin_header \save_transient_properties true diff --git a/src/tex2lyx/test/box-color-size-space-align.lyx.lyx b/src/tex2lyx/test/box-color-size-space-align.lyx.lyx index 30a2b15..122e033 100644 --- a/src/tex2lyx/test/box-color-size-space-align.lyx.lyx +++ b/src/tex2lyx/test/box-color-size-space-align.lyx.lyx @@ -1,5 +1,5 @@ #LyX file created by tex2lyx 2.3 -\lyxformat 544 +\lyxformat 545 \begin_document \begin_header \save_transient_properties true @@ -2878,7 +2878,47 @@ Characters \begin_layout Standard \size normal -from package "ascii" and "ifsym": ®↨◻◼◙ +from package +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout +" +\end_layout + +\end_inset + +ascii +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout +" +\end_layout + +\end_inset + + and +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout +" +\end_layout + +\end_inset + +ifsym +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout +" +\end_layout + +\end_inset + +: ®↨◻◼◙ \end_layout \begin_layout Standard @@ -2890,7 +2930,19 @@ from textcomp: №™ \begin_layout Standard \size normal -from textgreek and textcyr: ἀв +from textgreek and textcyr: +\begin_inset ERT +status collapsed + +\begin_layout Plain Layout + +\backslash +textgreek{>a}
[LyX/master] tex2lyx/TODO: update
commit ad5dbbfd65dd39045a1adea8668b2bd10dab7c27 Author: Juergen Spitzmueller Date: Sat Mar 10 15:48:49 2018 +0100 tex2lyx/TODO: update --- src/tex2lyx/TODO.txt |8 +++- 1 files changed, 7 insertions(+), 1 deletions(-) diff --git a/src/tex2lyx/TODO.txt b/src/tex2lyx/TODO.txt index 5fb90e3..9e99848 100644 --- a/src/tex2lyx/TODO.txt +++ b/src/tex2lyx/TODO.txt @@ -34,7 +34,7 @@ Format LaTeX featureLyX feature 358custom bibtex command\bibtex_command Maybe via the % !BIB program = - comment understoff by some TeX editors + comment understood by some TeX editors 358custom makeindex command \index_command 363horizontal longtable alignment InsetTabular 364branch file name suffix \filename_suffix @@ -102,6 +102,12 @@ Format LaTeX featureLyX feature \begin{btUnit}...\end{btUnit}\multibib {none|part|chapter|section|subsection} (if a part, chapter, section etc. follows the \begin...) +544 Minted support + \usepackage{minted} \use_minted + \begin{minted}{lang} \begin_inset listings + \end{minted} + \lyxmintcaption[]{caption\label{}} add to include inset + \inputminted{tex}{Intro.fls} \begin_inset include ...
[LyX/master] tex2lyx: add support for lstinputlisting
commit d325f79f5c782edcfa32e87579fb102763d8d29b Author: Juergen Spitzmueller Date: Sat Mar 10 15:40:51 2018 +0100 tex2lyx: add support for lstinputlisting --- src/tex2lyx/text.cpp | 18 -- 1 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index e12e4ee..2ef3a9f 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -4632,12 +4632,23 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, } if (t.cs() == "input" || t.cs() == "include" - || t.cs() == "verbatiminput") { + || t.cs() == "verbatiminput" + || t.cs() == "lstinputlisting") { string name = t.cs(); - if (t.cs() == "verbatiminput" + if (name == "verbatiminput" && p.next_token().asInput() == "*") name += p.get_token().asInput(); context.check_layout(os); + string lstparams; + bool literal = false; + if (name == "lstinputlisting" && p.hasOpt()) { + lstparams = p.getArg('[', ']'); + pair oa = convert_latexed_command_inset_arg(lstparams); + literal = !oa.first; + if (literal) + lstparams = subst(lstparams, "\n", " "); + } + string lit = literal ? "\"true\"" : "\"false\""; string filename(normalize_filename(p.getArg('{', '}'))); string const path = getMasterFilePath(true); // We want to preserve relative / absolute filenames, @@ -4745,6 +4756,9 @@ void parse_text(Parser & p, ostream & os, unsigned flags, bool outer, outname = subst(outname, "\"", "\\\""); os << "preview false\n" "filename \"" << outname << "\"\n"; + if (!lstparams.empty()) + os << "lstparams \"" << lstparams << "\"\n"; + os << "literal " << lit << "\n"; if (t.cs() == "verbatiminput") preamble.registerAutomaticallyLoadedPackage("verbatim"); }
[LyX/master] tex2lyx: get rid of another large if-else if chain.
commit 11e4a24e6edbd1f69b60a194b31ac2d7c4dd5034 Author: Juergen Spitzmueller Date: Sat Mar 10 15:00:30 2018 +0100 tex2lyx: get rid of another large if-else if chain. --- src/tex2lyx/Preamble.cpp | 153 ++--- 1 files changed, 102 insertions(+), 51 deletions(-) diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp index 1617ced..a59d51d 100644 --- a/src/tex2lyx/Preamble.cpp +++ b/src/tex2lyx/Preamble.cpp @@ -1451,14 +1451,18 @@ void Preamble::parse(Parser & p, string const & forceclass, t.cat() == catBegin || t.cat() == catEnd || t.cat() == catAlign || -t.cat() == catParameter)) +t.cat() == catParameter)) { h_preamble << t.cs(); + continue; + } - else if (!in_lyx_preamble && -(t.cat() == catSpace || t.cat() == catNewline)) + if (!in_lyx_preamble && + (t.cat() == catSpace || t.cat() == catNewline)) { h_preamble << t.asInput(); + continue; + } - else if (t.cat() == catComment) { + if (t.cat() == catComment) { static regex const islyxfile("%% LyX .* created this file"); static regex const usercommands("User specified LaTeX commands"); @@ -1483,18 +1487,22 @@ void Preamble::parse(Parser & p, string const & forceclass, in_lyx_preamble = false; else if (!in_lyx_preamble) h_preamble << t.asInput(); + continue; } - else if (t.cs() == "PassOptionsToPackage") { + if (t.cs() == "PassOptionsToPackage") { string const poptions = p.getArg('{', '}'); string const package = p.verbatim_item(); extra_package_options_.insert(make_pair(package, poptions)); + continue; } - else if (t.cs() == "pagestyle") + if (t.cs() == "pagestyle") { h_paperpagestyle = p.verbatim_item(); + continue; + } - else if (t.cs() == "setdefaultlanguage") { + if (t.cs() == "setdefaultlanguage") { xetex = true; // We don't yet care about non-language variant options // because LyX doesn't support this yet, see bug #8214 @@ -1517,22 +1525,25 @@ void Preamble::parse(Parser & p, string const & forceclass, h_language = p.verbatim_item(); //finally translate the poyglossia name to a LyX name h_language = polyglossia2lyx(h_language); + continue; } - else if (t.cs() == "setotherlanguage") { + if (t.cs() == "setotherlanguage") { // We don't yet care about the option because LyX doesn't // support this yet, see bug #8214 p.hasOpt() ? p.getOpt() : string(); p.verbatim_item(); + continue; } - else if (t.cs() == "setmainfont") { + if (t.cs() == "setmainfont") { // we don't care about the option p.hasOpt() ? p.getOpt() : string(); h_font_roman[1] = p.getArg('{', '}'); + continue; } - else if (t.cs() == "setsansfont" || t.cs() == "setmonofont") { + if (t.cs() == "setsansfont" || t.cs() == "setmonofont") { // LyX currently only supports the scale option string scale; if (p.hasOpt()) { @@ -1556,6 +1567,7 @@ void Preamble::parse(Parser & p, string const & forceclass, h_font_tt_scale[1] = scale; h_font_typewriter[1] = p.getArg('{', '}'); } + continue; } else if (t.cs() == "date") { @@ -1566,7 +1578,7 @@ void Preamble::parse(Parser & p, string const & forceclass, h_preamble << t.asInput() << '{' << argument << '}'; } - else if (t.cs() == "color") { + if (t.cs() == "color") { string const space = (p.hasOpt() ? p.getOpt() : string()); string argument = p.getArg('{', '}'); @@ -1587,9 +1599,10 @@ void Preamble::parse(Parser & p, string const & forceclass,
[LyX/master] tex2lyx: make nested CJK parsing slightly less dumb.
commit 0f4c9027056a6f4f771382e9ebfc7940274bf5c0 Author: Juergen Spitzmueller Date: Sat Mar 10 14:58:55 2018 +0100 tex2lyx: make nested CJK parsing slightly less dumb. Fixes: #9562 --- src/tex2lyx/text.cpp | 19 ++- 1 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/tex2lyx/text.cpp b/src/tex2lyx/text.cpp index cd7d0a9..e12e4ee 100644 --- a/src/tex2lyx/text.cpp +++ b/src/tex2lyx/text.cpp @@ -343,6 +343,10 @@ bool minted_float_has_caption = false; // The caption for non-floating minted listings string minted_nonfloat_caption = ""; +// Characters that have to be escaped by \\ in LaTeX +char const * const known_escaped_chars[] = { + "&", "_", "$", "%", "#", "^", "{", "}"}; + /// splits "x=z, y=b" into a map and an ordered keyword vector void split_map(string const & s, map & res, vector & keys) @@ -521,9 +525,6 @@ bool skip_braces(Parser & p) pair convert_unicodesymbols(docstring s) { bool res = true; - int const nchars_escape = 8; - static char_type const chars_escape[nchars_escape] = { - '&', '_', '$', '%', '#', '^', '{', '}'}; odocstringstream os; for (size_t i = 0; i < s.size();) { if (s[i] != '\\') { @@ -546,8 +547,8 @@ pair convert_unicodesymbols(docstring s) i = 0; else { res = false; - for (int k = 0; k < nchars_escape; k++) - if (prefixIs(s, from_ascii("\\") + chars_escape[k])) + for (auto const & c : known_escaped_chars) + if (prefixIs(s, from_ascii("\\") + c)) res = true; i = 1; } @@ -1719,10 +1720,10 @@ void parse_environment(Parser & p, ostream & os, bool outer, //things like comments are completely wrong. string const s = p.plainEnvironment("CJK"); for (string::const_iterator it = s.begin(), et = s.end(); it != et; ++it) { - if (*it == '\\') - output_ert_inset(os, "\\", parent_context); - else if (*it == '$') - output_ert_inset(os, "$", parent_context); + string snip; + snip += *it; + if (snip == "\\" || is_known(snip, known_escaped_chars)) + output_ert_inset(os, snip, parent_context); else if (*it == '\n' && it + 1 != et && s.begin() + 1 != it) os << "\n "; else
[LyX/2.3.2-staging] Amend 15fd17d83fb2
commit 91ce18388ef3d60573cc6fc155ae5904d0981759 Author: Juergen Spitzmueller Date: Sat Mar 10 14:22:51 2018 +0100 Amend 15fd17d83fb2 (cherry picked from commit b2ccdae22864ba72675b43d070022ae8fea18238) --- src/tex2lyx/Preamble.cpp |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp index 78293bf..8565d59 100644 --- a/src/tex2lyx/Preamble.cpp +++ b/src/tex2lyx/Preamble.cpp @@ -2051,7 +2051,7 @@ void Preamble::parse(Parser & p, string const & forceclass, } } - if (t.cs() == "includeonly") { + else if (t.cs() == "includeonly") { vector includeonlys = getVectorFromString(p.getArg('{', '}')); for (auto & iofile : includeonlys) { string filename(normalize_filename(iofile));
[LyX/master] Amend 15fd17d83fb2
commit b2ccdae22864ba72675b43d070022ae8fea18238 Author: Juergen Spitzmueller Date: Sat Mar 10 14:22:51 2018 +0100 Amend 15fd17d83fb2 --- src/tex2lyx/Preamble.cpp |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp index da09ec1..1617ced 100644 --- a/src/tex2lyx/Preamble.cpp +++ b/src/tex2lyx/Preamble.cpp @@ -2051,7 +2051,7 @@ void Preamble::parse(Parser & p, string const & forceclass, } } - if (t.cs() == "includeonly") { + else if (t.cs() == "includeonly") { vector includeonlys = getVectorFromString(p.getArg('{', '}')); for (auto & iofile : includeonlys) { string filename(normalize_filename(iofile));
[LyX/2.3.2-staging] tex2lyx: support for \includeonly
commit 0f33720d29e330cb5180cdf45e01ba822e89a994 Author: Juergen Spitzmueller Date: Fri Mar 9 17:27:55 2018 +0100 tex2lyx: support for \includeonly (cherry picked from commit 15fd17d83fb2b98d1ff226a79353e42f6e0247d4) --- src/tex2lyx/Preamble.cpp | 38 src/tex2lyx/Preamble.h |1 + src/tex2lyx/TODO.txt |2 - src/tex2lyx/tex2lyx.h|7 ++ src/tex2lyx/text.cpp | 212 +++--- status.23x |2 + 6 files changed, 154 insertions(+), 108 deletions(-) diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp index 48dc8d6..78293bf 100644 --- a/src/tex2lyx/Preamble.cpp +++ b/src/tex2lyx/Preamble.cpp @@ -173,6 +173,11 @@ const char * const known_basic_color_codes[] = {"#00", "#ff", "#964B00", const char * const known_if_3arg_commands[] = {"@ifundefined", "IfFileExists", 0}; +/*! + * Known file extensions for TeX files as used by \\includeonly + */ +char const * const known_tex_extensions[] = {"tex", 0}; + /// packages that work only in xetex /// polyglossia is handled separately const char * const known_xetex_packages[] = {"arabxetex", "fixlatvian", @@ -1252,6 +1257,12 @@ bool Preamble::writeLyXHeader(ostream & os, bool subdoc, string const & outfiled os << *it << '\n'; os << "\\end_modules\n"; } + if (!h_includeonlys.empty()) { + os << "\\begin_includeonly\n"; + for (auto const & iofile : h_includeonlys) + os << iofile << '\n'; + os << "\\end_includeonly\n"; + } os << "\\maintain_unincluded_children " << h_maintain_unincluded_children << "\n" << "\\language " << h_language << "\n" << "\\language_package " << h_language_package << "\n" @@ -2040,6 +2051,33 @@ void Preamble::parse(Parser & p, string const & forceclass, } } + if (t.cs() == "includeonly") { + vector includeonlys = getVectorFromString(p.getArg('{', '}')); + for (auto & iofile : includeonlys) { + string filename(normalize_filename(iofile)); + string const path = getMasterFilePath(true); + // We want to preserve relative/absolute filenames, + // therefore path is only used for testing + if (!makeAbsPath(filename, path).exists()) { + // The file extension is probably missing. + // Now try to find it out. + string const tex_name = + find_file(filename, path, + known_tex_extensions); + if (!tex_name.empty()) + filename = tex_name; + } + string outname; + if (makeAbsPath(filename, path).exists()) + fix_child_filename(filename); + else + cerr << "Warning: Could not find included file '" +<< filename << "'." << endl; + outname = changeExtension(filename, "lyx"); + h_includeonlys.push_back(outname); + } + } + else if (is_known(t.cs(), known_if_3arg_commands)) { // prevent misparsing of \usepackage if it is used // as an argument (see e.g. our own output of diff --git a/src/tex2lyx/Preamble.h b/src/tex2lyx/Preamble.h index 074a85c..9c70dca 100644 --- a/src/tex2lyx/Preamble.h +++ b/src/tex2lyx/Preamble.h @@ -223,6 +223,7 @@ private: std::map h_use_packages; std::string h_use_default_options; std::string h_use_hyperref; + std::vector h_includeonlys; bool h_use_refstyle; bool h_use_minted; diff --git a/src/tex2lyx/TODO.txt b/src/tex2lyx/TODO.txt index fc4bb99..8f83133 100644 --- a/src/tex2lyx/TODO.txt +++ b/src/tex2lyx/TODO.txt @@ -39,8 +39,6 @@ Format LaTeX featureLyX feature 363horizontal longtable alignment InsetTabular 364branch file name suffix \filename_suffix 371automatic mhchem loading \use_mhchem -375\includeonly \{begin,end}_includeonly -376update .aux of unincluded children \maintain_unincluded_children 377multirow.sty InsetTabular 378revision infoInsetInfo 380?InsetPreview diff --git a/src/te
[LyX/2.3.1-staging] Reset buffer language only if we have something to reset.
commit 73c41a3c418fcd7002ba47f96953f3e9b44f3ed3 Author: Juergen Spitzmueller Date: Fri Mar 9 12:15:19 2018 +0100 Reset buffer language only if we have something to reset. Fixes: #11063 (cherry picked from commit 599b1222f7da0222cd1802af69abefb81145f566) --- src/CutAndPaste.cpp |8 1 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/CutAndPaste.cpp b/src/CutAndPaste.cpp index a6aa029..553f68d 100644 --- a/src/CutAndPaste.cpp +++ b/src/CutAndPaste.cpp @@ -1225,13 +1225,13 @@ bool pasteClipboardText(Cursor & cur, ErrorList & errorList, bool asParagraphs, Buffer buffer("", false); buffer.setUnnamed(true); available = buffer.importString(names[i], text, errorList); - // TeX2lyx (also used in the HTML chain) assumes English as document language - // if no language is explicitly set (as is the case here). - // We thus reset the temp buffer's language to the context language - buffer.changeLanguage(buffer.language(), cur.getFont().language()); if (available) available = !buffer.paragraphs().empty(); if (available && !buffer.paragraphs()[0].empty()) { + // TeX2lyx (also used in the HTML chain) assumes English as document language + // if no language is explicitly set (as is the case here). + // We thus reset the temp buffer's language to the context language + buffer.changeLanguage(buffer.language(), cur.getFont().language()); cur.recordUndo(); pasteParagraphList(cur, buffer.paragraphs(), buffer.params().documentClassPtr(), errorList);
[LyX/2.2.x] syntax.default: add missing *
commit cd6a31c0d48b49efb623a39fca8c04ba70c1cc82 Author: Juergen Spitzmueller Date: Fri Mar 9 14:47:04 2018 +0100 syntax.default: add missing * Fixes: #10501 (cherry picked from commit 23766fdd592b95ecfc33cb66e08976654de33182) --- lib/syntax.default |2 +- status.22x |2 ++ 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/lib/syntax.default b/lib/syntax.default index 0ef1775..cc1a6c4 100644 --- a/lib/syntax.default +++ b/lib/syntax.default @@ -734,7 +734,7 @@ multline*{displaymath} math{} displaymath{displaymath} flalign{displaymath} -flalign{displaymath} +flalign*{displaymath} % These require extra args alignat{}{displaymath} alignat*{displaymath} diff --git a/status.22x b/status.22x index bfb1930..eac9891 100644 --- a/status.22x +++ b/status.22x @@ -182,6 +182,8 @@ What's new - Fix import of (specific) BibTeX paths (bug 7637). +- Fix import of flalign* environment (bug 10501). + * ADVANCED FIND AND REPLACE
[LyX/2.3.1-staging] syntax.default: add missing *
commit ebae08616b17f4e384dcd9cf8ab98afe2a3773f1 Author: Juergen Spitzmueller Date: Fri Mar 9 14:47:04 2018 +0100 syntax.default: add missing * Fixes: #10501 (cherry picked from commit 23766fdd592b95ecfc33cb66e08976654de33182) --- lib/syntax.default |2 +- status.23x |2 ++ 2 files changed, 3 insertions(+), 1 deletions(-) diff --git a/lib/syntax.default b/lib/syntax.default index d9596b6..cbdec85 100644 --- a/lib/syntax.default +++ b/lib/syntax.default @@ -740,7 +740,7 @@ multline*{displaymath} math{} displaymath{displaymath} flalign{displaymath} -flalign{displaymath} +flalign*{displaymath} % These require extra args alignat{}{displaymath} alignat*{displaymath} diff --git a/status.23x b/status.23x index 0feea93..eb02564 100644 --- a/status.23x +++ b/status.23x @@ -88,6 +88,8 @@ What's new - Handle whitespace in table column declaration (bug 10804). +- Fix import of flalign* environment (bug 10501). + * ADVANCED FIND AND REPLACE
[LyX/2.3.1-staging] tex2lyx: handle whitespace in table column declaration.
commit 20a63d2b5523d692bbf9fa17171465be8ede7cd6 Author: Juergen Spitzmueller Date: Fri Mar 9 14:18:03 2018 +0100 tex2lyx: handle whitespace in table column declaration. Fixes: #10804 (cherry picked from commit 247e1a223d917f81b5a2cc5ef3621c3e7fa9de92) --- src/tex2lyx/table.cpp |3 +++ status.23x|2 ++ 2 files changed, 5 insertions(+), 0 deletions(-) diff --git a/src/tex2lyx/table.cpp b/src/tex2lyx/table.cpp index 3cce03d..e8b6a4a 100644 --- a/src/tex2lyx/table.cpp +++ b/src/tex2lyx/table.cpp @@ -322,6 +322,9 @@ void handle_colalign(Parser & p, vector & colinfo, } switch (t.character()) { + case ' ': + // whitespace, ignore. + break; case 'c': case 'l': case 'r': diff --git a/status.23x b/status.23x index c659e78..0feea93 100644 --- a/status.23x +++ b/status.23x @@ -86,6 +86,8 @@ What's new - Do not force default bibliography style if none is set (bug 10673). +- Handle whitespace in table column declaration (bug 10804). + * ADVANCED FIND AND REPLACE
[LyX/2.3.2-staging] tex2lyx: chapterbib support
commit 42dd5f5cfadb65f20280a3ad04ffc72a05780b4a Author: Juergen Spitzmueller Date: Fri Mar 9 13:30:52 2018 +0100 tex2lyx: chapterbib support (cherry picked from commit af6933c06f603beca3d8684f56217243cbff1f94) --- src/tex2lyx/Preamble.cpp |3 +++ src/tex2lyx/TODO.txt | 11 --- status.23x |2 ++ 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/tex2lyx/Preamble.cpp b/src/tex2lyx/Preamble.cpp index f86576c..48dc8d6 100644 --- a/src/tex2lyx/Preamble.cpp +++ b/src/tex2lyx/Preamble.cpp @@ -1100,6 +1100,9 @@ void Preamble::handle_package(Parser &p, string const & name, else if (name == "bibtopic") h_use_bibtopic = "true"; + else if (name == "chapterbib") + h_multibib = "child"; + else if (name == "hyperref") handle_hyperref(options); diff --git a/src/tex2lyx/TODO.txt b/src/tex2lyx/TODO.txt index 63cd21e..fc4bb99 100644 --- a/src/tex2lyx/TODO.txt +++ b/src/tex2lyx/TODO.txt @@ -32,6 +32,9 @@ Format LaTeX featureLyX feature 332?InsetGraphics groupId 343?\use_default_options 358custom bibtex command\bibtex_command + Maybe via the + % !BIB program = + comment understood by some TeX editors 358custom makeindex command \index_command 363horizontal longtable alignment InsetTabular 364branch file name suffix \filename_suffix @@ -55,8 +58,6 @@ Format LaTeX featureLyX feature 443unicode-math.sty InsetMath* 445URW Classico LaTeX font \font_sans uop \renewcommand{\sffamily}{uop} -446Optional and required arguments InsetArgument - now numbered by order 448 451beamer overlay arguments InsetArgument \command, \begin{env} @@ -69,7 +70,6 @@ Format LaTeX featureLyX feature \end{overprint} 455beamer frametitle command\begin_layout FrameTitle \frametitle[short]{long} -456memoir: \epigraph{text}{source} layout Epigraph, InsetArgument 457automatic stackrel loading \use_package stackrel 459beamer: \begin{frame}, \begin_layout Frame \begin{frame}[plain],\begin_layout PlainFrame @@ -99,14 +99,11 @@ Format LaTeX featureLyX feature 523CJK Quote Styles InsetQuote - cjk (corner brackets) \begin_inset Quotes j.. - cjkangle (angle brackets) \begin_inset Quotes k.. -526 - Plural and capitalized refstyles InsetRef +526 Plural and capitalized refstyles InsetRef 533 Multibib support \begin{btUnit}...\end{btUnit}\multibib {none|part|chapter|section|subsection} (if a part, chapter, section etc. follows the \begin...) -534 Chapterbib support - \usepackage{chapterbib} \multibib child diff --git a/status.23x b/status.23x index b13eaf5..d77a58e 100644 --- a/status.23x +++ b/status.23x @@ -23,6 +23,8 @@ What's new - Add support for biblatex. +- Add support for chapterbib. + * USER INTERFACE