控制部分水平间距而不挤压

控制部分水平间距而不挤压

我正在写简历目录简历模板。我有以下部分来描述我的经验

\documentclass[margin]{res}  

% Default font is the helvetica postscript font
\usepackage{helvet}

% Increase text height
\textheight=700pt

\begin{document}

%-------------------------------------------------------------------------------
%   NAME AND ADDRESS SECTION
%-------------------------------------------------------------------------------
\name{my name}

\begin{resume}

% Modify the format of each position
\begin{format}
\title{l}\employer{r}\\
\dates{l}\location{r}\\
\body\\
\end{format}
%-------------------------------------------------------------------------------

\section{EXPERIENCE}

\employer{my employer}
\location{my location}
\dates{dates}
\title{\textbf{A title that's quite long, like this long}}
\begin{position} \vspace{-0.5\baselineskip}
    \begin{itemize}
        \item item 1
        \item item 2
        \item item 3
    \end{itemize}
\end{position}

\end{resume}
\end{document}

编译结果如下: 例子

您可以看到“long”一词出现在第二行,尽管它应该保留在第一行。它还迫使“我的雇主”和“我的位置”之间增加了一个空格。我尝试搜索在目录更改格式,但我对 LaTex 不太熟悉。有没有简单的方法可以解决这个问题?


编辑:

我正在使用以下工具进行编译:

15:16 $ pdflatex -version
pdfTeX 3.14159265-2.6-1.40.20 (TeX Live 2019)
kpathsea version 6.3.1
Copyright 2019 Han The Thanh (pdfTeX) et al.
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Han The Thanh (pdfTeX) et al.
Compiled with libpng 1.6.36; using libpng 1.6.36
Compiled with zlib 1.2.11; using zlib 1.2.11
Compiled with xpdf version 4.01

编辑:

通过请求添加编译器日志:

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (TeX Live 2019) (preloaded format=pdflatex 2019.8.27)  9 SEP 2019 15:30
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**test.res
(./test.res
LaTeX2e <2018-12-01>
(./res.cls
Document Style `res' <26 Sep 89>.
Document Class: res 2000/05/19 v1.4b Resume class
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/article.cls
Document Class: article 2018/09/03 v1.4i Standard LaTeX document class
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2018/09/03 v1.4i Standard LaTeX file (size option)
)
\c@part=\count80
\c@section=\count81
\c@subsection=\count82
\c@subsubsection=\count83
\c@paragraph=\count84
\c@subparagraph=\count85
\c@figure=\count86
\c@table=\count87
\abovecaptionskip=\skip41
\belowcaptionskip=\skip42
\bibindent=\dimen102
)
No auxiliary output files.

\tabular@text=\toks14
\tabular@head=\toks15
\tabular@tail=\toks16
\@ta=\toks17
\undefined@token=\toks18
\sectionwidth=\dimen103
\sectionskip=\skip43
\resumewidth=\dimen104
\@columnwidth=\dimen105
\c@numberofcolumns=\count88
) (/usr/local/texlive/2019/texmf-dist/tex/latex/psnfss/helvet.sty
Package: helvet 2005/04/12 PSNFSS-v9.2a (WaS) 

(/usr/local/texlive/2019/texmf-dist/tex/latex/graphics/keyval.sty
Package: keyval 2014/10/28 v1.15 key=value parser (DPC)
\KV@toks@=\toks19
))
No file test.aux.
LaTeX Font Info:    Checking defaults for OML/cmm/m/it on input line 9.
LaTeX Font Info:    ... okay on input line 9.
LaTeX Font Info:    Checking defaults for T1/cmr/m/n on input line 9.
LaTeX Font Info:    ... okay on input line 9.
LaTeX Font Info:    Checking defaults for OT1/cmr/m/n on input line 9.
LaTeX Font Info:    ... okay on input line 9.
LaTeX Font Info:    Checking defaults for OMS/cmsy/m/n on input line 9.
LaTeX Font Info:    ... okay on input line 9.
LaTeX Font Info:    Checking defaults for OMX/cmex/m/n on input line 9.
LaTeX Font Info:    ... okay on input line 9.
LaTeX Font Info:    Checking defaults for U/cmr/m/n on input line 9.
LaTeX Font Info:    ... okay on input line 9.
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <7> on input line 16.
LaTeX Font Info:    External font `cmex10' loaded for size
(Font)              <5> on input line 16.
LaTeX Font Info:    Try loading font information for OMS+cmr on input line 34.
(/usr/local/texlive/2019/texmf-dist/tex/latex/base/omscmr.fd
File: omscmr.fd 2014/09/29 v2.5h Standard LaTeX font definitions
)
LaTeX Font Info:    Font shape `OMS/cmr/m/n' in size <10> not available
(Font)              Font shape `OMS/cmsy/m/n' tried instead on input line 34.
 [1

{/usr/local/texlive/2019/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] ) 
Here is how much of TeX's memory you used:
 344 strings out of 492609
 4036 string characters out of 6129033
 63270 words of memory out of 5000000
 4336 multiletter control sequences out of 15000+600000
 4553 words of font info for 17 fonts, out of 8000000 for 9000
 1141 hyphenation exceptions out of 8191
 29i,8n,20p,117b,181s stack positions out of 5000i,500n,10000p,200000b,80000s
</usr/
local/texlive/2019/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx10.pfb></usr/l
ocal/texlive/2019/texmf-dist/fonts/type1/public/amsfonts/cm/cmbx12.pfb></usr/lo
cal/texlive/2019/texmf-dist/fonts/type1/public/amsfonts/cm/cmr10.pfb></usr/loca
l/texlive/2019/texmf-dist/fonts/type1/public/amsfonts/cm/cmsy10.pfb>
Output written on test.pdf (1 page, 42404 bytes).
PDF statistics:
 24 PDF objects out of 1000 (max. 8388607)
 16 compressed objects within 1 object stream
 0 named destinations out of 1000 (max. 500000)
 1 words of extra memory for PDF output out of 10000 (max. 10000000)

答案1

环境position实际上设置了一个具有等宽列(在您的例子中为 2)的表格。这只是默认的做法。您可以将您的经验 \title在零宽度内,\makebox因此它可以毫无问题地扩展到第一列宽度:

在此处输入图片描述

\documentclass[margin]{res}  

% Default font is the helvetica postscript font
\usepackage{helvet}

% Increase text height
\textheight=700pt

\begin{document}

%-------------------------------------------------------------------------------
%   NAME AND ADDRESS SECTION
%-------------------------------------------------------------------------------
\name{my name}

\begin{resume}

% Modify the format of each position
\begin{format}
  \title{l}\employer{r}\\
  \dates{l}\location{r}\\
  \body\\
\end{format}
%-------------------------------------------------------------------------------

\section{EXPERIENCE}

\employer{my employer}
\location{my location}
\dates{dates}
\title{\makebox[0pt][l]{\textbf{A title that's quite long, like this long}}}
\begin{position} \vspace{-0.5\baselineskip}
  \begin{itemize}
    \item item 1
    \item item 2
    \item item 3
  \end{itemize}
\end{position}

\end{resume}

\end{document}

相关内容