Awesome-CV icon indicating copy to clipboard operation
Awesome-CV copied to clipboard

Empty Space if Role is not entered in cventry.

Open micullen opened this issue 4 years ago • 7 comments

I saw recently that a PR was merged to remove whitespace if position 5 is not entered. As showing the code below:

% Usage: \cventry{<position>}{<title>}{<location>}{<date>}<description>}
\newcommand*{\cventry}[5]{%
  \vspace{-2.0mm}
  \setlength\tabcolsep{0pt}
  \setlength{\extrarowheight}{0pt}
  \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} L{\textwidth - 4.5cm} R{4.5cm}}
    \ifempty{#2#3}
      {\entrypositionstyle{#1} & \entrydatestyle{#4} \\}
      {\entrytitlestyle{#2} & \entrylocationstyle{#3} \\
      \entrypositionstyle{#1} & \entrydatestyle{#4}}
    \ifempty{#5}{}{\\\multicolumn{2}{L{\textwidth}}{\descriptionstyle{#5}}}
  \end{tabular*}%
}

However, I often don't enter a role, for Projects etc where I completed everything, and i am left with space in between the title and items as seen in the picture below. image

This project picture above was done by the code below

\cventry
    {}% Role
    {Quantitative Techniques Research}
    % Event
    {Everywhere} % Location
    {Current} % Date(s)
    {
      \begin{cvitems} % Description(s)
        \item {Investigated different ways to process market data to optimise trading algorithms resulting in findings of a higher serial correlation.}
        \item{Researched a mathematical solution to Ornstein-Uhlenbeck as an abstraction of market oscillations for market-making techniques.}
      \end{cvitems}
    }

As you can see, Role is empty, yet still a whitespace. I have tried modifying the cventry code myself to remove the whitespace using a similar technique used by \ifempty{#5}{}{\\\multicolumn{2}{L{\textwidth}}{\descriptionstyle{#5}}}

but to no avail. Is this something that is possible to get around?

Thanks

micullen avatar May 02 '20 16:05 micullen

I am having trouble removing the white space between title and descriptions upon empty position as well. Would really appreciate some help, thanks

yxcho avatar May 03 '20 15:05 yxcho

I received help from stack overflow with this one. You can replace the \cventry code with this

% Define an entry of cv information % Usage: \cventry{<position>}{<title>}{<location>}{<date>}{<description>} \renewcommand*{\cventry}[5]{% \vspace{-2.0mm} \setlength\tabcolsep{0pt} \setlength{\extrarowheight}{0pt} \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} L{\textwidth - 4.5cm} R{4.5cm}} \ifempty{#2#3} {\entrypositionstyle{#1} & \entrydatestyle{#4} \\} {\entrytitlestyle{#2} & \entrylocationstyle{#3} \\ \entrypositionstyle{#1} & \entrydatestyle{#4} \\} \multicolumn{2}{L{\textwidth}}{\ifempty{#1}{\vskip-1.2\baselineskip}{}\descriptionstyle{#5}} \end{tabular*}% }

and that removes the whitespace

micullen avatar May 03 '20 15:05 micullen

That helps, thank you!

yxcho avatar May 03 '20 17:05 yxcho

Hello, thank you for your solution for empty role. However it seems to add a empty space if there is only one single item in cvitems. Any idea how to fix that? When I have two items it works fine

Screenshot_33 Screenshot_32

The code I used for cventry is:

\newcommand*{\cventry}[5]{%
  \vspace{-2.0mm}
  \setlength\tabcolsep{0pt}
  \setlength{\extrarowheight}{0pt}
  \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} L{\textwidth - 4.5cm} R{4.5cm}}
    \ifempty{#2#3}
      {\entrypositionstyle{#1} & \entrydatestyle{#4} \\}
      {\entrytitlestyle{#2} & \entrylocationstyle{#3} \\
      \entrypositionstyle{#1} & \entrydatestyle{#4} \\}
\if\relax\detokenize{#5}\relax\else % THIS LINE ADDED TO CHECK IF LAST ARGUMENT IS EMPTY
       \multicolumn{2}{L{\textwidth}}{\ifempty{#1}{\vskip-1.2\baselineskip}{}\descriptionstyle{#5}}% ONLY DO THIS IF #5 IS NOT EMPTY
    \fi % END OF THE IF STATEMENT
  \end{tabular*}%
}

The code for the images is:

  \cventry
    {} % Role
    {OpenCL Wrapper {} [\underline{\href{https://www.google.com/}{Google}}]} % Event
    {Milan, Italy} % Location
    {Nov. 2019 - Feb 2020} % Date(s)
    {
      \begin{cvitems} % Description(s)
        \item {asd}
      \end{cvitems}
    }

Edit:

I managed to solve this by adding \ifempty{#1#3}. Thanks anyway

StevenSalazarM avatar Nov 04 '20 03:11 StevenSalazarM

Do you know how to make another eventry.

I want to use the original version and make another version too

minsung-k avatar Nov 18 '20 05:11 minsung-k

The PR in question is https://github.com/posquit0/Awesome-CV/pull/428

fulcus avatar Aug 08 '22 10:08 fulcus

@StevenSalazarM happy to see a (former?) polimi student :) Would you mind updating the PR with your fix?

fulcus avatar Aug 08 '22 10:08 fulcus