我正在研究如何自动计算题词宽度,同时保持题词引文左对齐且非斜体。以下代码是从页面上提供的一个很好的解决方案中复制而来碑文宽度,让我很深入:
\usepackage{epigraph,varwidth}
\renewcommand{\epigraphsize}{\small}
\setlength{\epigraphwidth}{0.6\textwidth}
\renewcommand{\textflush}{flushright}
\renewcommand{\sourceflush}{flushright}
% A useful addition
\newcommand{\epitextfont}{\itshape}
\newcommand{\episourcefont}{\scshape}
\makeatletter
\newsavebox{\epi@textbox}
\newsavebox{\epi@sourcebox}
\newlength\epi@finalwidth
\renewcommand{\epigraph}[2]{%
\vspace{\beforeepigraphskip}
{\epigraphsize\begin{\epigraphflush}
\epi@finalwidth=\z@
\sbox\epi@textbox{%
\varwidth{\epigraphwidth}
\begin{\textflush}\epitextfont#1\end{\textflush}
\endvarwidth
}%
\epi@finalwidth=\wd\epi@textbox
\sbox\epi@sourcebox{%
\varwidth{\epigraphwidth}
\begin{\sourceflush}\episourcefont#2\end{\sourceflush}%
\endvarwidth
}%
\ifdim\wd\epi@sourcebox>\epi@finalwidth
\epi@finalwidth=\wd\epi@sourcebox
\fi
\leavevmode\vbox{
\hb@xt@\epi@finalwidth{\hfil\box\epi@textbox}
\vskip1.75ex
\hrule height \epigraphrule
\vskip.75ex
\hb@xt@\epi@finalwidth{\hfil\box\epi@sourcebox}
}%
\end{\epigraphflush}
\vspace{\afterepigraphskip}}}
\makeatother
我该如何调整此代码以保持题词引用左对齐且非斜体?
亲切的问候,
詹森