当前位置: 首页 > 工具软件 > LuaTeX > 使用案例 >

LuaTeX-ja与中文排版笔记

巢承安
2023-12-01
\documentclass{article}
\usepackage{luatexja-fontspec}
\setmainjfont{FandolSong}


\begin{document}
    测试

    在 Lua\TeX{} 中正常地使用中文。获得自动的\textbf{字体选择},标点“压缩”,以及正确的断行处理等特性。

\end{document}
\documentclass{article}
\usepackage{fontspec}
\setmainfont{MS PGothic}
\begin{document}
我希望這是,翻譯是由谷歌提供的中國文字。
\end{document}

speed up

http://www.howtotex.com/tips-tricks/faster-latex-part-iv-use-a-precompiled-preamble/

mydoc-noformat.tex

%% preamble: static and dynamic part
% static part of the preamble (stuff that does not change every now and then)
\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{geometry}
\usepackage[protrusion=true,expansion=true]{microtype}
\usepackage{amsmath,amsfonts,amsthm}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{subfig}
\usepackage{hyperref}
\usepackage{booktabs}
\usepackage{enumitem}
\usepackage{xspace}
\usepackage{siunitx}
\usepackage{cleveref}
\usepackage{url}
\usepackage{natbib}
\usepackage{tikz,pgfplots}

% the \endofdump part 'saves' everything above into one precompiled preamble, which gets loaded every time the LaTeX document is processed. This saves a lot of time mostly. 
% NOTE: uncomment the following line if you want to create the precompiled preamble format file!
%\endofdump

% dynamic part of the preamble (stuff that might change)
% \includeonly{} would be an example of a dynamic part in your preamble
% if you're using the minitoc package, also put it in the dynamic part as this package does not comply with mylatexformat
\usepackage{minitoc}

\begin{document}
	\frame{
		This is the file without precompiled preamble
	} 
\end{document}

mydoc-format.tex

支持英文

%&mydoc

% dynamic part of the preamble (stuff that might change)
% \includeonly{} would be an example of a dynamic part in your preamble
% if you're using the minitoc package, also put it in the dynamic part as this package does not comply with mylatexformat
\usepackage{minitoc}

\begin{document}
	\frame{
		This is the file with precompiled preamble
	} 
\end{document}

pdftex -ini -jobname=”mydoc” “&pdflatex” mylatexformat.ltx mydoc-noformat.tex

pdflatex mydoc-format.tex

 类似资料: