\documentclass[letterpaper,11pt]{article}
%-----------------------------------------------------------
\usepackage[empty]{fullpage}
\usepackage{color}
\definecolor{mygrey}{gray}{0.80}
\raggedbottom
\raggedright
\setlength{\tabcolsep}{0in}
% Adjust margins to 0.5in on all sides
\addtolength{\oddsidemargin}{-0.5in}
\addtolength{\evensidemargin}{-0.5in}
\addtolength{\textwidth}{1.0in}
\addtolength{\topmargin}{-0.5in}
\addtolength{\textheight}{1.0in}
%-----------------------------------------------------------
%Custom commands
\newcommand{\resitem}[1]{\item #1 \vspace{-2pt}}
\newcommand{\resheading}[1]{{\large \colorbox{mygrey}{\begin{minipage}{\textwidth}{\textbf{#1 \vphantom{p\^{E}}}}\end{minipage}}}}
\newcommand{\ressubheading}[4]{
\begin{tabular*}{7.0in}{l@{\extracolsep{\fill}}r}
\textbf{#1} & #2 \\
\textit{#3} & \textit{#4} \\
\end{tabular*}\vspace{-6pt}}
%-----------------------------------------------------------
\begin{document}
\begin{tabular*}{7.5in}{l@{\extracolsep{\fill}}r}
\textbf{\large Name} & Phone Number \\
address & email \\
township, state zip code& website\\
\end{tabular*}
\\
\vspace{0.1in}
\resheading{Education}
\begin{itemize}
\item
\ressubheading{University}{address}{degree}{grad date}
\end{itemize}
\resheading{Personal Projects}
\begin{itemize}
\item
\ressubheading{Project 1}{address}{extra line}{date}
\begin{itemize}
\resitem{}
\resitem{}
\end{itemize}
\item
\ressubheading{Project 2}{address}{extra line}{date}
\begin{itemize}
\resitem{}
\resitem{}
\end{itemize}
\item
\ressubheading{Project 3}{address}{extra line}{date}
\begin{itemize}
\resitem{}
\resitem{}
\end{itemize}
\item
\ressubheading{Project 4}{address}{extra line}{date}
\begin{itemize}
\resitem{}
\resitem{}
\end{itemize}
\end{itemize}
\resheading{Skills}
\begin{description}
\item[Languages:]
\item[Miscellaneous:]
\end{description}
\resheading{Open Source Projects}
\end{document}
使用我在网上找到的由 David Grant 原创的模板。
我试图将项目要点与个人项目部分和教育部分中的每个项目标题对齐,同时删除项目标题下方的“多余行”。当我手动删除项目标题下方的多余行时,空格仍然留在那里,并且破折号看起来没有对齐。我还想删除项目部分右侧对齐的地址和日期。我该怎么做呢?
感谢您的帮助!
答案1
第一个启动器,将条目与项目符号对齐,并删除条目的address
和date
字段project
。
我没有解决操纵页面几何参数的问题。
alignment
条目和提供的项目符号可以\item
用\begin{tabularx}{\linewidth}[t]{...}
--[t]
参数表示对齐,省略时top
与标准对齐相反!center
address
在相关调用中,和字段date
可以留空——如果\ressubheading
需要更改更多出现的情况,最好使用不同的命令。
灰色标题下方的间距不是由灰色标题引起的——它是值的原因\topsep
——itemize
之前的垂直间距和enumerate
在或环境之后itemize
。顶部和底部的值相同!使用enumitem
包可以将其更改为任何值,例如\setlist[itemize]{topsep=6pt}
。
\documentclass[letterpaper,11pt]{article}
%-----------------------------------------------------------
\usepackage[empty]{fullpage}
\usepackage{xcolor}
\usepackage{tabularx}
\definecolor{mygrey}{gray}{0.80}
\raggedbottom
\raggedright
\setlength{\tabcolsep}{0in}
% Adjust margins to 0.5in on all sides
\addtolength{\oddsidemargin}{-0.5in}
\addtolength{\evensidemargin}{-0.5in}
\addtolength{\textwidth}{1.0in}
\addtolength{\topmargin}{-0.5in}
\addtolength{\textheight}{1.0in}
%-----------------------------------------------------------
%Custom commands
\newcommand{\resitem}[1]{\item #1 \vspace{-2pt}}
\newcommand{\resheading}[1]{%
{\large \colorbox{mygrey}{\begin{minipage}{\textwidth}{\textbf{#1 \vphantom{p\^{E}}}}\end{minipage}}}%
}
\newcommand{\ressubheading}[4]{
\begin{tabularx}{\linewidth}[t]{l@{\extracolsep{\fill}}r}
\textbf{#1} & #2 \\
\textit{#3} & \textit{#4} \\
\end{tabularx}\vspace{-6pt}}
%-----------------------------------------------------------
\usepackage{enumitem}% For \setlist...
\setlist[itemize]{topsep=6pt}% Change for all levels of itemize!
\begin{document}
\begin{tabular*}{7.5in}{l@{\extracolsep{\fill}}r}
\textbf{\large Name} & Phone Number \\
address & email \\
township, state zip code& website\\
\end{tabular*}
\\
\vspace{0.1in}
\resheading{Education}
\begin{itemize}
\item \ressubheading{University}{address}{degree}{grad date}
\end{itemize}
\resheading{Personal Projects}
\begin{itemize}
\item
\ressubheading{Project 1}{}{extra line}{}
\begin{itemize}
\resitem{}
\resitem{}
\end{itemize}
\item
\ressubheading{Project 2}{}{extra line}{}
\begin{itemize}
\resitem{}
\resitem{}
\end{itemize}
\item
\ressubheading{Project 3}{}{extra line}{}
\begin{itemize}
\resitem{}
\resitem{}
\end{itemize}
\item
\ressubheading{Project 4}{}{extra line}{}
\begin{itemize}
\resitem{}
\resitem{}
\end{itemize}
\end{itemize}
\resheading{Skills}
\begin{description}
\item[Languages:]
\item[Miscellaneous:]
\end{description}
\resheading{Open Source Projects}
\end{document}
更新一些更干净的版本
- 切换到
geometry
包 - 使用
X
列类型 - 添加了一些长度参数,以便精细控制子标题上方和之后的间距
- 使用
tcolorbox
灰色标题的环境
关于箱子过满的警告现在已经消失了
\documentclass[letterpaper,11pt]{article}
%-----------------------------------------------------------
\usepackage{xcolor}
\usepackage{tabularx}
\usepackage{array}
\usepackage{enumitem}
\usepackage[lmargin=0.5in,rmargin=0.5in,tmargin=0.5in,showframe]{geometry}
\usepackage[most]{tcolorbox}
% Defining a right aligned stretchable R - columntype
\newcolumntype{R}{>{\raggedleft\arraybackslash}X}
% Defining colour(s)
\definecolor{mygrey}{gray}{0.80}
% Geometry and length settings
\parindent=0em
\newlength{\ressubheadingbeforeskip}
\setlength{\ressubheadingbeforeskip}{0pt}
\newlength{\ressubheadingafterskip}
\setlength{\ressubheadingafterskip}{-6pt}
\newlength{\projectheadingbeforeskip}
\setlength{\projectheadingbeforeskip}{0pt}
\newlength{\projectheadingafterskip}
\setlength{\projectheadingafterskip}{-6pt}
%-----------------------------------------------------------
%Custom commands
\newcommand{\resitem}[1]{\item #1 \vspace{-2pt}}
\newcommand{\resheading}[2][]{%
\begin{tcolorbox}[enhanced jigsaw,
boxrule=0pt,
left=\tabcolsep,
boxsep=0pt,
sharp corners,
colback=mygrey,
fontupper=\bfseries\large,
nobeforeafter,
after={\vspace{-0.5\baselineskip}},
#1%
]
#2\vphantom{p\^{E}}%
\end{tcolorbox}%
}
\newcommand{\ressubheading}[4]{%
\vspace{\ressubheadingbeforeskip}%
\begin{tabularx}{\linewidth}[t]{lR}
\textbf{#1} & #2 \tabularnewline
\textit{#3} & \textit{#4} \tabularnewline
\end{tabularx}%
\vspace{\ressubheadingafterskip}
}
\newcommand{\projectsubheading}[1]{%
\vspace{\projectheadingbeforeskip}%
\begin{tabularx}{\linewidth}[t]{lR}
\textbf{#1} &
\end{tabularx}%
\vspace{\projectheadingafterskip}%
}
% -----------------------------------------------------------
% Some possible changes to the settings of itemize
\setlist[itemize,1]{itemsep=5pt}% 1st level
\setlist[itemize,2]{topsep=5pt}% 2nd level
% Empty page
\pagestyle{empty}
\begin{document}
\begin{tabularx}{\linewidth}{lR}
\textbf{\large Name} & Phone Number \\
address & email \\
township, state zip code& website\\
\end{tabularx}%
\medskip
\resheading{Education}
\begin{itemize}
\item \ressubheading{University}{address}{degree}{grad date}
\end{itemize}
\resheading{Personal Projects}
\begin{itemize}
\item \projectsubheading{Project 1}
\begin{itemize}
\resitem{}
\resitem{}
\end{itemize}
\item \projectsubheading{Project 2}
\begin{itemize}
\resitem{}
\resitem{}
\end{itemize}
\item \projectsubheading{Project 3}
\begin{itemize}
\resitem{}
\resitem{}
\end{itemize}
\item \projectsubheading{Project 4}
\begin{itemize}
\resitem{}
\resitem{}
\end{itemize}
\end{itemize}
\resheading{Skills}
\begin{description}
\item[Languages:]
\item[Miscellaneous:]
\end{description}
\resheading[colback=white!40!yellow,boxrule=2pt]{Open Source Projects}
\end{document}
查看可选参数,了解\resheading
如何更改框的设置。
删除showframe
摆脱框架的选项——它只是为了显示边界是正确的。