From: Günter Milde Date: Sat, 16 Mar 2019 11:59:34 +0000 (+0100) Subject: Small formatting and comments update. X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=5db3574d3b6fdafeedc47c64e8390290e85fc798;p=features.git Small formatting and comments update. --- diff --git a/src/LaTeXFeatures.cpp b/src/LaTeXFeatures.cpp index e2f32b5583..d889781289 100644 --- a/src/LaTeXFeatures.cpp +++ b/src/LaTeXFeatures.cpp @@ -315,67 +315,67 @@ static docstring const ogonek_def = from_ascii( static docstring const lyxaccent_def = from_ascii( "%% custom text accent \\LyxTextAccent[]{}{}\n" - "\\newcommand*{\\LyxTextAccent}[3][0ex]{%\n" - " \\hmode@bgroup\\ooalign{\\null#3\\crcr\\hidewidth\n" - " \\raise#1\\hbox{#2}\\hidewidth}\\egroup}\n" - "%% select a font size smaller than the current font size:\n" - "\\newcommand{\\LyxAccentSize}[1][\\sf@size]{%\n" - " \\check@mathfonts\\fontsize#1\\z@\\math@fontsfalse\\selectfont\n" - "}\n"); + "\\newcommand*{\\LyxTextAccent}[3][0ex]{%\n" + " \\hmode@bgroup\\ooalign{\\null#3\\crcr\\hidewidth\n" + " \\raise#1\\hbox{#2}\\hidewidth}\\egroup}\n" + "%% select a font size smaller than the current font size:\n" + "\\newcommand{\\LyxAccentSize}[1][\\sf@size]{%\n" + " \\check@mathfonts\\fontsize#1\\z@\\math@fontsfalse\\selectfont\n" + "}\n"); static docstring const textcommabelow_def = from_ascii( - "\\ProvideTextCommandDefault{\\textcommabelow}[1]{%%\n" - " \\LyxTextAccent[-.31ex]{\\LyxAccentSize,}{#1}}\n"); + "\\ProvideTextCommandDefault{\\textcommabelow}[1]{%%\n" + " \\LyxTextAccent[-.31ex]{\\LyxAccentSize,}{#1}}\n"); static docstring const textcommaabove_def = from_ascii( - "\\ProvideTextCommandDefault{\\textcommaabove}[1]{%%\n" - " \\LyxTextAccent[.5ex]{\\LyxAccentSize`}{#1}}\n"); + "\\ProvideTextCommandDefault{\\textcommaabove}[1]{%%\n" + " \\LyxTextAccent[.5ex]{\\LyxAccentSize`}{#1}}\n"); static docstring const textcommaaboveright_def = from_ascii( - "\\ProvideTextCommandDefault{\\textcommaaboveright}[1]{%%\n" - " \\LyxTextAccent[.5ex]{\\LyxAccentSize\\ '}{#1}}\n"); + "\\ProvideTextCommandDefault{\\textcommaaboveright}[1]{%%\n" + " \\LyxTextAccent[.5ex]{\\LyxAccentSize\\ '}{#1}}\n"); // Baltic languages use a comma-accent instead of a cedilla static docstring const textbaltic_def = from_ascii( - "%% use comma accent instead of cedilla for these characters:\n" - "\\DeclareTextCompositeCommand{\\c}{T1}{g}{\\textcommaabove{g}}\n" - "\\DeclareTextCompositeCommand{\\c}{T1}{G}{\\textcommabelow{G}}\n" - "\\DeclareTextCompositeCommand{\\c}{T1}{k}{\\textcommabelow{k}}\n" - "\\DeclareTextCompositeCommand{\\c}{T1}{K}{\\textcommabelow{K}}\n" - "\\DeclareTextCompositeCommand{\\c}{T1}{l}{\\textcommabelow{l}}\n" - "\\DeclareTextCompositeCommand{\\c}{T1}{L}{\\textcommabelow{L}}\n" - "\\DeclareTextCompositeCommand{\\c}{T1}{n}{\\textcommabelow{n}}\n" - "\\DeclareTextCompositeCommand{\\c}{T1}{N}{\\textcommabelow{N}}\n" - "\\DeclareTextCompositeCommand{\\c}{T1}{r}{\\textcommabelow{r}}\n" - "\\DeclareTextCompositeCommand{\\c}{T1}{R}{\\textcommabelow{R}}\n"); + "%% use comma accent instead of cedilla for these characters:\n" + "\\DeclareTextCompositeCommand{\\c}{T1}{g}{\\textcommaabove{g}}\n" + "\\DeclareTextCompositeCommand{\\c}{T1}{G}{\\textcommabelow{G}}\n" + "\\DeclareTextCompositeCommand{\\c}{T1}{k}{\\textcommabelow{k}}\n" + "\\DeclareTextCompositeCommand{\\c}{T1}{K}{\\textcommabelow{K}}\n" + "\\DeclareTextCompositeCommand{\\c}{T1}{l}{\\textcommabelow{l}}\n" + "\\DeclareTextCompositeCommand{\\c}{T1}{L}{\\textcommabelow{L}}\n" + "\\DeclareTextCompositeCommand{\\c}{T1}{n}{\\textcommabelow{n}}\n" + "\\DeclareTextCompositeCommand{\\c}{T1}{N}{\\textcommabelow{N}}\n" + "\\DeclareTextCompositeCommand{\\c}{T1}{r}{\\textcommabelow{r}}\n" + "\\DeclareTextCompositeCommand{\\c}{T1}{R}{\\textcommabelow{R}}\n"); // split-level fractions static docstring const xfrac_def = from_ascii( "\\usepackage{xfrac}\n"); static docstring const smallLetterFrac_def = from_ascii( - "\\DeclareCollectionInstance{smallLetterFrac}{xfrac}{default}{text}\n" - " {phantom=c, scale-factor=1.0, slash-left-kern=-.05em}\n" - "\\DeclareCollectionInstance{smallLetterFrac}{xfrac}{lmr}{text}\n" - " {slash-symbol-font=ptm, phantom=c, scale-factor=1, slash-left-kern=-.05em}\n" - "\\DeclareCollectionInstance{smallLetterFrac}{xfrac}{lmss}{text}\n" - " {slash-symbol-font=ptm, phantom=c, scale-factor=1, slash-left-kern=-.05em}\n" - "\\DeclareCollectionInstance{smallLetterFrac}{xfrac}{cmr}{text}\n" - " {slash-symbol-font=ptm, phantom=c, scale-factor=1, slash-left-kern=-.05em}\n" - "\\DeclareCollectionInstance{smallLetterFrac}{xfrac}{cmss}{text}\n" - " {slash-symbol-font=ptm, phantom=c, scale-factor=1, slash-left-kern=-.05em}\n" - "\\newcommand{\\smallLetterFrac}[2]{%\n" - " {\\UseCollection{xfrac}{smallLetterFrac}\\sfrac{#1}{#2}}}\n"); + "\\DeclareCollectionInstance{smallLetterFrac}{xfrac}{default}{text}\n" + " {phantom=c, scale-factor=1.0, slash-left-kern=-.05em}\n" + "\\DeclareCollectionInstance{smallLetterFrac}{xfrac}{lmr}{text}\n" + " {slash-symbol-font=ptm, phantom=c, scale-factor=1, slash-left-kern=-.05em}\n" + "\\DeclareCollectionInstance{smallLetterFrac}{xfrac}{lmss}{text}\n" + " {slash-symbol-font=ptm, phantom=c, scale-factor=1, slash-left-kern=-.05em}\n" + "\\DeclareCollectionInstance{smallLetterFrac}{xfrac}{cmr}{text}\n" + " {slash-symbol-font=ptm, phantom=c, scale-factor=1, slash-left-kern=-.05em}\n" + "\\DeclareCollectionInstance{smallLetterFrac}{xfrac}{cmss}{text}\n" + " {slash-symbol-font=ptm, phantom=c, scale-factor=1, slash-left-kern=-.05em}\n" + "\\newcommand{\\smallLetterFrac}[2]{%\n" + " {\\UseCollection{xfrac}{smallLetterFrac}\\sfrac{#1}{#2}}}\n"); static docstring const lyxref_def = from_ascii( - "\\RS@ifundefined{subsecref}\n" - " {\\newref{subsec}{name = \\RSsectxt}}\n" - " {}\n" - "\\RS@ifundefined{thmref}\n" - " {\\def\\RSthmtxt{theorem~}\\newref{thm}{name = \\RSthmtxt}}\n" - " {}\n" - "\\RS@ifundefined{lemref}\n" - " {\\def\\RSlemtxt{lemma~}\\newref{lem}{name = \\RSlemtxt}}\n" - " {}\n"); + "\\RS@ifundefined{subsecref}\n" + " {\\newref{subsec}{name = \\RSsectxt}}\n" + " {}\n" + "\\RS@ifundefined{thmref}\n" + " {\\def\\RSthmtxt{theorem~}\\newref{thm}{name = \\RSthmtxt}}\n" + " {}\n" + "\\RS@ifundefined{lemref}\n" + " {\\def\\RSlemtxt{lemma~}\\newref{lem}{name = \\RSlemtxt}}\n" + " {}\n"); // Make sure the columns are also outputed as rtl static docstring const rtloutputdblcol_def = from_ascii( @@ -454,7 +454,7 @@ static docstring const lyxstrikeout_style = from_ascii( LaTeXFeatures::LaTeXFeatures(Buffer const & b, BufferParams const & p, - OutputParams const & r) + OutputParams const & r) : buffer_(&b), params_(p), runparams_(r), in_float_(false), in_deleted_inset_(false) {} diff --git a/src/Paragraph.cpp b/src/Paragraph.cpp index f1fc7bd886..58cda93195 100644 --- a/src/Paragraph.cpp +++ b/src/Paragraph.cpp @@ -1250,7 +1250,7 @@ void Paragraph::Private::latexSpecialChar(otexstream & os, && !runparams.isFullUnicode() && bparams.main_font_encoding() == "T1" && latexSpecialT1(c, os, i, column)) return; - // NOTE: XeTeX and LuaTeX use EU1/2 (pre 2017) or TU (as of 2017) encoding + // NOTE: "fontspec" (non-TeX fonts) sets the font encoding to "TU" (untill 2017 "EU1" or "EU2") else if (!runparams.inIPA && !running_font.language()->internalFontEncoding() && runparams.isFullUnicode() && latexSpecialTU(c, os, i, column)) return; diff --git a/src/frontends/qt4/GuiDocument.cpp b/src/frontends/qt4/GuiDocument.cpp index cea563da73..7e40a69e77 100644 --- a/src/frontends/qt4/GuiDocument.cpp +++ b/src/frontends/qt4/GuiDocument.cpp @@ -2071,7 +2071,7 @@ void GuiDocument::updateQuoteStyles(bool const set) void GuiDocument::languageChanged(int i) { - // some languages only work with polyglossia + // some languages only work with Polyglossia Language const * lang = lyx::languages.getLanguage( fromqstr(langModule->languageCO->itemData(i).toString())); if (lang->babel().empty() && !lang->polyglossia().empty()) { @@ -3853,9 +3853,8 @@ void GuiDocument::paramsToDialog() if (nn >= 0) listingsModule->packageCO->setCurrentIndex(nn); - // Fonts - // some languages only work with polyglossia/XeTeX + // some languages only work with Polyglossia (which requires non-TeX fonts) Language const * lang = lyx::languages.getLanguage( fromqstr(langModule->languageCO->itemData( langModule->languageCO->currentIndex()).toString())); diff --git a/src/insets/InsetGraphics.cpp b/src/insets/InsetGraphics.cpp index 8c39910675..c05075583b 100644 --- a/src/insets/InsetGraphics.cpp +++ b/src/insets/InsetGraphics.cpp @@ -109,7 +109,7 @@ namespace { /// Note that \p format may be unknown (i. e. an empty string) string findTargetFormat(string const & format, OutputParams const & runparams) { - // Are we using latex or XeTeX/LuaTeX/pdflatex? + // Are we latexing to DVI or PDF? if (runparams.flavor == OutputParams::PDFLATEX || runparams.flavor == OutputParams::XETEX || runparams.flavor == OutputParams::LUATEX) { diff --git a/src/insets/InsetListings.cpp b/src/insets/InsetListings.cpp index d7fd5cdbfd..b50e92623e 100644 --- a/src/insets/InsetListings.cpp +++ b/src/insets/InsetListings.cpp @@ -123,8 +123,7 @@ Encoding const * InsetListings::forcedEncoding(Encoding const * inner_enc, Encoding const * outer_enc) const { // The listings package cannot deal with multi-byte-encoded - // glyphs, except if full-unicode aware backends - // such as XeTeX or LuaTeX are used, and with pLaTeX. + // glyphs, except for Xe/LuaTeX (with non-TeX fonts) or pLaTeX. // Minted can deal with all encodings. if (buffer().params().use_minted || inner_enc->name() == "utf8-plain" @@ -135,6 +134,8 @@ Encoding const * InsetListings::forcedEncoding(Encoding const * inner_enc, // We try if there's a singlebyte encoding for the outer // language; if not, fall back to latin1. + // Power-users can set inputenc to utf8-plain to bypass this workaround + // and provide alternatives in the user-preamble. return (outer_enc->hasFixedWidth()) ? outer_enc : encodings.fromLyXName("iso8859-1"); }