#LyX 2.4 created this file. For more info see https://www.lyx.org/
-\lyxformat 569
+\lyxformat 572
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass scrbook
\begin_preamble
-% DO NOT ALTER THIS PREAMBLE!!!
-%
-% This preamble is designed to ensure that the manual prints
-% out as advertised. If you mess with this preamble,
-% parts of the manual may not print out as expected. If you
-% have problems LaTeXing this file, please contact
-% the documentation team
-% email: lyx-docs@lists.lyx.org
-\IfFileExists{pxjahyper.sty}
-{\usepackage{pxjahyper}}
-
-% if pdflatex is used
-\usepackage{ifpdf}
-\ifpdf
-
- % set fonts for nicer pdf view
- \IfFileExists{lmodern.sty}
- {\usepackage{lmodern}}{}
-
-\fi % end if pdflatex is used
-
-% the pages of the TOC are numbered roman
-% and a PDF-bookmark for the TOC is added
-\pagenumbering{roman}
-\let\myTOC\tableofcontents
-\renewcommand{\tableofcontents}{%
- \pdfbookmark[1]{\contentsname}{}
- \myTOC
- \cleardoublepage
- \pagenumbering{arabic}}
-
-% extra space for tables
-\newcommand{\extratablespace}[1]{\noalign{\vskip#1}}
-
-\usepackage{t1enc}
\end_preamble
\options bibliography=totoc,index=totoc,BCOR7.5mm,titlepage,captions=tableheading
\use_default_options false
\language_package default
\inputencoding auto
\fontencoding auto
-\font_roman "default" "default"
-\font_sans "default" "default"
+\font_roman "lmodern" "IPAexGothic"
+\font_sans "default" "IPAexMincho"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\output_sync 0
\bibtex_command default
\index_command default
+\float_placement class
+\float_alignment class
\paperfontsize 12
\spacing single
\use_hyperref true
# 1. Exceptions to the following pattern (test cases with the right encoding):
!export/.*(utf8|ascii)_pdf4_texF
!export/examples/(|ar|ca|cs|da|de|el|es|eu|fa|fr|gl|he|hu|id|it|ja|ko|nb|nl|pl|pt|pt_BR|pt_PT|ro|ru|sk|sl|sr|sv|uk|zh_CN)/Welcome_pdf4_texF
+!export/examples/ja/Multilingual_Typesetting_.*CJK.*_pdf4_texF
# 2. Catchall patterns to ignore the other tests:
.*_pdf4_texF
export/(doc|examples|templates)/(|ar|ca|cs|da|de|el|es|eu|fa|fr|gl|he|hu|id|it|ja|ko|nb|nl|pl|pt|pt_BR|pt_PT|ro|ru|sk|sl|sr|sv|uk|zh_CN)/.*pdf4_texF
#
# Other Japanese documents use language "japanese" wich is tied to "platex"
# (automatically invoked instead of "latex" to create a DVI file).
-# Export by other engines works with language "japanese-cjk", e.g.
+# Export by plain- and pdflatex engines works with language "japanese-cjk", e.g.
!export/examples/ja/Multilingual_Typesetting_.*CJK.*
# For a discussion of alternatives for Japanese with LaTeX , see also
# http://www.preining.info/blog/2014/12/writing-japanese-in-latex-part-1-introduction/
#11532 inputencoding desynchronisation
export/export/latex/misplaced-inputenc-switch_pdf2
-# Error in Japanese document if LyX-logo is preceded by foreign language text
-export/export/latex/ja_wrong_auto_encoding_(dvi|pdf(|3)).*
# ==============================================================
\begin_layout Standard
Text in some other languages with correct language setting (not all languages
- supported by LyX are compatible with pLaTeX):
+ supported by LyX are compatible with pLaTeX, try
+\begin_inset Quotes eld
+\end_inset
+
+japanese (CJK)
+\begin_inset Quotes erd
+\end_inset
+
+):
\end_layout
\begin_layout Standard
\begin_layout Standard
-\emph on
-Missing and wrong characters with
-\emph default
-Language\SpecialChar menuseparator
-Encoding
-\begin_inset Quotes eld
-\end_inset
-
-language default
-\emph on
-
-\begin_inset Quotes erd
-\end_inset
-
-
-\emph default
-:
-\end_layout
-
-\begin_layout Standard
-
\lang swedish
Swedish: Hej då.
\end_layout
// list all input encodings used in the document
encoding_set = features.getEncodingSet(doc_encoding);
- // If the "japanese" package (i.e. pLaTeX) is used,
- // inputenc must be omitted.
- // see http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg129680.html
+ // The "japanese" babel-language requires the pLaTeX engine
+ // which conflicts with "inputenc".
+ // See http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg129680.html
if ((!encoding_set.empty() || package == Encoding::inputenc)
&& !features.isRequired("japanese")
&& !features.isProvided("inputenc")) {
// They use the CJK package
if (lang->encoding()->package() == Encoding::CJK)
require("CJK");
- // japanese package is special
+ // japanese babel language is special (tied to the pLaTeX engine).
if (lang->encoding()->package() == Encoding::japanese)
require("japanese");
}
set<string> encs;
for (auto const & lang : UsedLanguages_)
if (lang->encoding()->latexName() != doc_encoding &&
- (lang->encoding()->package() == Encoding::inputenc
- || lang->encoding()->package() == Encoding::japanese))
+ lang->encoding()->package() == Encoding::inputenc)
encs.insert(lang->encoding()->latexName());
return encs;
}
// Minted can deal with all encodings.
if (buffer().params().use_minted
|| inner_enc->name() == "utf8-plain"
- || (buffer().params().encoding().package() == Encoding::japanese
- && inner_enc->package() == Encoding::japanese)
+ || buffer().params().encoding().package() == Encoding::japanese
|| inner_enc->hasFixedWidth())
return 0;
// \inputencoding command; the encoding switch will occur when necessary
if (bparams.inputenc == "auto"
&& !runparams.isFullUnicode() // Xe/LuaTeX use one document-wide encoding (see also switchEncoding())
+ && runparams.encoding->package() != Encoding::japanese
&& runparams.encoding->package() != Encoding::none) {
// Look ahead for future encoding changes.
// We try to output them at the beginning of the paragraph,
}
}
-
+// Switch the input encoding for some part(s) of the document.
pair<bool, int> switchEncoding(odocstream & os, BufferParams const & bparams,
OutputParams const & runparams, Encoding const & newEnc,
bool force, bool noswitchmacro)
{
- // Never switch encoding with non-TeX fonts (always "utf8plain") or
- // with LuaTeX and TeX fonts (only one encoding accepted by luainputenc).
+ // Never switch encoding with non-TeX fonts (always "utf8plain"),
+ // with LuaTeX and TeX fonts (only one encoding accepted by luainputenc),
+ // or if we're in a moving argument or inherit the outer encoding.
if (bparams.useNonTeXFonts
|| runparams.flavor == OutputParams::LUATEX
|| runparams.flavor == OutputParams::DVILUATEX
|| newEnc.name() == "inherit")
return make_pair(false, 0);
- Encoding const & oldEnc = *runparams.encoding;
- bool moving_arg = runparams.moving_arg;
- if (!force
- && ((bparams.inputenc != "auto" && bparams.inputenc != "default") || moving_arg))
+ // Only switch for auto-selected legacy encodings (inputenc setting
+ // "auto" or "default").
+ // The "listings" environment can force a switch also with other
+ // encoding settings (it does not support variable width encodings
+ // (utf8, jis, ...) under 8-bit latex engines).
+ if (!force && ((bparams.inputenc != "auto" && bparams.inputenc != "default")
+ || runparams.moving_arg))
return make_pair(false, 0);
- // Do nothing if the encoding is unchanged.
- if (oldEnc.name() == newEnc.name())
+ Encoding const & oldEnc = *runparams.encoding;
+ // Do not switch, if the encoding is unchanged or switching is not supported.
+ if (oldEnc.name() == newEnc.name()
+ || oldEnc.package() == Encoding::japanese
+ || oldEnc.package() == Encoding::none
+ || newEnc.package() == Encoding::none)
return make_pair(false, 0);
-
// FIXME We ignore encoding switches from/to encodings that do
// neither support the inputenc package nor the CJK package here.
- // This does of course only work in special cases (e.g. switch from
- // tis620-0 to latin1, but the text in latin1 contains ASCII only),
- // but it is the best we can do
- //
- // 2019-01-08 Possibly no longer required since tis620-0 is supported
- // by inputenc (but check special encodings "utf8-plain" and "default").
- if (oldEnc.package() == Encoding::none || newEnc.package() == Encoding::none)
- return make_pair(false, 0);
+ // This may fail for characters not supported by "unicodesymbols"
+ // or for non-ASCII characters in "listings"
+ // but it is the best we can do.
// change encoding
LYXERR(Debug::LATEX, "Changing LaTeX encoding from "
switch (newEnc.package()) {
case Encoding::none:
case Encoding::japanese:
- // shouldn't ever reach here, see above
+ // shouldn't ever reach here (see above) but avoids warning.
return make_pair(true, 0);
case Encoding::inputenc: {
int count = inputenc_arg.length();
count += 7;
state->open_encoding_ = inputenc;
}
- // with the japanese option, inputenc is omitted.
- if (runparams.use_japanese || noswitchmacro)
+ if (noswitchmacro)
return make_pair(true, count);
os << "\\inputencoding{" << inputenc_arg << '}';
return make_pair(true, count + 16);