我正在制作一个自定义家庭作业模板,出于某种原因,第一行的长单词的分词功能出现故障。我添加了一个 MWE。有人知道发生了什么吗?
\documentclass[12pt]{article}
\usepackage{lipsum}
\usepackage{enumerate}
\usepackage{enumitem}
\usepackage[scale=0.95]{libertine}
\usepackage[libertine]{newtxmath}
\usepackage{mathtools}
\usepackage{lipsum}
\usepackage{graphicx}
%%%%%%%%%%%%%%% FORMAT
\newcommand{\alphabet}{%
abcdefghijklmnopqrstuvwxyz%
}
\newlength{\textW}
\setlength{\textW}{\widthof{\alphabet}* \real{2.5}}%Page width
\usepackage[letterpaper,textwidth=\textW,top=1in,bottom=1in]{geometry}
%%%%%%%%%%%%%%% END FORMAT
\newlist{problems}{enumerate}{2}
\setlist[problems, 1]{
label=Problem~\arabic*.\protect\thisproblem,
before=\leavevmode\itshape,
font =\bf,
wide = 0pt,
}%
\setlist[problems, 2]{
label=\alph*.,
wide=0pt,
before=\leavevmode,
font =\bf,
topsep=0pt,
}%
\newenvironment{parts}{\problems}{\endproblems}
\let\part\item
\let\thisproblem\item
\newcommand{\problem}[1][]{%
\if\relax\detokenize{#1}\relax
\def\thisproblem{}%
\else
\def\thisproblem{~(#1)}%
\fi
\item}
%%%%%%%%%%%%%%% END ENVIRONMENTS
\begin{document}
\begin{problems}
\problem[My Math Book IX.4.3(a)] \lipsum[1-1]
\end{problems}
\end{document}
答案1
加载拉丁连字模式可以解决您的问题(但我猜最终文档不会是拉丁文——有趣的是,如果使用英国语言,也不会出现溢出框)。因此,回答您的问题:使用的连字模式不会在单词“consectetuer”中返回可行的连字点,导致第一行没有连字。
\documentclass[12pt]{article}
\usepackage[latin]{babel}
\usepackage{lipsum}
\usepackage{enumerate}
\usepackage{enumitem}
\usepackage[scale=0.95]{libertine}
\usepackage[libertine]{newtxmath}
\usepackage{mathtools}
\usepackage{lipsum}
\usepackage{graphicx}
%%%%%%%%%%%%%%% FORMAT
\newcommand{\alphabet}{%
abcdefghijklmnopqrstuvwxyz%
}
\newlength{\textW}
\setlength{\textW}{\widthof{\alphabet}* \real{2.5}}%Page width
\usepackage[letterpaper,textwidth=\textW,top=1in,bottom=1in]{geometry}
%%%%%%%%%%%%%%% END FORMAT
\newlist{problems}{enumerate}{2}
\setlist[problems, 1]{
label=Problem~\arabic*.\protect\thisproblem,
before=\leavevmode\itshape,
font =\bf,
wide = 0pt,
}%
\setlist[problems, 2]{
label=\alph*.,
wide=0pt,
before=\leavevmode,
font =\bf,
topsep=0pt,
}%
\newenvironment{parts}{\problems}{\endproblems}
\let\part\item
\let\thisproblem\item
\newcommand{\problem}[1][]{%
\if\relax\detokenize{#1}\relax
\def\thisproblem{}%
\else
\def\thisproblem{~(#1)}%
\fi
\item}
%%%%%%%%%%%%%%% END ENVIRONMENTS
\begin{document}
\begin{problems}
\problem[My Math Book IX.4.3(a)] \lipsum[1-1]
\end{problems}
\end{document}
可用的连字点为\usepackage[latin]{babel}
,con-sec-te-tuer
而如果没有该线,则会得到con-sectetuer
。