仅更改一行的文本宽度

仅更改一行的文本宽度

我正在写简历。我的名字下面有一行,上面写着我的电子邮件、电话号码等。我希望这一行从与下面的目标相同的边距开始,并同样在下面的文本停止的地方停止。我想我需要一些命令来更改地址行的文本宽度,但我找不到相同的命令。请告诉我解决方案。

\documentclass[margin]{res}
\usepackage{amsmath}
\setlength{\textwidth}{6in} % set width of text portion
\addtolength{\textheight}{1.8in}
\addtolength{\voffset}{-0.75in}
\addtolength{\hoffset}{-0.5in}
\setlength{\parskip}{0.1in }
\usepackage[hidelinks]{hyperref}
\begin{document}

% Center the name over the entire width of resume:
\moveleft.6\hoffset\centerline{\Large\bf Ajjhjghf Dkjggi}
\smallskip
%address line
\moveleft.6\hoffset\centerline{\underline{\href{mailto:blahblah.edu}{blahblha.edu} $\bullet$ Ph.:+kjhghjkjhg $\bullet$ \href{www.blahblah.com}{blahblha.com} $\bullet $bhak bhak bahkrd rd, \#poi, bibibi xxxxx}}

\begin{resume}

\section{OBJECTIVE}  Seeking an jkhasjkdh jhasd ah jlkahds lalkhkljahd kjahd akjh dalkjh lakjh kjhda ajklhsd ajkshd alkjdsh aljkhd ajkshd ajkshd lajkdh alkjshd alskjdh alkjshd lakjsdh.

\section{EDUCATION} 
    {\bf University of XXXXXX} \hfill   (2012 - 2014) \\
    {\sl blbl, blblbl Engineering  {\bf GPA: } }


\end{resume}
\end{document}

答案1

顺便说一句,我认为您应该使用包geometry来设置页面布局尺寸。

无论如何,根据边距中的内容的res.cls长度使用。所以:\sectionwidth

\documentclass[margin]{res}
\usepackage{amsmath}
\setlength{\textwidth}{6in} % set width of text portion
\addtolength{\textheight}{1.8in}
\addtolength{\voffset}{-0.75in}
\addtolength{\hoffset}{-0.5in}
\setlength{\parskip}{0.1in }
\usepackage[hidelinks]{hyperref}
\begin{document}

\newcommand*{\desicenteredline}[1]{%
    \ifhmode\expandafter\\\else\noindent\fi
    \hspace*{-\sectionwidth}%
    \hbox to \dimexpr\sectionwidth+\linewidth\relax{\hss #1\hss}\hskip0pt\relax}

% Center the name over the entire width of resume:
%\moveleft.6\hoffset\centerline{\Large\bf Ajjhjghf Dkjggi}

\desicenteredline{\Large\bf Ajjhjghf Dkjggi}

\smallskip
%address line
%\moveleft.6\hoffset\centerline{\underline{\href{mailto:blahblah.edu}{blahblha.edu} $\bullet$ Ph.:+kjhghjkjhg $\bullet$ \href{www.blahblah.com}{blahblha.com} $\bullet $bhak bhak bahkrd rd, \#poi, bibibi xxxxx}}

remove me (test)\desicenteredline{\underline{\href{mailto:blahblah.edu}{blahblha.edu} $\bullet$ Ph.:+kjhghjkjhg $\bullet$ \href{www.blahblah.com}{blahblha.com} $\bullet $bhak bhak bahkrd rd, \#poi, bibibi xxxxx}}remove me (test)


% adding a line accross the full page
\desicenteredline{\hrulefill}


\begin{resume}

\section{OBJECTIVE}  Seeking an jkhasjkdh jhasd ah jlkahds lalkhkljahd kjahd akjh dalkjh lakjh kjhda ajklhsd ajkshd alkjdsh aljkhd ajkshd ajkshd lajkdh alkjshd alskjdh alkjshd lakjsdh.

\section{EDUCATION} 
    {\bf University of XXXXXX} \hfill   (2012 - 2014) \\
    {\sl blbl, blblbl Engineering  {\bf GPA: } }


\end{resume}
\end{document}

中心事物

答案2

听从你的一些提示,我想我找到了一个解决方案。虽然并不优雅。

\hspace*{-\sectionwidth}{\href{mailto:blahblah.edu}{blahblha.edu}\hfill $\bullet$ Ph.:+kjhghjkjhg\hfill $\bullet$ \href{www.blahblah.com}{blahblha.com} \hfill $\bullet $bhak bhak bahkrd rd, \#poi, bibibi xxxxx}
\vspace{-4mm}

\hspace*{-\sectionwidth}\hrulefill

相关内容