我想使用 scrartcl 类提供的标签环境来布局我的简历。我想稍微压缩一下整个文档,特别是标签环境中的列表。我知道 itemize 或 enumerate 环境(以及类似环境)的解决方法,但我不知道如何全局更改标签环境的垂直间距。
这就是我如何全局更改其他环境的垂直间距
\usepackage{paralist} %for the environment compactitem with less space between items
\let\itemize\compactitem
\let\enditemize\endcompactitem
\let\enumerate\compactenum
\let\endenumerate\endcompactenum
\let\description\compactdesc
\let\enddescription\endcompactdesc
\pltopsep=\medskipamount
\plitemsep=2pt
\plparsep=2pt
这里有一个完整的 MWE,只是为了查看间距的差异并澄清我的问题(也许它对某些阶段的某些人作为 CV 模板也会有用):
平均能量损失
\documentclass[DIV12,pagesize,11pt,a4paper]{scrartcl}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\linespread{1.0}
\usepackage[tracking=true]{microtype}
\usepackage{marvosym}
\renewcommand{\familydefault}{\sfdefault}
\usepackage{helvet}
\usepackage{nopageno}
\usepackage{paralist} %for the environment compactitem with less space between items
\let\itemize\compactitem
\let\enditemize\endcompactitem
\let\enumerate\compactenum
\let\endenumerate\endcompactenum
\let\description\compactdesc
\let\enddescription\endcompactdesc
\pltopsep=\medskipamount
\plitemsep=1pt
\plparsep=1pt
\setkomafont{labelinglabel}{\normalfont}%{\ttfamily}
\setkomafont{labelingseparator}{\normalfont}
\begin{document}
\subsection*{Relevant work experience}
None. Been a bit lazy.
\subsection*{Education and Training}
\begin{labeling}[~]{myheadings}
\item[2011--2014] Finished Primary School with outstanding success
\item[2008--2010] Kindergarden diploma
\item[2004--2007] Learned to walk and talk
\end{labeling}
\subsection*{Additional Skills}
\begin{itemize}
\item Good in spelling
\item Awsum in Math
\item Not so good in creating lists
\end{itemize}
\end{document}
问题:
如何在标签环境中设置垂直间距?
最重要的是,我很感激任何形式的风格建议。
答案1
您可以重新定义labeling
(如中所定义scrextend.sty
)以包含所需的值\itemsep
;在我的示例中,我选择了4pt
(标有的行% <- Here
),但您可以使用任何所需的值:
\documentclass[DIV12,pagesize,11pt,a4paper]{scrartcl}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\linespread{1.0}
\usepackage[tracking=true]{microtype}
\usepackage{marvosym}
\renewcommand{\familydefault}{\sfdefault}
\usepackage{helvet}
\usepackage{nopageno}
\usepackage{paralist} %for the environment compactitem with less space between items
\let\itemize\compactitem
\let\enditemize\endcompactitem
\let\enumerate\compactenum
\let\endenumerate\endcompactenum
\let\description\compactdesc
\let\enddescription\endcompactdesc
\pltopsep=\medskipamount
\plitemsep=1pt
\plparsep=1pt
\setkomafont{labelinglabel}{\normalfont}%{\ttfamily}
\setkomafont{labelingseparator}{\normalfont}
\makeatletter
\renewenvironment{labeling}[2][]{%
\def\sc@septext{#1}%
\list{}{\settowidth{\labelwidth}{{%
\usekomafont{labelinglabel}{#2%
\usekomafont{labelingseparator}{\sc@septext}}%
}}%
\leftmargin\labelwidth \advance\leftmargin by \labelsep
\let\makelabel\labelinglabel
\itemsep-4pt% <- Here
}%
}{%
\endlist
}
\makeatother
\begin{document}
\subsection*{Relevant work experience}
None. Been a bit lazy.
\subsection*{Education and Training}
\begin{labeling}[~]{myheadings}
\item[2011--2014] Finished Primary School with outstanding success
\item[2008--2010] Kindergarden diploma
\item[2004--2007] Learned to walk and talk
\end{labeling}
\subsection*{Additional Skills}
\begin{itemize}
\item Good in spelling
\item Awsum in Math
\item Not so good in creating lists
\end{itemize}
\end{document}
xpatch
使用该包修补命令可以使代码变得更短\labeling
:
\documentclass[DIV12,pagesize,11pt,a4paper]{scrartcl}
\usepackage[english]{babel}
\usepackage[T1]{fontenc}
\usepackage[latin1]{inputenc}
\linespread{1.0}
\usepackage[tracking=true]{microtype}
\usepackage{marvosym}
\renewcommand{\familydefault}{\sfdefault}
\usepackage{helvet}
\usepackage{nopageno}
\usepackage{xpatch}
\usepackage{paralist} %for the environment compactitem with less space between items
\let\itemize\compactitem
\let\enditemize\endcompactitem
\let\enumerate\compactenum
\let\endenumerate\endcompactenum
\let\description\compactdesc
\let\enddescription\endcompactdesc
\pltopsep=\medskipamount
\plitemsep=1pt
\plparsep=1pt
\setkomafont{labelinglabel}{\normalfont}%{\ttfamily}
\setkomafont{labelingseparator}{\normalfont}
\xpatchcmd{\labeling}
{\let\makelabel\labelinglabel}
{\let\makelabel\labelinglabel\itemsep-4pt}
{}
{}
\begin{document}
\subsection*{Relevant work experience}
None. Been a bit lazy.
\subsection*{Education and Training}
\begin{labeling}[~]{myheadings}
\item[2011--2014] Finished Primary School with outstanding success
\item[2008--2010] Kindergarden diploma
\item[2004--2007] Learned to walk and talk
\end{labeling}
\subsection*{Additional Skills}
\begin{itemize}
\item Good in spelling
\item Awsum in Math
\item Not so good in creating lists
\end{itemize}
\end{document}