考虑以下代码:
\documentclass[12pt]{book}
\usepackage{enumitem,xcolor}
\usepackage[T1]{polski}
\usepackage[tracking=true]{microtype} %This line must be commented out when using Xelatex to compile the Index
\usepackage[margin=.5in,paperwidth=4in,paperheight=6in]{geometry}
\textheight=4.95in \textwidth 3.00in
\newcommand{\longemdash}{{\fontfamily{cmss}\selectfont---}}
\usepackage[sfdefault]{cabin} % Sets cabin as the main font.
\usepackage{xparse} % NEEDED TO USE \NewDocumentCommand instead of \newcommand.
\definecolor{granite}{RGB}{103,103,103}
\newcommand{\fancyquote}[2]{%
\par{#1}\\[2pt]\hspace*{\fill}\longemdash{\fontfamily{qtm}\selectfont\textit{\textbf{#2}}}%
}
\newcommand{\funnyquote}[2]{%
\par{#1}\\[-10.5pt]\hspace*{\fill}\longemdash{\fontfamily{qtm}\selectfont\textit{\textbf{#2}}}%
}
\newlist{advice}{enumerate}{1}
\setlist[advice]{
label=\formatadvicenumber{\textbf{\color{granite}\arabic*}},
ref=\arabic*,
leftmargin=1.25em,
labelsep=.55em,
itemsep=1em,
wide=0pt, % Prevents numbers from entering the left-hand margin.
resume,
}
\NewDocumentCommand{\formatadvicenumber}{m}{%
\raisebox{\dimexpr1.35\ht\strutbox-\height}[0pt][0pt]{\LARGE #1}%
}
\begin{document}
\thispagestyle{empty}
\begin{advice}
\item \funnyquote{The more I think about language, the more it amazes me that people ever understand each other at all.}{Kurt G{\"{o}}del}
\end{advice}
\end{document}
产生
然而,当我注释掉时\usepackage[T1]{polski}
,我得到了
Polski
问题:有人能指出是什么原因导致了我的代码中调用包(我偶尔会用这个包来正确排版某些波兰名字)和错误的连字符而发生冲突吗?
谢谢。
答案1
如果你只想排版几个(甚至很多)波兰名字,但文本是英文(或任何其他语言),你应该不是load polski
,用于波兰语文档(我认为已经过时了)。
您需要的是\usepackage[T1]{fontenc}
,并且可能babel-polish
(如果您希望此类名称可以用连字符连接。请注意,仅删除\usepackage[T1]{polski}
并不足以解决您的问题。
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[polish,english]{babel}
\newcommand{\polishname}[1]{\foreignlanguage{polish}{#1}}
\providehyphenmins{polish}{22} % <-- what polski.sty does
\begin{document}
\polishname{Wojciech Szczęsny} is a goalkeeper; \polishname{Lech Wałęsa}
is a politician; \polishname{Karol Woityła} was a pope.
\bigskip
\parbox{0pt}{\hspace{0pt}%
\polishname{Wojciech Szczęsny} is a goalkeeper; \polishname{Lech Wałęsa}
is a politician; \polishname{Karol Woityła} was a pope.
}
\end{document}