自动将表格签名行扩展到先前的 parbox 宽度

自动将表格签名行扩展到先前的 parbox 宽度

我所在大学的论文风格要求声明页必须包含信息框(签名等)。我可以\parbox手动将签名行延伸到边界的末尾(8.595cm),但我假设有一种自动方法可以实现这一点,我可能需要在将来更改字体大小,从而更改宽度,parbox以便看起来不错。一个最小示例(修改自塞巴斯蒂亚诺的回答):

% Extend signature lines to the length of the parbox automatically 
\documentclass[%12pt,
            oneside]{memoir}

\begin{document}

\mainmatter
\chapter*{\centering Declaration}

\begin{centering}

\parbox{10.5cm}{I declare that this thesis has been composed solely by myself and, except where otherwise stated and clearly indicated, is based on my own work and research carried out in the School of [School Name] at [University Name] between [Month] [Year] and [Month] [Year]. \\[8pt]}

\parbox{10.5cm}{I declare that this thesis has not been nor will be used for admission to a degree conferred by any other university or institution and neither has it previously been used for admission to a degree conferred by [University Name]. \\[26pt]}

% Doing it manually by eye sight led to a length of 8.595cm
\begin{tabular}{@{}p{1.5cm}p{8.595cm}@{}}
    Signature: & \hspace{0.2cm}\hrulefill \vspace{0.9cm}\\
    Name: & \hspace{0.2cm}\hrulefill \vspace{0.9cm} \\
    Date: & \hspace{0.2cm}\hrulefill \vspace{0.9cm}
\end{tabular}

\end{centering}

\end{document}

如果可能的话,我希望它自动看起来像这样,这是手动实现的,但即便如此,右侧线条也不与文本齐平\parbox

我希望它自动显示成什么样子

\textwidth产生了这种令人憎恶的事情:

\文本宽度

我尝试使用不同的边距长度包含在这里但似乎都行不通,我不确定是否需要将桌子\parbox也放进去,或者是否有办法计算延长签名线以使其齐平。任何帮助都将不胜感激,我在其他答案中找不到任何可以帮助解决这个问题的东西。

答案1

像这样?

在此处输入图片描述

使用tabularx(由 加载memoir):

\documentclass[12pt,
            oneside]{memoir}

\begin{document}

\mainmatter
\chapter*{\centering Declaration}

\begin{center}

\parbox{10.5cm}{I declare that this thesis has been composed solely by myself and, except where otherwise stated and clearly indicated, is based on my own work and research carried out in the School of [School Name] at [University Name] between [Month] [Year] and [Month] [Year]. \\[8pt]}

\parbox{10.5cm}{I declare that this thesis has not been nor will be used for admission to a degree conferred by any other university or institution and neither has it previously been used for admission to a degree conferred by [University Name]. \\[26pt]}

% Doing it manually by eye sight led to a length of 8.595cm
\begin{tabularx}{10.5cm}{@{} l @{\quad} X<{\rule{0pt}{9mm}} @{}}
    Signature:  &   \\  \cline{2-2}
    Name:       &   \\  \cline{2-2}
    Date:       &   \\  \cline{2-2}
\end{tabularx}
    \end{center}

\end{document}

注意:centering˙ is not an environment but switch, i,e, should be used as\centering (after it all is centered), Instead of it I usecenter` 环境

相关内容