如何使用 packed itemize 而不是 itemize 来防止第二行缩进?换句话说,我不希望“Major”缩进。
\documentclass[letterpaper]{article}
\usepackage[empty]{fullpage}% http://ctan.org/pkg/fullpage
\newenvironment{packed_itemize}
{\begin{itemize}
\setlength{\itemindent}{-10pt}
\setlength{\itemsep}{-0.3pt}}
{\end{itemize}\vspace{-0.5em}}
\newenvironment{packed_inner_itemize}
{\begin{packed_itemize}}
{\end{packed_itemize}\vspace{0.25em}}
\newcommand{\ressubheading}[4]{%
\item\textbf{#1} \hfill #2\null\\
#3 \hfill #4%
}
\begin{document}
\begin{packed_itemize}
\ressubheading{Name of Grad School}{City}{Major}{2010 -- 2012}
\ressubheading{Name of Grad School}{City}{Major}{2010 -- 2012}
\ressubheading{Name of Grad School}{City}{Major}{2010 -- 2012}
\ressubheading{Name of Grad School}{City}{Major}{2010 -- 2012}
\end{packed_itemize}
\end{document}
答案1
您应该通过以下方式调整左边距\leftmargini
:
\documentclass[letterpaper]{article}
\usepackage[empty]{fullpage}% http://ctan.org/pkg/fullpage
\newenvironment{packed-itemize}
{\leftmargini=15pt\begin{itemize}
\setlength{\itemsep}{-0.3pt}}
{\end{itemize}\vspace{-0.5em}}
\newenvironment{packed_inner-itemize}
{\begin{packed-itemize}}
{\end{packed-itemize}\vspace{0.25em}}
\newcommand{\ressubheading}[4]{%
\item\textbf{#1} \hfill #2\null\\\relax
#3 \hfill #4%
}
\begin{document}
\noindent Standard itemize:
\begin{itemize}
\item{Name of Grad School}\hfill City\\Major \hfill 2010 -- 2012
\item{Name of Grad School}\hfill City\\Major \hfill 2010 -- 2012
\end{itemize}
\noindent New commands:
\begin{packed-itemize}
\ressubheading{Name of Grad School}{City}{Major}{2010 -- 2012}
\ressubheading{Name of Grad School}{City}{Major}{2010 -- 2012}
\end{packed-itemize}
\noindent
Some text.
\end{document}
我已将环境名称更改为 以packed-itemize
避免出现符号,在我看来,该符号总是表示某种数学。此外,还更改了后面_
的添加,以防止如果以方括号 开头则出现令人讨厌的意外。\relax
\\
#3
[
一般来说,通过以下方式定义修改后的列表环境更容易enumitem
包裹。您的示例将使用:
\usepackage{enumitem}
\newlist{packed-itemize}{itemize}{1}
\setlist[packed-itemize]{leftmargin=15pt,label=\textbullet}
\newcommand{\ressubheading}[4]{\item \textbf{#1}\hfill #2\relax\\\relax #3
\hfill #4}