如果有人能帮我解决这个问题,我将不胜感激。我不知道如何防止第二个短语在行末断开。当然,我可以自己断开短语(第三个短语),但它不适合整个文本的宽度,我必须手动使其适合。我需要 Latex 来处理该换行符。显然,原因是轮廓包,但我确实需要它的非常粗体的字体。
编辑:我简化了我的代码。抱歉。
\documentclass[10pt]{article}
\usepackage[usenames]{color}
\usepackage[outline]{contour}
\definecolor{MIR}{RGB}{187, 30, 16}
\contourlength{0.3pt}
\contournumber{20}
\newcommand{\MIR}[1]{\contour{MIR}{#1}}
\begin{document}
I only need some text width enough to prove my point, so I'll write some nonsenses.
\MIR{I only need some text width enough to prove my point, so I'll write some nonsenses.}
\MIR{I only need some text width enough to prove my point, so I'll write}\linebreak \MIR{some nonsenses.}
\end{document}
答案1
您不能在 的范围内换行\contour
。但您可以拆分单词并应用于\contour
每个单词。
\documentclass[10pt]{article}
\usepackage[usenames]{color}
\usepackage[outline]{contour}
\usepackage{xparse}
\definecolor{MIR}{RGB}{187, 30, 16}
\contourlength{0.3pt}
\contournumber{20}
\ExplSyntaxOn
\NewDocumentCommand{\MIR}{m}
{
\seq_set_split:Nnn \l_tmpa_seq { ~ } { #1 }
\seq_map_inline:Nn \l_tmpa_seq { \contour{MIR}{##1} ~ } \unskip
}
\ExplSyntaxOff
\begin{document}
I only need some text width enough to prove my point, so I'll write some nonsenses.
\MIR{I only need some text width enough to prove my point, so I'll write some nonsenses.}
\end{document}