mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Chinese localization in user preamble using "ctex" with non-TeX fonts
https://tex.stackexchange.com/questions/17611/how-does-one-type-chinese-in-latex TODO: use "ctex" if the document language is Chinese. Remove "\clearpage" workaround from documents (not required after fix for #5386 in [5ebc0b3f432f468/lyxgit]).
This commit is contained in:
parent
8060c8e488
commit
46f5acb19c
@ -121,9 +121,10 @@ export/templates/acmart_pdf
|
||||
# the name of the day in English instead of Japanese.
|
||||
export/examples/ja/multilingual_lyx.*
|
||||
|
||||
# No localization of auto-strings with Chinese language (LyXHTML is OK)
|
||||
# No localization of auto-strings with Chinese language under 8-bit TeX
|
||||
# (ctex font issue with texlive-lang-chinese (from Debian) under pdflatex):
|
||||
export/export/latex/CJK/zh_CN-toc.*
|
||||
export/doc/zh_CN/(Intro|Tutorial)_(dvi|pdf).*
|
||||
export/doc/zh_CN/(Intro|Tutorial)_(dvi|pdf).?
|
||||
|
||||
# Missing Chinese characters in the DVI (LuaTex)
|
||||
export/doc/zh_CN/(Intro|Tutorial)_dvi3_systemF
|
||||
|
@ -6,20 +6,11 @@
|
||||
\origin /systemlyxdir/doc/zh_CN/
|
||||
\textclass article
|
||||
\begin_preamble
|
||||
\usepackage{ifxetex}
|
||||
\ifxetex
|
||||
\usepackage{xeCJK}
|
||||
\fi
|
||||
|
||||
% proper line breaking, punctuation kerning and font switching
|
||||
% features with LuaTeX
|
||||
% see https://tex.stackexchange.com/questions/222980/how-to-use-chinese-with-lualatex
|
||||
\usepackage{ifluatex}
|
||||
\ifluatex
|
||||
\usepackage{luatexja-fontspec}
|
||||
\setmainjfont[Mapping=tex-text]{WenQuanYi Micro Hei}
|
||||
\setsansjfont[Mapping=tex-text]{WenQuanYi Micro Hei}
|
||||
\fi
|
||||
% Chinese localization
|
||||
\@ifpackageloaded{fontspec}%
|
||||
{\usepackage{ctex}}% ctex with non-TeX fonts
|
||||
{%\usepackage[UTF8]{ctex}% error with font setup (missing font?)
|
||||
}
|
||||
\end_preamble
|
||||
\use_default_options true
|
||||
\maintain_unincluded_children false
|
||||
@ -1500,26 +1491,5 @@ literal "false"
|
||||
无论你修改文档的想法是什么,只要它能够改善文档质量,我们都是乐于接受的。
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
\begin_inset Note Note
|
||||
status open
|
||||
|
||||
\begin_layout Plain Layout
|
||||
The following clearpage is required to avoid compilation errors at some
|
||||
installations for an unknown reason.
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
\begin_inset Newpage clearpage
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\end_body
|
||||
\end_document
|
||||
|
@ -6,27 +6,11 @@
|
||||
\origin /systemlyxdir/doc/zh_CN/
|
||||
\textclass book
|
||||
\begin_preamble
|
||||
%\usepackage{fontspec}
|
||||
%\setromanfont{AR PL ShanHeiSun Uni}%字体来自Adobe Reader 8.0 OpenType,可以选用任何系统已有的字体
|
||||
%中文断行
|
||||
%\XeTeXlinebreaklocale "zh"
|
||||
%\XeTeXlinebreakskip = 0pt plus 1pt
|
||||
\usepackage{ifxetex}
|
||||
\ifxetex
|
||||
\usepackage{xeCJK}
|
||||
%\setCJKmainfont{WenQuanYi Micro Hei}
|
||||
%\setCJKmonofont{WenQuanYi Micro Hei Mono}
|
||||
\fi
|
||||
|
||||
% proper line breaking, punctuation kerning and font switching
|
||||
% features with LuaTeX
|
||||
% see https://tex.stackexchange.com/questions/222980/how-to-use-chinese-with-lualatex
|
||||
\usepackage{ifluatex}
|
||||
\ifluatex
|
||||
\usepackage{luatexja-fontspec}
|
||||
\setmainjfont[Mapping=tex-text]{WenQuanYi Micro Hei}
|
||||
\setsansjfont[Mapping=tex-text]{WenQuanYi Micro Hei}
|
||||
\fi
|
||||
% Chinese localization
|
||||
\@ifpackageloaded{fontspec}%
|
||||
{\usepackage{ctex}}% ctex with non-TeX fonts
|
||||
{%\usepackage[UTF8]{ctex}% error with font setup (missing font?)
|
||||
}
|
||||
\end_preamble
|
||||
\options cjk
|
||||
\use_default_options true
|
||||
@ -2963,21 +2947,5 @@ Bib\SpecialChar TeX
|
||||
错误信息。
|
||||
\end_layout
|
||||
|
||||
\begin_layout Standard
|
||||
\begin_inset ERT
|
||||
status open
|
||||
|
||||
\begin_layout Plain Layout
|
||||
|
||||
|
||||
\backslash
|
||||
clearpage
|
||||
\end_layout
|
||||
|
||||
\end_inset
|
||||
|
||||
|
||||
\end_layout
|
||||
|
||||
\end_body
|
||||
\end_document
|
||||
|
Loading…
Reference in New Issue
Block a user