我排版我的日记只是为了好玩。我使用scrartcl
有两列的 KOMA 脚本。我正在使用 LuaLaTeX 和 XeLaTeX 进行测试。我没有注意到两种渲染之间的页数不同,XeLaTeX 渲染的页面更多,116 页 vs 114 页 A5 页面。我注意到两个引擎的连字符方式有所不同。以下是我的图表列表中的一个例子:
如您所见,XeLaTeX 决定将单词“démoni”连字符化,但结果在第三行出现了一个大漏洞。上图是一个极端的例子,但总体而言,LuaLaTeX 结果似乎比 XeLaTeX 结果包含的此类漏洞更少。
另一方面,在其他地方(实际上在同一页面上),LuaLaTeX 对 4 行段落的前三行连续行进行了连字符处理,这似乎也不理想,而 XeLaTeX 选择仅对前两行连续行进行连字符处理。
- 如此巨大的差异是预料之中的吗?有人能描述一下这些差异吗?或者给我链接一下这些差异的描述吗?
- 有没有办法让两个引擎的结果更加接近呢?
不是 MWE,只是我文档的序言。它是 Pandoc 生成的用于转换为 LaTeX 的修改版本:
\documentclass[czech,twoside]{scrartcl}
\usepackage{lmodern}
\usepackage{amssymb,amsmath}
\usepackage{ifxetex,ifluatex}
\usepackage{fixltx2e} % provides \textsubscript
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\else % if luatex or xelatex
\ifxetex
\usepackage{mathspec}
\else
\usepackage{fontspec}
\fi
\defaultfontfeatures{Ligatures=TeX,Scale=MatchLowercase}
\fi
% use upquote if available, for straight quotes in verbatim environments
\IfFileExists{upquote.sty}{\usepackage{upquote}}{}
% use microtype if available
\IfFileExists{microtype.sty}{%
\usepackage{microtype}
\UseMicrotypeSet[protrusion]{basicmath} % disable protrusion for tt fonts
}{}
\usepackage[vmargin=1in,headheight=13pt,twoside,twocolumn,a5paper]{geometry}
\usepackage{bookmark}
\hypersetup{unicode=true,
pdfborder={0 0 0},
breaklinks=true}
\urlstyle{same} % don't use monospace font for urls
\ifnum 0\ifxetex 1\fi\ifluatex 1\fi=0 % if pdftex
\usepackage[shorthands=off,main=czech]{babel}
\else
\usepackage{polyglossia}
\setmainlanguage[]{czech}
\fi
\usepackage{listings}
\usepackage{graphicx,grffile}
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>\linewidth\linewidth\else\Gin@nat@width\fi}
\def\maxheight{\ifdim\Gin@nat@height>\textheight\textheight\else\Gin@nat@height\fi}
\makeatother
% Scale images if necessary, so that they will not overflow the page
% margins by default, and it is still possible to overwrite the defaults
% using explicit options in \includegraphics[width, height, ...]{}
\setkeys{Gin}{width=\maxwidth,height=\maxheight,keepaspectratio}
\setlength{\emergencystretch}{3em} % prevent overfull lines
\providecommand{\tightlist}{%
\setlength{\itemsep}{0pt}\setlength{\parskip}{0pt}}
\setcounter{secnumdepth}{0}
% Redefines (sub)paragraphs to behave more like sections
\ifx\paragraph\undefined\else
\let\oldparagraph\paragraph
\renewcommand{\paragraph}[1]{\oldparagraph{#1}\mbox{}}
\fi
\ifx\subparagraph\undefined\else
\let\oldsubparagraph\subparagraph
\renewcommand{\subparagraph}[1]{\oldsubparagraph{#1}\mbox{}}
\fi
\usepackage[usenames,dvipsnames,svgnames,table]{xcolor}
\usepackage[perpage,titleref,savepos,counter,user]{zref}
\usepackage{amssymb}
\usepackage{newunicodechar}
\usepackage{accsupp}
\usepackage{MnSymbol}
\usepackage{textcomp}
\usepackage{etoolbox}
\usepackage{csquotes}
\DeclareQuoteAlias{german}{czech}
\usepackage{float}
\usepackage{dblfloatfix}
\usepackage[font={slshape},leftmargin=0.5\leftmargin,rightmargin=0.5\rightmargin]{quoting}
\usepackage[plain,headings]{nccfancyhdr}
\setmainfont{Charis SIL}
\setsansfont{TeX Gyre Heros}
\setmonofont{Droid Sans Mono}
\newfontfamily\myurlfont[Numbers=OldStyle,Ligatures={TeX,Common}]{Roboto Condensed}
\renewcommand\UrlFont{\myurlfont}
\tolerance 5000
\pagestyle{fancy}
\fancyhf{}
\fancyhead[lo]{\rightmark}
\fancyfoot[ro]{\leftmark}
\fancyhead[le]{\rightmark}
\fancyfoot[re]{\leftmark}
\fancyfoot[ce,co]{\thepage}
\renewcommand{\headrulewidth}{1pt} %0pt for no rule, 2pt thicker etc...
\renewcommand{\footrulewidth}{1pt}
\makeatletter
\zref@newprop{sectiontitle}{}
\zref@addprop{main}{sectiontitle}
\newcommand*{\currentsectiontitle}{\zref@getcurrent{sectiontitle}}
\newcommand*{\mysectionmark}[1]{%
\zref@setcurrent{sectiontitle}{#1}%
\markboth{\uppercase{#1}}{\uppercase{#1}}}
\makeatother
\renewcommand{\sectionmark}[1]{}
\renewcommand{\subsectionmark}[1]{}
\AtBeginEnvironment{quote}{\slshape}
\makeatletter
\def\maxwidth{\ifdim\Gin@nat@width>0.90\linewidth0.90\linewidth\else\Gin@nat@width\fi}
\def\maxheight{\ifdim\Gin@nat@height>0.85\textheight0.85\textheight\else\Gin@nat@height\fi}
\makeatother
% This makes sure that linked text's links shows as a footnote.
\makeatletter
\let\oldhref=\href
\newcommand\hreffootnote[2]{\oldhref{#1}{#2}\footnote{\url{#1}}}
%\DeclareRobustCommand{\hreffootnote}{\hyper@normalise\hreffootnote@}
\makeatother
\PassOptionsToPackage{backref}{hyperref}
\newcommand{\noncopy}[1]{%
\BeginAccSupp{method=escape,ActualText={}}%
#1%
\EndAccSupp{}%
}
\lstset{breaklines=true,
xleftmargin=1.5em,framexleftmargin=1em,
basicstyle=\ttfamily,
upquote=true,
literate={`}{{\BeginAccSupp{method=plain,ActualText=`}‵\EndAccSupp{}}}1
{"}{{\BeginAccSupp{method=plain,ActualText="}"\EndAccSupp{}}}1
{'}{{\BeginAccSupp{method=plain,ActualText='}'\EndAccSupp{}}}1,
showstringspaces=false,
numbers=left, numberstyle=\scriptsize\noncopy,
postbreak=\raisebox{0ex}[0ex][0ex]{\noncopy{\ensuremath{\color{red}\hookrightarrow}}},
prebreak=\raisebox{0ex}[0ex][0ex]{\noncopy{\ensuremath{\color{red}\rhookswarrow}}}}
% This allows line breaks in URL in more places.
\def\UrlBreaks{\do\/\do-\do.\do=\do_\do?\do\&\do\%\do\a\do\b\do\c\do\d\do\e\do\f\do\g\do\h\do\i\do\j\do\k\do\l\do\m\do\n\do\o\do\p\do\q\do\r\do\s\do\t\do\u\do\v\do\w\do\x\do\y\do\z\do\A\do\B\do\C\do\D\do\E\do\F\do\G\do\H\do\I\do\J\do\K\do\L\do\M\do\N\do\O\do\P\do\Q\do\R\do\S\do\T\do\U\do\V\do\W\do\X\do\Y\do\Z\do\0\do\1\do\2\do\3\do\4\do\5\do\6\do\7\do\8\do\9}
\title{Deníček}
\author{Václav Haisman}
\date{}