1

I particularly appreciate a style of title used for a CV got online (see following image) and I am trying to reproduce it in my LaTeX CV. enter image description here

Here follows my MWE (it's the actual version of my first page CV). Compiler: XeLaTeX.

\documentclass[11 pt,oneside,a4paper,titlepage]{article}

%%% PREAMBLE (start) %%% % Info \title{My CV} \usepackage[most]{tcolorbox} \usepackage{geometry} \geometry{ a4paper, left=0.1cm, % left=0.1cm right=0.6cm, % right=0.6cm top=0.5cm, % top=0.1cm bottom=1.2cm, % bottom=0.1cm includefoot, headheight=2.5cm, % needed to avoid warnings with fancyhdr package showframe=false }

\usepackage{lipsum} % dummy text \usepackage{adjustbox} % to a better alignement of text

% Headers and footers \usepackage{fancyhdr} %\setlength{\headheight}{12.6pt} \usepackage{lastpage}

% Fonts \usepackage[TU]{fontenc} \usepackage{fourier-otf} \usepackage{xspace} \usepackage{microtype} %it helps to fit text inside margins) \usepackage[en-AU]{datetime2} \usepackage{csquotes}

% Tables \usepackage{multirow}

% to have awesome icon \usepackage{fontawesome5} \usepackage{academicons}

% advanced drawing \usepackage{tikz} \usepackage{tikz-3dplot} \usepackage{smartdiagram} \usepackage{float} \usepackage{array} \usetikzlibrary{decorations.text} \usetikzlibrary{fadings} \usetikzlibrary{calc} \usetikzlibrary{shapes.misc,positioning} \usetikzlibrary{arrows} \usetikzlibrary{arrows.meta} \usetikzlibrary{backgrounds} \usetikzlibrary{shadings} \usetikzlibrary{calendar} \usetikzlibrary{er} \usetikzlibrary{patterns} \usetikzlibrary{shapes} \usetikzlibrary{shapes.geometric} \usetikzlibrary{decorations} \usetikzlibrary{topaths} \usepackage{graphicx}

% set TikZ styles \tikzset{ contactIcon/.style={% minimum height=\baselineskip, } }

% pictures \usepackage{graphicx} % loads graphicx, provides align=c option for vertical alignment w.r.t. text \RequirePackage{graphbox}

\newcommand{\roundpic}[1]{\begin{figure}[H]\tikz \draw [path picture={ \node at (path picture bounding box.center){\includegraphics[height=3cm]{#1}} ;}] (0,2) circle (1.7) ;\end{figure}}

% more advanced expressions in \setlength \usepackage{calc}

% Define Colors \RequirePackage{xcolor} \definecolor{titleBackColor}{RGB}{25,20,60} \definecolor{sideBarColor}{rgb}{0.6,0.6,0.6} \definecolor{mydarkblue}{rgb}{0.07,0.08,0.4} \definecolor{myblue}{rgb}{.4,.4,1} \definecolor{myyellow}{RGB}{245,169,34}

% Lists \usepackage{enumitem} \setlist{leftmargin=*,nosep}

% Define Lengths \newlength\cvPictureWidth \setlength\cvPictureWidth{4cm} \newlength\SidebarTextWidth \setlength\SidebarTextWidth{7cm} \newlength\leftSideSecWidth \setlength\leftSideSecWidth{2cm} \newlength\rightSideSecWidth \setlength\rightSideSecWidth{9cm} \newlength\SecVertSpace \setlength\SecVertSpace{0.4cm}

% avoid line overflow % \setlength{\emergencystretch}{2pt}

% CV tag for skills \newcommand{\cvtag}[1]{% \tikz[baseline]\node[anchor=base,draw=black!30,rounded corners,inner xsep=1ex,inner ysep =0.75ex,text height=1.5ex,text depth=.25ex]{\footnotesize #1}; }

% top box with simple header \newcommand{\simpleheader}[5]{ \tikz[remember picture,overlay] {% \node[rectangle, fill=#1, anchor=north, minimum width=\paperwidth, minimum height=3.3cm] (header) at (current page.north){};% height=3.5cm \nodedraw=none, align=left at (header) {% {\Huge \color{#5} \MakeUppercase{#2} \MakeUppercase{#3} }%\textbf{#3} };% \nodedraw=none, below at (name.south) {\color{white}#4};% }\vspace{-0.7cm} %\vspace{-0.7cm} }

% SideBar \newcommand{\sidebar}[1]{ \tikz[remember picture,overlay] {% \noderectangle, fill=#1, anchor=north west, minimum width=8.3cm, minimum height=\textheight at (current page.north west){};% } }

% Flag for Languages section and for all small personal icons \newcommand{\flag}[1]{\includegraphics[align=c, width=1em]{#1}} \newcommand{\TitleIcon}[1]{\includegraphics[align=c, scale=0.05]{#1}}

% Command for section title \newcommand{\MySectionTitle}[3]{% inputs: #1: icon, #2: title \begin{tikzpicture}[remember picture,overlay]
% \draw [help lines] (0,0) grid (5,-2);
\node[font = {\Large},circle,fill=myyellow, minimum size = 1cm] (c) at (0.5,-1){\color{titleBackColor} #1};

    \draw[myyellow, ultra thick] (c.0) -- (\textwidth,-1); % draw of horizontal line

    \node at (4.0,-.66) {\bf \Large \raggedright \color{titleBackColor}\MakeUppercase{#2}}; % original: \node at (4.8,-.66)

\end{tikzpicture} \vspace{1.6cm}

}

% Command for Education and Works \newcommand{\MySection}[7]{ % input: years, logo, title, university, city, specialization, description \adjustbox{valign=t}{\begin{minipage}{\leftSideSecWidth} \begin{flushleft} %original alignment:center {\small #1} \ %years \vspace*{0.1cm} \includegraphics[width=1.2cm]{#2} %logo \end{flushleft} \end{minipage}} \hspace{0.1cm} \hfill %\vline %\hfill \adjustbox{valign=t}{\begin{minipage}{\rightSideSecWidth} %9cm {\normalsize\bfseries #3} %title \hfill {\footnotesize \faMapMarker ~ #5} % city \newline {\small\bfseries \textsc{#4}} %university \newline \small {\emph{#6}} %specialization %\newline %originally not commented \footnotesize {#7} %description \end{minipage}} }

% % ITC section (customized) % \newcommand{\ITCskill}[4]{\raisebox{-0.7\height}{\includegraphics[height=0.6cm]{#1}} & \footnotesize \textbf{#2}\newline{\footnotesize #3}\vspace{0.5em} &\multirow{2}*{\footnotesize #4}} %height=0.5cm

% Format of the title section in the side column % based on https://tex.stackexchange.com/questions/65731 \makeatletter \def\cv@hrulefill{{\color{titleBackColor}\leavevmode\leaders\hrule height 1pt\hfill\kern\z@}} % line before and after text (some tweaking is required here) % based on https://tex.stackexchange.com/questions/15119 \NewDocumentCommand{\ruleline}{m}{\par\noindent\raisebox{\baselineskip/4}{\makebox[\linewidth]{\cv@hrulefill\hspace{1ex}\raisebox{-\baselineskip/4}{\large #1}\hspace{1ex}\cv@hrulefill}}\vspace*{0.05cm}} \makeatother

\usepackage{titlesec} % Allows creating custom \sections

% Format of the section titles \titleformat{\section}{ \bf \Large\raggedright}{}{0em}{}[\titlerule] % smallcaps, Large, continuous line - looks better if two columns, might look a bit too dramatic if just one ;) \titlespacing{\section}{0pt}{12pt}{5pt} % Spacing around titles {<left spacing>}{<before spacing>}{<after spacing>}

% Multiple Column Package \usepackage{multicol}

%%% PREAMBLE (end) %%%

% DOCUMENT \begin{document}

%%% Footer \pagestyle{fancy} \renewcommand{\footrulewidth}{0.4pt} \fancyfoot[C]{\small \textcolor{black}{\footnotesize I hereby authorize the processing of the personal data contained in this CV in compliance with the European Regulation (UE) 2016/679.\ \small \textcolor{black}{Page \thepage \hspace{1pt} of \pageref{LastPage}}}}

% Side bar \sidebar{sideBarColor!25} \simpleheader{titleBackColor}{Name}{Surname}{xxxxxxxx Engineer \hspace{0.1cm} \TitleIcon{example-image-c}}{white}

% Left-side page \vspace{3.0cm} \adjustbox{valign=t}{\begin{minipage}{7cm} %Picture \begin{center} \begin{tikzpicture} \node[ circle, minimum size=\cvPictureWidth, path picture={ \node at (path picture bounding box.center){ \includegraphics[width=\cvPictureWidth]{example-image-b} }; }] {}; \end{tikzpicture} \end{center} \section{Side bar} \lipsum[1-2]
\end{minipage}} % \hfill % Right-side page \adjustbox{valign=t}{\begin{minipage}{11.6cm} %11.3cm \vspace*{1cm} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Work Experience \MySectionTitle{\faSuitcase}{Work Experience}

\MySection{Feb.--Mar. 20XX}{example-image-a}{Role}{University name}{Rome, ITA}{Aerospace Engineering}{\newline \lipsum[2]}

\vspace*{\SecVertSpace} 

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%\section*{\color{titleBackColor}{{\faGraduationCap} EDUCATION}} %OLD Style
\MySectionTitle{\faGraduationCap}{Education}

\MySection{20XX--20XX}{example-image-a}{Master's Degree}{University of}{Rome, Italy}{Aerospace Engineering}{\begin{itemize}
    \item Thesis title
    \item Graduation grade: \textbf{XXX/110}
\end{itemize}   
}

\vspace*{0.22cm}

\MySection{20XX--20XX}{example-image-b}{Bachelor's Degree}{University of Rome}{Rome, Italy}{Aerospace Engineering}{
\begin{itemize}
    \item Final report title
    \item Graduation grade: \textbf{XXX/110}
\end{itemize}
}

\vspace*{0.22cm}

\MySection{20XX--20XX}{example-image-c}{High School Diploma}{School name}{Rome}{school type}{
\begin{itemize}
    \item Diploma grade: \textbf{XXX/100} 
\end{itemize} 
}

\vspace*{\SecVertSpace}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\MySectionTitle{\faBook}{Academic Projects}

\begin{itemize}
    \footnotesize
     \item \lipsum[2]
     \item \lipsum[2]
\end{itemize}

\end{minipage}} %

\end{document}

The image below shows the result. enter image description here

Can you help me with the following points? I need to:

  1. align the section title with the text below (see the first two red segments);
  2. ensure that all the section titles have the same distance with respect to the icon (the issue in my case is that I got a bad alignment depending on the title length)

P.s. This CV template is a customized version of a freely available template on Overleaf website: CV template

g_don
  • 779

1 Answers1

1

Please improve your question as lined out in the comments


Second post:

Taking into account your remarks in the comments a number of things needed to be improved in your code. Let's work backwards.

What you may want to arrive at is cleaner code within the documents content, like this, where:

  • you can pass the "icon"
  • put all your information parameter by parameter
    \qualif{\faSuitcase}
            {work experiences}
            {Feb.--Mar. 2021}
            {Visiting Researcher}
            {Sapienza University}
            {Rome, ITALY}
            {Space Engineering}
            {\lipsum[4]}
\qualif{\faUniversity}
        {education}
        {Apr.--Dec. 2020}{Student}
        {Florence University}
        {Florence, ITALY}
        {Space Engineering}
        {\lipsum[3]}

So, how is \qualif defined? It basically calls your drawing and your \MySection. BUT, as you can see, you need to enter a % right at the end of each line, i.e. WITHOUT further spaces, to avoid inserting unwanted spaces when Latex expands the macro(s).

However, as indicated, your layout will break when removing one specific empty line. Just try it.

Positioning the node holding your text was a bit tricky. You need to:

  • specify a text width (you may want more than 5cm)
  • to make any align statement for tikz effective
  • so you can finally adjust the node / the text horizontally
% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
% let's move all formatting for qualitfications here
% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
\newcommand\qualif[8]{% max 9 parameters !
    \begin{tikzpicture}[remember picture,overlay]% '%' are vital in macros! (dangling space issues)
        \draw [help lines] (0,0) grid (5,-2);%
    \node[font = {\Large},circle,fill=orange, minimum size = 1cm]%
        (c) at (0.5,-1){#1};% &lt;&lt;&lt; NEW   
    \draw[orange, thick] (c.0) -- (\textwidth,-1); % &lt;&lt;&lt; NEW (Q3)
    \node at (5.15,-.8) [align=left,text width=5cm]  {\MakeUppercase{#2}};%\MakeUppercase{#2}};% &lt;&lt;&lt; (Q2) almost    
\end{tikzpicture}%

%
\vspace{1.5cm}% !!! the next empty line is needed: else the layout breaks

\MySection{#3}{}{#4}{#5}{#6}{#7}{\newline #8}%

}

All in all it's quite fragile code, in my view. Bye.

result 2

\documentclass[11 pt,oneside,a4paper,titlepage]{article}

\usepackage{adjustbox} % to a better alignement of text \usepackage{geometry} \geometry{ a4paper, left=0.1cm, right=0.6cm, top=0.1cm, bottom=0.1cm, showframe=true }

\usepackage{lipsum} \usepackage{microtype}

% More defined colors \usepackage[dvipsnames]{xcolor}

% Required package \usepackage{tikz} %\usetikzlibrary{positioning} %\usepackage{tikzpagenodes} % not needed? \usepackage{fontawesome5}

% ~~~ Lengths ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \newlength\SidebarTextWidth \setlength\SidebarTextWidth{7cm} \newlength\leftSideSecWidth \setlength\leftSideSecWidth{2cm} \newlength\rightSideSecWidth \setlength\rightSideSecWidth{9cm}

% ~~~ Command for Education and Works ~~~~~~~~~~~~~~~~~~~~~~~~~ \newcommand{\MySection}[7]{% input: years, logo, title, university, city, specialization, description \adjustbox{valign=t}{\begin{minipage}{\leftSideSecWidth}% \begin{flushleft}% <<< CHANGED (Q1) {\small #1}\% years % \vspace*{0.1cm} % \includegraphics[width=1.2cm]{#2} %logo \end{flushleft}% \end{minipage}}% \hspace{0.1cm} \hfill%\vline %\hfill \adjustbox{valign=t}{\begin{minipage}{9.0cm}% {\normalsize\bfseries #3}%title \hfill {\footnotesize \faMapMarker ~ #5}% city \newline% {\small\bfseries \textsc{#4}}%university \newline% \small {\emph{#6}}% specialization %\newline %originally not commented \footnotesize {#7}% description \end{minipage}}% } % ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ % let's move all formatting for qualitfications here % ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \newcommand\qualif[8]{% max 9 parameters ! \begin{tikzpicture}[remember picture,overlay]% '%' are vital in macros! (dangling space issues) \draw [help lines] (0,0) grid (5,-2);%

    \node[font = {\Large},circle,fill=orange, minimum size = 1cm]%
        (c) at (0.5,-1){#1};% &lt;&lt;&lt; NEW   
    \draw[orange, thick] (c.0) -- (\textwidth,-1); % &lt;&lt;&lt; NEW (Q3)
    \node at (5.15,-.8) [align=left,text width=5cm]  {\MakeUppercase{#2}};%\MakeUppercase{#2}};% &lt;&lt;&lt; (Q2) almost    
\end{tikzpicture}%

%
\vspace{1.5cm}% !!! the next empty line is needed: else the layout breaks

\MySection{#3}{}{#4}{#5}{#6}{#7}{\newline #8}%

}

% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \begin{document}

% Left-side page \adjustbox{valign=t}{\begin{minipage}{7cm} \section*{Side bar} \lipsum[1-2]
\end{minipage}} % \hfill \adjustbox{valign=t}{% \begin{minipage}{11.6cm} %11.3cm
% <<< NEW COMMANDS

\qualif{\faSuitcase}
        {work experiences}
        {Feb.--Mar. 2021}
        {Visiting Researcher}
        {Sapienza University}
        {Rome, ITALY}
        {Space Engineering}
        {\lipsum[4]}

\qualif{\faUniversity}
        {education}
        {Apr.--Dec. 2020}{Student}
        {Florence University}
        {Florence, ITALY}
        {Space Engineering}
        {\lipsum[3]}

\end{minipage}}

\end{document}


First post:

Don't know if your approach is the best one, but here are answers to your 4 questions.

Q1: If that's what you wanted, switch from center to flushleft

        \begin{flushleft}% <<< CHANGED (Q1)
            {\small #1} \\ %years
            % \vspace*{0.1cm}
            % \includegraphics[width=1.2cm]{#2} %logo
        \end{flushleft}

Q2: rely on internal length already known

\draw[orange, thick] (c.0) -- (\textwidth,-1);  % <<< NEW (Q3)

Q3: with some restructuring (placing the text not in one go) and drawing the help grid, with some fine tuning left to you // it's a bit strange as (0,0) lies more to the left, above your sidebar ...

    \begin{tikzpicture}[remember picture,overlay]   
        \draw [help lines] (0,0) grid (5,-2);    
        \node[font = {\Large},circle,fill=orange, minimum size = 1cm] 
            (c) at (0.5,-1){\faSuitcase};   
        \draw[orange, thick] (c.0) -- (\textwidth,-1);  % <<< NEW (Q3)
        \node at (4.5,-.8) {\MakeUppercase{work experiences}};% <<< (Q2) almost
    \end{tikzpicture}

Q4: it may be easiset to redraw this icon yourself in tikz

P.S.: looks like you don't use tikzpagenodes at all

result

\documentclass[11 pt,oneside,a4paper,titlepage]{article}
\usepackage{adjustbox} % to a better alignement of text
\usepackage{geometry}
\geometry{
    a4paper,
    left=0.1cm,
    right=0.6cm,
    top=0.1cm,
    bottom=0.1cm,
    showframe=true
}

\usepackage{lipsum} \usepackage{microtype}

% More defined colors \usepackage[dvipsnames]{xcolor}

% Required package \usepackage{tikz} %\usetikzlibrary{positioning} \usepackage{tikzpagenodes} % not needed? \usepackage{fontawesome5}

% Lengths \newlength\SidebarTextWidth \setlength\SidebarTextWidth{7cm} \newlength\leftSideSecWidth \setlength\leftSideSecWidth{2cm} \newlength\rightSideSecWidth \setlength\rightSideSecWidth{9cm}

% Command for Education and Works \newcommand{\MySection}[7]{ % input: years, logo, title, university, city, specialization, description \adjustbox{valign=t}{\begin{minipage}{\leftSideSecWidth} \begin{flushleft}% <<< CHANGED (Q1) {\small #1} \ %years % \vspace*{0.1cm} % \includegraphics[width=1.2cm]{#2} %logo \end{flushleft} \end{minipage}} \hspace{0.1cm} \hfill %\vline %\hfill \adjustbox{valign=t}{\begin{minipage}{9.0cm} {\normalsize\bfseries #3} %title \hfill {\footnotesize \faMapMarker ~ #5} % city \newline {\small\bfseries \textsc{#4}} %university \newline \small {\emph{#6}} %specialization %\newline %originally not commented \footnotesize {#7} %description \end{minipage}} }

% ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ \begin{document}

% Left-side page \adjustbox{valign=t}{\begin{minipage}{7cm} \section*{Side bar} \lipsum[1-2]
\end{minipage}} % \hfill % Right-side page \adjustbox{valign=t}{\begin{minipage}{11.6cm} %11.3cm

\begin{tikzpicture}[remember picture,overlay]   
    \draw [help lines] (0,0) grid (5,-2);    
    \node[font = {\Large},circle,fill=orange, minimum size = 1cm] 
        (c) at (0.5,-1){\faSuitcase};   
    \draw[orange, thick] (c.0) -- (\textwidth,-1);  % &lt;&lt;&lt; NEW (Q3)
    \node at (4.5,-.8) {\MakeUppercase{work experiences}};% &lt;&lt;&lt; (Q2) almost
\end{tikzpicture}

\vspace{1.5cm} 

\MySection{Feb.--Mar. 2021}{}{Visiting Researcher}{Sapienza University}{Rome, ITALY}{Space Engineering}{\newline \lipsum[4]}
\end{minipage}} 
\newpage

\end{document}

MS-SPO
  • 11,519
  • 1
    Thank you very much @MS-SPO, I am studying your answer now. However, if you have a different approach that can best fit my question, feel free to share. – g_don Apr 06 '23 at 13:55
  • 1
    Fine :) // Can you please share the URL of the CV you try to recreate, best inside your question? Thanks. // Just don't understand a few things: purpose of side bar, how it will look like once there are more entries, e.g. on page 2 (also your question is a good place to share this insight/your objective) – MS-SPO Apr 06 '23 at 14:13
  • 1
    I took a template from overleaf website and then tried to give a personal touch: https://www.overleaf.com/latex/templates/pirate-engineer-template/sqfvydxkztqj – g_don Apr 06 '23 at 15:00
  • Hi @MS-SPO, the solution for Q2 doesn't work: if the number of characters changes, we get a different alignment... – g_don Apr 06 '23 at 20:28
  • 1
    I suggest to improve your question. E.g. the test document should include such variations. It should somehow reflect the intended end result. E.g. how many pages must it have? Also what you commented as extra info should go into the question: it‘s not fun to find relevant details in the 17th comment … it may be overlooked. – MS-SPO Apr 07 '23 at 05:09
  • Thanks for your feedback. I edited my original question and provided a complete MWE that faithfully reproduces my first page CV. Pay no attention to bad handling of margins, as I'm actually working on them. Consequently, you can update your original answer. – g_don Apr 07 '23 at 10:11