我正在使用res
文档类来创建一份简单的简历。我的目标是像这样使用 LaTeX 创建简历但是我必须将我的姓名和联系信息放在文档顶部的中央,而不是左右两侧。
我使用了center
环境,但它只将主要内容居中,而忽略了部分标题。我知道这是某种边距问题,但我不确定如何让它在整个文档中居中。我的源代码几乎与链接中的代码完全一样。
答案1
如果您知道部分的最长名称,则以下(不优雅的)解决方案会将名称置于部分文本的中心:
% \documentclass[line, margin]{res}
\documentclass[margin, centered]{res}
\begin{document}
\newlength{\maxmarg}
\settowidth{\maxmarg}{\textbf{EXPERIENCE}}
\name{\hspace{0.5\maxmarg} Max Burstein}
\address{\hspace{0.5\maxmarg}1234 Herp Derp Lane \\
\hspace{0.5\maxmarg}Rabble, FL 34343 \\
\hspace{0.5\maxmarg} (516) 516-5165}
\begin{resume}
\section{EDUCATION}
Bachelor of Science in Blog Writing \\
University of Y Combinator, Palo Alto, CA \\
Minor: Fantasy Football \\
Expected to graduate May 2013 \\
GPA: 4.0
\section{SKILLS}
\begin{itemize}
\item Ruby
\item C++
\item Python
\item System Administration
\end{itemize}
\section{EXPERIENCE}
\textit{Detroit Red Wings Starting Center} \hfill 2011-2012 \\
Was the starting center for the Detroit Red Wings until the strike :( Looking to play across the pond for a little bit. \\ [10pt]
\textit{Green Bay Packers Starting Wide Receiver} \hfill 2010-2011 \\
Was the starting WR for the Green Bay Packers during our super bowl run. I caught the game winning touchdown and decided to retire on top.
\section{HONORS}
\begin{tabular}{l l}
May 2012 & \textbf{\textit{World's best double clicker}} \\ [5pt]
July 2012 & \textbf{\textit{USA Candy Eating Champion}} \\ [5pt]
December 2012 & \textbf{\textit{Inducted into the NFL Hall Of Fame}} \\
\end{tabular}
\end{resume}
\end{document}
如果想要更精确的调整,的初始值\maxmarg
应该扩大\sectionskip
,其res
值为 3.5ex 加 1ex 减 -.2ex。
答案2
由于您没有提供任何有关输出外观的规范,因此以下内容提供了一个简单的居中解决方案,同时保留了类中的设置res
:
\documentclass[line, margin]{res}
\begin{document}
\name{\makebox[\textwidth]{Max Burstein}}
\address{\makebox[\textwidth]{1234 Herp Derp Lane \\ Rabble, FL 34343 \\ (516) 516-5165}}
% Uncomment below to see second output
%--------------------------------------------------------------
%\address{\makebox[\textwidth]{%
% \parbox{0.2\textwidth}{%
% \setlength\topsep{0pt} % removes the extra spaces created by the center environment
% \setlength\parskip{0pt}
% \begin{center}
% 1234 Herp Derp Lane \\ Rabble, FL 34343 \\ (516) 516-5165
% \end{center}
% }}}
%--------------------------------------------------------------
\begin{resume}
\section{EDUCATION}
Bachelor of Science in Blog Writing \\
University of Y Combinator, Palo Alto, CA \\
Minor: Fantasy Football \\
Expected to graduate May 2013 \\
GPA: 4.0
\section{SKILLS}
\begin{itemize}
\item Ruby
\item C++
\item Python
\item System Administration
\end{itemize}
\section{EXPERIENCE}
\textit{Detroit Red Wings Starting Center} \hfill 2011-2012 \\
Was the starting center for the Detroit Red Wings until the strike :( Looking to play across the pond for a little bit. \\ [10pt]
\textit{Green Bay Packers Starting Wide Receiver} \hfill 2010-2011 \\
Was the starting WR for the Green Bay Packers during our super bowl run. I caught the game winning touchdown and decided to retire on top.
\section{HONORS}
\begin{tabular}{l l}
May 2012 & \textbf{\textit{World's best double clicker}} \\ [5pt]
July 2012 & \textbf{\textit{USA Candy Eating Champion}} \\ [5pt]
December 2012 & \textbf{\textit{Inducted into the NFL Hall Of Fame}} \\
\end{tabular}
\end{resume}
\end{document}