两列中的两行未对齐

两列中的两行未对齐

说实话,我正在尝试编辑简历模板以满足我的需求。我不知道如何让“部门...”与“联系人”对齐。

请帮我解决这个问题!非常感谢!

%%%%%%%%%%%%%%%%%%%%%%%%%%%% Document Setup %%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Don't like 10pt? Try 11pt or 12pt
\documentclass[10pt]{article}

% This is a helpful package that puts math inside length specifications
\usepackage{calc}
\usepackage{pifont}
\usepackage{marvosym}
\usepackage{amsmath, amsthm, amssymb, amsfonts}   

% Simpler bibsection for CV sections
% (thanks to natbib for inspiration)
\makeatletter
\newlength{\bibhang}
\setlength{\bibhang}{1em}
\newlength{\bibsep}
 {\@listi \global\bibsep\itemsep \global\advance\bibsep by\parsep}
\newenvironment{bibsection}%
        {\begin{list}{}{%
       \setlength{\leftmargin}{\bibhang}%
       \setlength{\itemindent}{-\leftmargin}%
       \setlength{\itemsep}{\bibsep}%
       \setlength{\parsep}{\z@}%
        \setlength{\partopsep}{0pt}%
        \setlength{\topsep}{0pt}}}
        {\end{list}\vspace{-.6\baselineskip}}
\makeatother

% Layout: Puts the section titles on left side of page
\reversemarginpar   

% Use these lines for A4-sized paper
\usepackage[paper=a4paper,
            %includefoot, % Uncomment to put page number above margin
            marginparwidth = 24mm,    % Length of section titles
            marginparsep = 10mm,       % Space between titles and text
            left = 22mm,              % 25mm margins
            right = 22mm, 
            includemp]{geometry}

%% More layout: Get rid of indenting throughout entire document
\setlength{\parindent}{0in}

%% This gives us fun enumeration environments. compactitem will be nice.

\usepackage[shortlabels]{enumitem}

%% Reference the last page in the page number
%
% NOTE: comment the +LP line and uncomment the -LP line to have page
%       numbers without the ``of ##'' last page reference)
%
% NOTE: uncomment the \pagestyle{empty} line to get rid of all page
%       numbers (make sure includefoot is commented out above)
%
\usepackage{fancyhdr,lastpage}
\pagestyle{fancy}
%\pagestyle{empty}      % Uncomment this to get rid of page numbers
\fancyhf{}\renewcommand{\headrulewidth}{0pt}
\fancyfootoffset{\marginparsep+\marginparwidth}
\newlength{\footpageshift}
\setlength{\footpageshift}
          {0.5\textwidth+0.5\marginparsep+0.5\marginparwidth-2in}
\lfoot{\hspace{\footpageshift}%
       \parbox{4in}{\, \hfill %
                    \arabic{page} of \protect\pageref*{LastPage} % +LP
%                    \arabic{page}                               % -LP
                    \hfill \,}}      

%%%%%%%%%%%%%%%%%%%%%%%%%%% Helper Commands %%%%%%%%%%%%%%%%%%%%%%%%%%%%

% The title (name) with a horizontal rule under it
%
% Usage: \makeheading{name}
%
% Place at top of document. It should be the first thing.
\newcommand{\makeheading}[2][]%
        {\hspace*{-\marginparsep minus \marginparwidth}%
         \begin{minipage}[t]{\textwidth+\marginparwidth+\marginparsep}%
             {\large \bfseries #2 \hfill #1}\\[-0.15\baselineskip]%
                 \rule{\columnwidth}{0.5pt}%
         \end{minipage}}
% The section headings
%
% Usage: \section{section name}
%
% Follow this section IMMEDIATELY with the first line of the section
% text. Do not put whitespace in between. That is, do this:
%
%       \section{My Information}
%       Here is my information.
%
% and NOT this:
%
%       \section{My Information}
%
%       Here is my information.
%
% Otherwise the top of the section header will not line up with the top
% of the section. Of course, using a single comment character (%) on
% empty lines allows for the function of the first example with the
% readability of the second example.
\renewcommand{\section}[2]%
        {\pagebreak[2]\vspace{1\baselineskip}%
         \phantomsection\addcontentsline{toc}{section}{#1}%
         \hspace{0in}%
         \marginpar{
         \raggedright \scshape #1}#2}

% An itemize-style list with lots of space between items
\usepackage{pifont}
\setlist[itemize]{leftmargin=*}
\newenvironment{outerlist}[1][\enskip\textbullet]%
        {\begin{itemize}[\ding{113}]}
        {\end{itemize}%
         \vspace{-0.6\baselineskip}}



%%%%%%%%%%%%%%%%%%%%%%%% End Helper Commands %%%%%%%%%%%%%%%%%%%%%%%%%%%

%%%%%%%%%%%%%%%%%%%%%%%%% Begin CV Document %%%%%%%%%%%%%%%%%%%%%%%%%%%%

%\hyphenpenalty = 9999
\def\vs{\vspace{-0.1in}}
\begin{document}

\makeheading{Le Anh Dung -- Curriculum Vitae \hfill {\small Last update: July 29, 2019}}

\halfblankline

\halfblankline

%% =======================================
\section{Contact Information}

% NOTE: Mind where the & separators and \\ breaks are in the following
%       table.
%
% ALSO: \rcollength is the width of the right column of the table
%       (adjust it to your liking; default is 1.85in).
%
\newlength{\rcollength}\setlength{\rcollength}{2.20in}%
%
\begin{tabular}[t]{@{}p{\textwidth-\rcollength}p{\rcollength}}
\href{http://www.cse.osu.edu/}%
     {Department of Astronomy and Astrophysics} & \\
\href{http://www.astro.puc.cl/}{Pontificia Universidad Catolica de Chile}
                           & \textit{Phone:} +56-2-354-1645 \\
4860 Avenida Vicu\~{n}a Mackenna            & \textit{Fax:} +1-509-461-2250 \\
7820436, Macul           & \textit{E-mail:} \email{[email protected]}\\
Santiago, Chile    & \textit{WWW:}
\href{http://www.astro.puc.cl/$\sim$tpuzia/}{www.astro.puc.cl}\\
\end{tabular}

%% ==============================================================
\vspace{0.2in}
\section{Research Background} % (fold)
\label{sec:research_backg}
\vspace{-0.25in}
\begin{outerlist}
  \item {\bf Social Network}: more descriptions here.
  \item {\bf Advanced Vietnamese:} descriptions.
\end{outerlist}
% section research_backg (end)
\end{document}

在此处输入图片描述

附言:我用的是这个模板...

答案1

嗯,在我看来那个模板不是最好的,但是尽管如此......

我纠正了你留在代码中的一些错误(例如缺少\email或的定义\halfblankline;请参阅用标记的代码以<=========了解重要的代码更改...)。但罪魁祸首在于以下几行:

\section{Contact Information}
\newlength{\rcollength}\setlength{\rcollength}{2.20in}%

\begin{tabular}[t]{@{}p{\textwidth-\rcollength}p{\rcollength}}
\href{http://www.cse.osu.edu/}%
     {Department of Astronomy and Astrophysics} & \\
\href{http://www.astro.puc.cl/}{Pontificia Universidad Catolica de Chile}
                           & \textit{Phone:} +56-2-354-1645 \\
4860 Avenida Vicu\~{n}a Mackenna            & \textit{Fax:} +1-509-461-2250 \\
7820436, Macul           & \textit{E-mail:} \href{mailto:[email protected]}{[email protected]}\\
Santiago, Chile    & \textit{WWW:}
\href{http://www.astro.puc.cl/$\sim$tpuzia/}{www.astro.puc.cl}\\
\end{tabular}

您的高度将被添加到与之前tabular相同的高度\section结束

为了摆脱这个问题,您可以采取以下快速解决方法,只需添加:

\vspace{-\baselineskip} % <=============================================

在开始表格之前(将表格移动到一行以上的空间)。

请参阅以下完整的编译(;-))代码:

\documentclass[10pt]{article}

% This is a helpful package that puts math inside length specifications
\usepackage{calc}
\usepackage{pifont}
\usepackage{marvosym}
\usepackage{amsmath, amsthm, amssymb, amsfonts}   

% Simpler bibsection for CV sections
% (thanks to natbib for inspiration)
\makeatletter
\newlength{\bibhang}
\setlength{\bibhang}{1em}
\newlength{\bibsep}
 {\@listi \global\bibsep\itemsep \global\advance\bibsep by\parsep}
\newenvironment{bibsection}%
        {\begin{list}{}{%
       \setlength{\leftmargin}{\bibhang}%
       \setlength{\itemindent}{-\leftmargin}%
       \setlength{\itemsep}{\bibsep}%
       \setlength{\parsep}{\z@}%
        \setlength{\partopsep}{0pt}%
        \setlength{\topsep}{0pt}}}
        {\end{list}\vspace{-.6\baselineskip}}
\makeatother

% Layout: Puts the section titles on left side of page
\reversemarginpar   

% Use these lines for A4-sized paper
\usepackage[paper=a4paper,
            %includefoot, % Uncomment to put page number above margin
            marginparwidth = 24mm,    % Length of section titles
            marginparsep = 10mm,       % Space between titles and text
            left = 22mm,              % 25mm margins
            right = 22mm, 
            includemp]{geometry}

%% More layout: Get rid of indenting throughout entire document
\setlength{\parindent}{0in}

%% This gives us fun enumeration environments. compactitem will be nice.

\usepackage[shortlabels]{enumitem}

%% Reference the last page in the page number
%
% NOTE: comment the +LP line and uncomment the -LP line to have page
%       numbers without the ``of ##'' last page reference)
%
% NOTE: uncomment the \pagestyle{empty} line to get rid of all page
%       numbers (make sure includefoot is commented out above)
%
\usepackage{fancyhdr,lastpage}
\pagestyle{fancy}
%\pagestyle{empty}      % Uncomment this to get rid of page numbers
\fancyhf{}\renewcommand{\headrulewidth}{0pt}
\fancyfootoffset{\marginparsep+\marginparwidth}
\newlength{\footpageshift}
\setlength{\footpageshift}
          {0.5\textwidth+0.5\marginparsep+0.5\marginparwidth-2in}
\lfoot{\hspace{\footpageshift}%
       \parbox{4in}{\, \hfill %
                    \arabic{page} of \protect\pageref*{LastPage} % +LP
%                    \arabic{page}                               % -LP
                    \hfill \,}}      


%%%%%%%%%%%%%%%%%%%%%%%%%%% Helper Commands %%%%%%%%%%%%%%%%%%%%%%%%%%%%

% The title (name) with a horizontal rule under it
%
% Usage: \makeheading{name}
%
% Place at top of document. It should be the first thing.
\newcommand{\makeheading}[2][]%
        {\hspace*{-\marginparsep minus \marginparwidth}%
         \begin{minipage}[t]{\textwidth+\marginparwidth+\marginparsep}%
             {\large \bfseries #2 \hfill #1}\\[-0.15\baselineskip]%
                 \rule{\columnwidth}{0.5pt}%
         \end{minipage}}
% The section headings
%
% Usage: \section{section name}
%
% Follow this section IMMEDIATELY with the first line of the section
% text. Do not put whitespace in between. That is, do this:
%
%       \section{My Information}
%       Here is my information.
%
% and NOT this:
%
%       \section{My Information}
%
%       Here is my information.
%
% Otherwise the top of the section header will not line up with the top
% of the section. Of course, using a single comment character (%) on
% empty lines allows for the function of the first example with the
% readability of the second example.
\renewcommand{\section}[2]%
        {\pagebreak[2]\vspace{1\baselineskip}%
         \phantomsection\addcontentsline{toc}{section}{#1}%
         \hspace{0in}%
         \marginpar{
         \raggedright \scshape #1}#2}

% An itemize-style list with lots of space between items
\usepackage{pifont}
\setlist[itemize]{leftmargin=*}
\newenvironment{outerlist}[1][\enskip\textbullet]%
        {\begin{itemize}[\ding{113}]}
        {\end{itemize}%
         \vspace{-0.6\baselineskip}}



%%%%%%%%%%%%%%%%%%%%%%%% End Helper Commands %%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{hyperref}

%%%%%%%%%%%%%%%%%%%%%%%%% Begin CV Document %%%%%%%%%%%%%%%%%%%%%%%%%%%%

%\hyphenpenalty = 9999
\def\vs{\vspace{-0.1in}}
\def\halfblankline{\vspace{0.1in}} % <==================================


\begin{document}

\makeheading{Le Anh Dung -- Curriculum Vitae \hfill {\small Last update: July 29, 2019}}

%\halfblankline

%\halfblankline

%% =======================================
\section{Contact Information}
\newlength{\rcollength}\setlength{\rcollength}{2.20in}%
\vspace{-\baselineskip} % <=============================================
\begin{tabular}[t]{@{}p{\textwidth-\rcollength}p{\rcollength}}
\href{http://www.cse.osu.edu/}%
     {Department of Astronomy and Astrophysics} & \\
\href{http://www.astro.puc.cl/}{Pontificia Universidad Catolica de Chile}
                           & \textit{Phone:} +56-2-354-1645 \\
4860 Avenida Vicu\~{n}a Mackenna            & \textit{Fax:} +1-509-461-2250 \\
7820436, Macul           & \textit{E-mail:} \href{mailto:[email protected]}{[email protected]}\\ % <=============================================
Santiago, Chile    & \textit{WWW:}
\href{http://www.astro.puc.cl/$\sim$tpuzia/}{www.astro.puc.cl}\\
\end{tabular}

%% ==============================================================
\vspace{0.2in}
\section{Research Background} % (fold)
\label{sec:research_backg}
\vspace{-0.25in}
\begin{outerlist}
  \item {\bf Social Network}: more descriptions here.
  \item {\bf Advanced Vietnamese:} descriptions.
\end{outerlist}
% section research_backg (end)
\end{document}

并查看其生成的 pdf:

生成的 pdf

相关内容