喂食
\documentclass[ngerman]{book}
\usepackage[paperwidth=168mm,paperheight=240mm,height=210mm,width=144mm,includeall=true,showframe,showcrop]{geometry}%%% have visual text and page borders
\usepackage[USenglish,main=ngerman]{babel}
\usepackage[ngerman,noabbrev]{cleveref}%%% no abbreviations in general, but there are a few exceptions, e.g. abbreviating German “Abbildung”
\overfullrule=1mm%%% put a thick vertical bar to take notice of overfulls
\newcommand{\crefpairconjunction}{ und }%%% allow for a line break after “und”
\newcommand{\creflastconjunction}{ und }%%% allow for a line break after “und”
\newcommand{\crefpairgroupconjunction}{ und }%%% allow for a line break after “und”
\newcommand{\creflastgroupconjunction}{ und }%%% allow for a line break after “und”
\newcommand{\crefrangeconjunction}{ bis }%%% allow for a line break after “bis”
\crefname{figure}{Abb.}{Abbn.}
\crefformat{figure}{Abb.\@\penalty9999\ #2#1#3}%%% allow for a line break after "Abb." under a high penalty
\crefrangeformat{figure}{Abbn.\@\penalty9999\ #3#1#4 bis #5#2#6}%%% "Abb.", "Abbn.", or "Abbildgn."; all are correct in German. Allow for a line break after the abbreviation under a high penalty.
\begin{document}
\chapter{Chap}
\begin{figure}Zeichnung\caption{Caption}\end{figure}%
\begin{figure}Zeichnung\caption{Caption}\end{figure}%
\begin{figure}Zeichnung\caption{Caption}\end{figure}%
\begin{figure}Zeichnung\caption{Caption}\end{figure}%
\begin{figure}Zeichnung\caption{Caption}\end{figure}%
\begin{figure}Zeichnung\caption{Caption}\end{figure}%
\part{Teil}
\section{Sect}
\begin{figure}%
Zeichnung%
\caption{Caption}%
\label{fig:OneSeven}%
\end{figure}
\begin{figure}%
Zeichnung%
\caption{Caption}%
\label{fig:OneEight}%
\end{figure}
\begin{figure}%
Zeichnung%
\caption{Caption}%
\label{fig:OneNine}%
\end{figure}
EinLangesWort EinLangesWort LangesWort Wort \cref{fig:OneNine,fig:OneTen,fig:OneSeven,fig:OneEleven}.
\begin{otherlanguage}{USenglish}%%% The starred version otherlanguage* instead of otherlanguage works fine, though.
Anything between one line and half a page of English text, which may cross a page border.
\end{otherlanguage}%
EinLangesWort EinLangesWort einWort \cref{fig:OneNine,fig:OneTen,fig:OneSeven,fig:OneEleven}.
\begin{figure}%
Zeichnung%
\caption{Caption}%
\label{fig:OneTen}%
\end{figure}
\begin{figure}%
Zeichnung%
\caption{Caption}%
\label{fig:OneEleven}%
\end{figure}%
\end{document}
产量pdflatex
供您参考的德语词汇:和=和,之二=直到,画册=数字,画报=绘画,艾因=A或者一,朗格斯=长的,麦汁=单词。
如您所见,有两个问题:
德语的人物缩写不一致。在
otherlanguage
环境启动之前,我们得到一个简短的嗯。,这是我们所希望的。然而,在otherlanguage
环境结束后,我们得到了一个完整的图片这是我们不希望看到的。在连词之后断开是不一致的。在
otherlanguage
环境启动之前,LaTeX 会在自动创建的和;此行为是有意为之。然而,在otherlanguage
环境结束后,LaTeX 不会在和;这种行为很糟糕。
为什么会发生这种情况?我们是否以某种非预期的方式使用了软件包的接口?否则:谁是罪魁祸首?我们应该针对 babel 或 cleveref 或任何其他软件包提交错误报告吗?
对于一份主要包含几十个美式英语段落的德语文档,哪种解决方法会产生尽可能少的副作用:
带星号的版本
\begin{otherlanguage*} \end{otherlanguage*}%
而不是无星号版本
\begin{otherlanguage} \end{otherlanguage}
将环境封闭
\begin{otherlanguage}…\end{otherlanguage}
起来\begingroup…\endgroup
,或将环境括
\begin{otherlanguage}…\end{otherlanguage}
在一对括号中{…}
,或… 你的选择 … ?