恢复模式下 noindent 失败

恢复模式下 noindent 失败

我正在写简历,想在每个部分名称下添加一行:

\documentclass[line]{res}

\begin{document}
\renewcommand{\namefont}{\LARGE \bf}

\name{Tianlun Zhang}
\address{[email protected]}
\address{86-15921814184}
\address{ifthiskills.me}


\begin{resume}

\section{OBJECTIVE} 
{\rule[3pt]{\textwidth}{1pt}}} \\
...
\end{resume}
\end{document}

但是该行有一个缩进,我无法抑制它\noindent,有什么想法吗?

答案1

您需要补偿长度\sectionwidth

\documentclass[line]{res}

\renewcommand{\namefont}{\LARGE\bfseries}
\newcommand\Hrule{%
  \par\hspace*{-\sectionwidth}\rule[3pt]{\dimexpr\textwidth+\sectionwidth\relax}{1pt}\par
}

\begin{document}

\name{Tianlun Zhang}
\address{[email protected]}
\address{\parbox[t]{3cm}{86-15921814184 \\ ifthiskills.me}}

\begin{resume}
\section{OBJECTIVE}
\Hrule
\section{ANOTHER SECTION}
\Hrule
\end{resume}

\end{document}

在此处输入图片描述

根据res.cls\address只能使用两次,因此第三次使用时将覆盖第二次调用;如果地址中包含两行以上,则可以使用\parbox适当宽度的,如我在示例中所做的那样。

顺便说一句,在现代 LaTeX 文档中\bf应该用 来代替。\bfseries

相关内容