mirror of
https://git.lyx.org/repos/lyx.git
synced 2025-01-03 08:28:25 +00:00
Small formatting and comments update.
This commit is contained in:
parent
9a1a806b60
commit
406b1e7fcf
@ -315,67 +315,67 @@ static docstring const ogonek_def = from_ascii(
|
|||||||
|
|
||||||
static docstring const lyxaccent_def = from_ascii(
|
static docstring const lyxaccent_def = from_ascii(
|
||||||
"%% custom text accent \\LyxTextAccent[<rise value (length)>]{<accent>}{<base>}\n"
|
"%% custom text accent \\LyxTextAccent[<rise value (length)>]{<accent>}{<base>}\n"
|
||||||
"\\newcommand*{\\LyxTextAccent}[3][0ex]{%\n"
|
"\\newcommand*{\\LyxTextAccent}[3][0ex]{%\n"
|
||||||
" \\hmode@bgroup\\ooalign{\\null#3\\crcr\\hidewidth\n"
|
" \\hmode@bgroup\\ooalign{\\null#3\\crcr\\hidewidth\n"
|
||||||
" \\raise#1\\hbox{#2}\\hidewidth}\\egroup}\n"
|
" \\raise#1\\hbox{#2}\\hidewidth}\\egroup}\n"
|
||||||
"%% select a font size smaller than the current font size:\n"
|
"%% select a font size smaller than the current font size:\n"
|
||||||
"\\newcommand{\\LyxAccentSize}[1][\\sf@size]{%\n"
|
"\\newcommand{\\LyxAccentSize}[1][\\sf@size]{%\n"
|
||||||
" \\check@mathfonts\\fontsize#1\\z@\\math@fontsfalse\\selectfont\n"
|
" \\check@mathfonts\\fontsize#1\\z@\\math@fontsfalse\\selectfont\n"
|
||||||
"}\n");
|
"}\n");
|
||||||
|
|
||||||
static docstring const textcommabelow_def = from_ascii(
|
static docstring const textcommabelow_def = from_ascii(
|
||||||
"\\ProvideTextCommandDefault{\\textcommabelow}[1]{%%\n"
|
"\\ProvideTextCommandDefault{\\textcommabelow}[1]{%%\n"
|
||||||
" \\LyxTextAccent[-.31ex]{\\LyxAccentSize,}{#1}}\n");
|
" \\LyxTextAccent[-.31ex]{\\LyxAccentSize,}{#1}}\n");
|
||||||
|
|
||||||
static docstring const textcommaabove_def = from_ascii(
|
static docstring const textcommaabove_def = from_ascii(
|
||||||
"\\ProvideTextCommandDefault{\\textcommaabove}[1]{%%\n"
|
"\\ProvideTextCommandDefault{\\textcommaabove}[1]{%%\n"
|
||||||
" \\LyxTextAccent[.5ex]{\\LyxAccentSize`}{#1}}\n");
|
" \\LyxTextAccent[.5ex]{\\LyxAccentSize`}{#1}}\n");
|
||||||
|
|
||||||
static docstring const textcommaaboveright_def = from_ascii(
|
static docstring const textcommaaboveright_def = from_ascii(
|
||||||
"\\ProvideTextCommandDefault{\\textcommaaboveright}[1]{%%\n"
|
"\\ProvideTextCommandDefault{\\textcommaaboveright}[1]{%%\n"
|
||||||
" \\LyxTextAccent[.5ex]{\\LyxAccentSize\\ '}{#1}}\n");
|
" \\LyxTextAccent[.5ex]{\\LyxAccentSize\\ '}{#1}}\n");
|
||||||
|
|
||||||
// Baltic languages use a comma-accent instead of a cedilla
|
// Baltic languages use a comma-accent instead of a cedilla
|
||||||
static docstring const textbaltic_def = from_ascii(
|
static docstring const textbaltic_def = from_ascii(
|
||||||
"%% use comma accent instead of cedilla for these characters:\n"
|
"%% use comma accent instead of cedilla for these characters:\n"
|
||||||
"\\DeclareTextCompositeCommand{\\c}{T1}{g}{\\textcommaabove{g}}\n"
|
"\\DeclareTextCompositeCommand{\\c}{T1}{g}{\\textcommaabove{g}}\n"
|
||||||
"\\DeclareTextCompositeCommand{\\c}{T1}{G}{\\textcommabelow{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}{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}{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}{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"
|
||||||
"\\DeclareTextCompositeCommand{\\c}{T1}{R}{\\textcommabelow{R}}\n");
|
"\\DeclareTextCompositeCommand{\\c}{T1}{R}{\\textcommabelow{R}}\n");
|
||||||
|
|
||||||
// split-level fractions
|
// split-level fractions
|
||||||
static docstring const xfrac_def = from_ascii(
|
static docstring const xfrac_def = from_ascii(
|
||||||
"\\usepackage{xfrac}\n");
|
"\\usepackage{xfrac}\n");
|
||||||
static docstring const smallLetterFrac_def = from_ascii(
|
static docstring const smallLetterFrac_def = from_ascii(
|
||||||
"\\DeclareCollectionInstance{smallLetterFrac}{xfrac}{default}{text}\n"
|
"\\DeclareCollectionInstance{smallLetterFrac}{xfrac}{default}{text}\n"
|
||||||
" {phantom=c, scale-factor=1.0, slash-left-kern=-.05em}\n"
|
" {phantom=c, scale-factor=1.0, slash-left-kern=-.05em}\n"
|
||||||
"\\DeclareCollectionInstance{smallLetterFrac}{xfrac}{lmr}{text}\n"
|
"\\DeclareCollectionInstance{smallLetterFrac}{xfrac}{lmr}{text}\n"
|
||||||
" {slash-symbol-font=ptm, phantom=c, scale-factor=1, slash-left-kern=-.05em}\n"
|
" {slash-symbol-font=ptm, phantom=c, scale-factor=1, slash-left-kern=-.05em}\n"
|
||||||
"\\DeclareCollectionInstance{smallLetterFrac}{xfrac}{lmss}{text}\n"
|
"\\DeclareCollectionInstance{smallLetterFrac}{xfrac}{lmss}{text}\n"
|
||||||
" {slash-symbol-font=ptm, phantom=c, scale-factor=1, slash-left-kern=-.05em}\n"
|
" {slash-symbol-font=ptm, phantom=c, scale-factor=1, slash-left-kern=-.05em}\n"
|
||||||
"\\DeclareCollectionInstance{smallLetterFrac}{xfrac}{cmr}{text}\n"
|
"\\DeclareCollectionInstance{smallLetterFrac}{xfrac}{cmr}{text}\n"
|
||||||
" {slash-symbol-font=ptm, phantom=c, scale-factor=1, slash-left-kern=-.05em}\n"
|
" {slash-symbol-font=ptm, phantom=c, scale-factor=1, slash-left-kern=-.05em}\n"
|
||||||
"\\DeclareCollectionInstance{smallLetterFrac}{xfrac}{cmss}{text}\n"
|
"\\DeclareCollectionInstance{smallLetterFrac}{xfrac}{cmss}{text}\n"
|
||||||
" {slash-symbol-font=ptm, phantom=c, scale-factor=1, slash-left-kern=-.05em}\n"
|
" {slash-symbol-font=ptm, phantom=c, scale-factor=1, slash-left-kern=-.05em}\n"
|
||||||
"\\newcommand{\\smallLetterFrac}[2]{%\n"
|
"\\newcommand{\\smallLetterFrac}[2]{%\n"
|
||||||
" {\\UseCollection{xfrac}{smallLetterFrac}\\sfrac{#1}{#2}}}\n");
|
" {\\UseCollection{xfrac}{smallLetterFrac}\\sfrac{#1}{#2}}}\n");
|
||||||
|
|
||||||
static docstring const lyxref_def = from_ascii(
|
static docstring const lyxref_def = from_ascii(
|
||||||
"\\RS@ifundefined{subsecref}\n"
|
"\\RS@ifundefined{subsecref}\n"
|
||||||
" {\\newref{subsec}{name = \\RSsectxt}}\n"
|
" {\\newref{subsec}{name = \\RSsectxt}}\n"
|
||||||
" {}\n"
|
" {}\n"
|
||||||
"\\RS@ifundefined{thmref}\n"
|
"\\RS@ifundefined{thmref}\n"
|
||||||
" {\\def\\RSthmtxt{theorem~}\\newref{thm}{name = \\RSthmtxt}}\n"
|
" {\\def\\RSthmtxt{theorem~}\\newref{thm}{name = \\RSthmtxt}}\n"
|
||||||
" {}\n"
|
" {}\n"
|
||||||
"\\RS@ifundefined{lemref}\n"
|
"\\RS@ifundefined{lemref}\n"
|
||||||
" {\\def\\RSlemtxt{lemma~}\\newref{lem}{name = \\RSlemtxt}}\n"
|
" {\\def\\RSlemtxt{lemma~}\\newref{lem}{name = \\RSlemtxt}}\n"
|
||||||
" {}\n");
|
" {}\n");
|
||||||
|
|
||||||
// Make sure the columns are also outputed as rtl
|
// Make sure the columns are also outputed as rtl
|
||||||
static docstring const rtloutputdblcol_def = from_ascii(
|
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,
|
LaTeXFeatures::LaTeXFeatures(Buffer const & b, BufferParams const & p,
|
||||||
OutputParams const & r)
|
OutputParams const & r)
|
||||||
: buffer_(&b), params_(p), runparams_(r), in_float_(false),
|
: buffer_(&b), params_(p), runparams_(r), in_float_(false),
|
||||||
in_deleted_inset_(false)
|
in_deleted_inset_(false)
|
||||||
{}
|
{}
|
||||||
|
@ -1250,7 +1250,7 @@ void Paragraph::Private::latexSpecialChar(otexstream & os,
|
|||||||
&& !runparams.isFullUnicode() && bparams.main_font_encoding() == "T1"
|
&& !runparams.isFullUnicode() && bparams.main_font_encoding() == "T1"
|
||||||
&& latexSpecialT1(c, os, i, column))
|
&& latexSpecialT1(c, os, i, column))
|
||||||
return;
|
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()
|
else if (!runparams.inIPA && !running_font.language()->internalFontEncoding()
|
||||||
&& runparams.isFullUnicode() && latexSpecialTU(c, os, i, column))
|
&& runparams.isFullUnicode() && latexSpecialTU(c, os, i, column))
|
||||||
return;
|
return;
|
||||||
|
@ -2071,7 +2071,7 @@ void GuiDocument::updateQuoteStyles(bool const set)
|
|||||||
|
|
||||||
void GuiDocument::languageChanged(int i)
|
void GuiDocument::languageChanged(int i)
|
||||||
{
|
{
|
||||||
// some languages only work with polyglossia
|
// some languages only work with Polyglossia
|
||||||
Language const * lang = lyx::languages.getLanguage(
|
Language const * lang = lyx::languages.getLanguage(
|
||||||
fromqstr(langModule->languageCO->itemData(i).toString()));
|
fromqstr(langModule->languageCO->itemData(i).toString()));
|
||||||
if (lang->babel().empty() && !lang->polyglossia().empty()) {
|
if (lang->babel().empty() && !lang->polyglossia().empty()) {
|
||||||
@ -3853,9 +3853,8 @@ void GuiDocument::paramsToDialog()
|
|||||||
if (nn >= 0)
|
if (nn >= 0)
|
||||||
listingsModule->packageCO->setCurrentIndex(nn);
|
listingsModule->packageCO->setCurrentIndex(nn);
|
||||||
|
|
||||||
|
|
||||||
// Fonts
|
// 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(
|
Language const * lang = lyx::languages.getLanguage(
|
||||||
fromqstr(langModule->languageCO->itemData(
|
fromqstr(langModule->languageCO->itemData(
|
||||||
langModule->languageCO->currentIndex()).toString()));
|
langModule->languageCO->currentIndex()).toString()));
|
||||||
|
@ -109,7 +109,7 @@ namespace {
|
|||||||
/// Note that \p format may be unknown (i. e. an empty string)
|
/// Note that \p format may be unknown (i. e. an empty string)
|
||||||
string findTargetFormat(string const & format, OutputParams const & runparams)
|
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
|
if (runparams.flavor == OutputParams::PDFLATEX
|
||||||
|| runparams.flavor == OutputParams::XETEX
|
|| runparams.flavor == OutputParams::XETEX
|
||||||
|| runparams.flavor == OutputParams::LUATEX) {
|
|| runparams.flavor == OutputParams::LUATEX) {
|
||||||
|
@ -123,8 +123,7 @@ Encoding const * InsetListings::forcedEncoding(Encoding const * inner_enc,
|
|||||||
Encoding const * outer_enc) const
|
Encoding const * outer_enc) const
|
||||||
{
|
{
|
||||||
// The listings package cannot deal with multi-byte-encoded
|
// The listings package cannot deal with multi-byte-encoded
|
||||||
// glyphs, except if full-unicode aware backends
|
// glyphs, except for Xe/LuaTeX (with non-TeX fonts) or pLaTeX.
|
||||||
// such as XeTeX or LuaTeX are used, and with pLaTeX.
|
|
||||||
// Minted can deal with all encodings.
|
// Minted can deal with all encodings.
|
||||||
if (buffer().params().use_minted
|
if (buffer().params().use_minted
|
||||||
|| inner_enc->name() == "utf8-plain"
|
|| 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
|
// We try if there's a singlebyte encoding for the outer
|
||||||
// language; if not, fall back to latin1.
|
// 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()) ?
|
return (outer_enc->hasFixedWidth()) ?
|
||||||
outer_enc : encodings.fromLyXName("iso8859-1");
|
outer_enc : encodings.fromLyXName("iso8859-1");
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user