以 itemize 开头的部分的垂直对齐

以 itemize 开头的部分的垂直对齐

我正在写一份简历将节标题放在加宽的左边距中。在下面的例子中,我试图获取itemize部分酒吧与节标题垂直对齐,就像其他两个节中的内容对齐一样。但是,在itemize节开头的 之前有一个不受欢迎的间隙,尽管有几种设置旨在防止这种情况(例如topsep=0pt)。

观察到的/期望的图像

我缺少什么来“消耗”这个空间并将其itemize提升? 我尝试过否定\vspace\vskip,但这充其量只是一种破解方法,而且容易出现反复试验。(相关地,我的一些\setlist选项是否对此没有必要?)

\documentclass[10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=0.75in, left=1.5in]{geometry}

% Section headers in margins
% https://tex.stackexchange.com/a/1315/10906
\usepackage{titlesec}
\titleformat{\section}[leftmargin]
{\sffamily}
{}{0pt}{}
\titlespacing{\section}
{4pc}{1.5ex plus .1ex minus .2ex}{2pc}

\setlength\parindent{0pt}
\usepackage{enumitem}
\setlist{nolistsep, nosep, topsep=0pt}    
\setlength{\parskip}{0.5ex}


\begin{document}

\section{Education}
\textbf{Metasyntactic University \dotfill Date}
\begin{itemize}
\item Degree 1
\item Certificate 2
\end{itemize}

\section{Foo}
This is some brief free-form text about some stuff that I can do.  Did you know I do Thing~3 and Thing~4?  It's pretty cool; I know.

\section{Bar}
\begin{itemize}
\item Skill 5
\item Skill 6
\end{itemize}

\end{document}

答案1

通过垂直跳回到同一基线来手动纠正此行为:

在此处输入图片描述

\documentclass[10pt]{article}
\usepackage[margin=0.75in, left=1.5in]{geometry}

% Section headers in margins
% http://tex.stackexchange.com/a/1315/10906
\usepackage{titlesec}
\titleformat{\section}[leftmargin]
  {\sffamily}
  {}{0pt}{}
\titlespacing{\section}
  {4pc}{1.5ex plus .1ex minus .2ex}{2pc}

\setlength\parindent{0pt}
\usepackage{enumitem}
\setlist{nolistsep, nosep, topsep=0pt}    
\setlength{\parskip}{0.5ex}


\begin{document}

\section{Education}
\textbf{Metasyntactic University \dotfill Date}
\begin{itemize}
  \item Degree 1
  \item Certificate 2
\end{itemize}

\section{Foo}
This is some brief free-form text about some stuff that I can do.  Did you know I do Thing~3 and Thing~4?  It's pretty cool; I know.

\section{Bar}
\leavevmode% Start paragraph
\par% End paragraph/enter vertical mode
\vspace{\dimexpr-\baselineskip-\parskip}% Vertically jump back to baseline of section
\begin{itemize}
  \item Skill 5
  \item Skill 6
\end{itemize}

\end{document}

相关内容