2

Honestly, I'm trying to edit a CV template to fit my need. I could not figure out how to make the line "Department ..." aligned with "CONTACT".

Please help me solve this problem! Thank you so much!

%%%%%%%%%%%%%%%%%%%%%%%%%%%% 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{tpuzia@astro.puc.cl}\\
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}

enter image description here

PS: I used this template ...

  • Since this is your sixth question, I think we can expect you to provide an MWE with your question. Your code is neither working nor minimal. Also, I have to say, your template does not look very tidy. Maybe a class like moderncv would be better suited for you? That said, your problem can easily be fixed by removing a blank line. Try making an MWE and you will find it immediately. – schtandard Jul 30 at 16:05
  • \halfblankline is undefined. If two lines containing \halfblankline are commented out, the code work fine for me. – ferahfeza Jul 30 at 16:08
3

Well, that template is not the best as it seems to me, but nevertheless ...

I corrected some errors you left in the code (for example the missing definition of \email or \halfblankline; see marked code with <========= for important code changings ...). But the culprit you have lies in the following lines:

\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:tpuzia@astro.puc.cl}{tpuzia@astro.puc.cl}\\
Santiago, Chile    & \textit{WWW:}
\href{http://www.astro.puc.cl/$\sim$tpuzia/}{www.astro.puc.cl}\\
\end{tabular}

Your tabular will be added at the same height your \section before ends.

To get rid of that you can do the following quick workaround, simmply add:

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

before you start your table (that moves your table above the space for one line).

Please see the following complete compiling (;-)) code:

\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:tpuzia@astro.puc.cl}{tpuzia@astro.puc.cl}\\ % <=============================================
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}

and see its resulting pdf:

resulting pdf

  • Change {\bf Social Network} to \textbf{Social Network}, old command \bf is outdated ... – Mensch Jul 30 at 19:04
  • 1
    I'm grateful for your detailed answer. Many thanks for your dedicated support ;) – Abstract Analysis Jul 31 at 0:39
  • 1
    @LeAnhDung You are welcome! – Mensch Jul 31 at 0:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.