我一直在写简历。但是,有些文字超出了一行。例如,这里的“论文主题”超出了一行,如下所示:
以下是代码:
\documentclass[10pt]{article}
\usepackage{calc}
\reversemarginpar
\usepackage[paper=letterpaper,
includefoot, % Uncomment to put page number above margin
marginparwidth=1.2in, % Length of section titles
marginparsep=.05in, % Space between titles and text
margin=0.5in, % 1 inch margins
includemp]{geometry}
\setlength{\parindent}{0in}
\renewcommand{\section}[1]{\pagebreak[3]%
\vspace{1.3\baselineskip}%
\phantomsection\addcontentsline{toc}{section}{#1}%
\noindent\llap{\scshape\smash{\parbox[t]{\marginparwidth}{\hyphenpenalty=10000\raggedright #1}}}%
\vspace{-\baselineskip}\par}
\begin{document}
\section{Education}
M.S., Civil Engineering, The University of Texas at Austin, Austin, TX\hfill\textbf{Dec 20XX}\\
Thesis: \emph{On Accommodating Spatial Dependence in Bicycle and Pedestrian Injury Counts by Severity Level}\\
Adviser: Dr. ABC
\end{document}
如果我们编译此代码,论文主题中的“级别”会溢出到下一行。这就是当前的问题。是否有可能让文本适合那一行?
感谢您的反馈!
答案1
使用\resizebox
和包graphicx
。另一个推荐的包是 microtype。例如,将其放在 \usepackage[shrink=100]{microtype}
MWE 的序言中,然后查看效果,无需\resizebox
\documentclass[10pt]{article}
\usepackage{graphicx}
\usepackage{calc}
\reversemarginpar
\usepackage[paper=letterpaper,
includefoot, % Uncomment to put page number above margin
marginparwidth=1.2in, % Length of section titles
marginparsep=.05in, % Space between titles and text
margin=0.5in, % 1 inch margins
includemp]{geometry}
\setlength{\parindent}{0in}
\renewcommand{\section}[1]{\pagebreak[3]%
\vspace{1.3\baselineskip}%
\phantomsection\addcontentsline{toc}{section}{#1}%
\noindent\llap{\scshape\smash{\parbox[t]{\marginparwidth}{\hyphenpenalty=10000\raggedright #1}}}%
\vspace{-\baselineskip}\par}
\begin{document}
\section{Education}
M.S., Civil Engineering, The University of Texas at Austin, Austin, TX\hfill\textbf{Dec 20XX}\\
\resizebox{\textwidth}{!}{Thesis: \emph{On Accommodating Spatial
Dependence in Bicycle and Pedestrian Injury
Counts by Severity Level}\\
}
Thesis: \emph{On Accommodating Spatial Dependence in Bicycle and Pedestrian Injury Counts by Severity Level}\\
Adviser: Dr. ABC
\end{document}