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

Is it possible to remove empty space if no value was filled for \cventry?

Open nikitavoloboev opened this issue 6 years ago • 11 comments

Here is my current CV.

The issue I have is that in Open Source Projects, there is quite a bit of space between each of the items in the list.

2018-11-28 at 20 44

This is due to some values not being filled in \cventry.

  \cventry
    {Alfred workflow to search Learn Anything. Written in Go.}
    {\href{https://github.com/nikitavoloboev/alfred-learn-anything}{Alfred Learn Anything}}
    {}
    {2018}
    {
    }

Is it possible to not have this? I am not too familiar with LaTeX to make that happen.

Thank you for any help.

nikitavoloboev avatar Nov 28 '18 19:11 nikitavoloboev

Also I really dislike how the descriptions there have all capital letters. It's very hard to read.

If I do this though:

  \cventry
    {}
    {\href{https://github.com/nikitavoloboev/alfred-learn-anything}{Alfred Learn Anything}}
    {}
    {2018}
    {
      {Alfred workflow to search Learn Anything. Written in Go.}
    }

I get

2018-11-28 at 20 46

Which is even worse. 😞

nikitavoloboev avatar Nov 28 '18 19:11 nikitavoloboev

I would like to know an answer to this as well. I'm new to Latex, help would be much appreciated!

LitePenguins avatar Feb 04 '19 08:02 LitePenguins

I'm facing the same issue. If anyone has solved this, kindly post here. that'd be helpful.

s9k96 avatar Feb 25 '19 06:02 s9k96

A not very elegant way is to add \vspace{-\baselineskip} at the end of each \cventry. e.g.

  \cventry
    {Alfred workflow to search Learn Anything. Written in Go.}
    {\href{https://github.com/nikitavoloboev/alfred-learn-anything}{Alfred Learn Anything}}
    {}
    {2018}
    {
    }
    \vspace{-\baselineskip}

fabnavarro avatar Feb 25 '19 21:02 fabnavarro

You can modify the cventry command as follows:

% Define an entry of cv information
% 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*}%
}

In this way, if the fifth argument is left empty there won't be any extra space

lucmos avatar Mar 07 '19 17:03 lucmos

@LucaMoschella Do you want to open PR for it or should I do it? I think it's a good change.

nikitavoloboev avatar Mar 07 '19 18:03 nikitavoloboev

You can do it, I'm not very experienced with pull requests :)

lucmos avatar Mar 07 '19 19:03 lucmos

@LucaMoschella Thanks for the modified commands It worked really well However, I had to remove \vspace{-2.0mm} and keep the original \textwidth at all places in order to preserve the format. Curious to know why you included them? I am not very familiar with LaTex

karan-parekh avatar Sep 08 '19 09:09 karan-parekh

Hi, I am also having this issue. I have tried what @LucaMoschella suggested & the solution found here: https://tex.stackexchange.com/questions/464431/latex-awesome-cv-space-after-entries but to no avail. image

at8865 avatar Oct 11 '19 23:10 at8865

I tried the solution from @lucmos, and I got missing \omit errors. I found the same post that @at8865 mentioned, but the solution there worked for me. I have included the code snip-it below for reference.

% Define an entry of cv information
% 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} \\}
    \if\relax\detokenize{#5}\relax\else % THIS LINE ADDED TO CHECK IF LAST ARGUMENT IS EMPTY
        \multicolumn{2}{L{\textwidth}}{\descriptionstyle{#5}}% ONLY DO THIS IF #5 IS NOT EMPTY
    \fi % END OF THE IF STATEMENT
  \end{tabular*}%
}

I think this post explains why \if\relax\detokenize{#5} is a safer check than \ifthenelse{\isempty{#1}}{#2}{#3}, which the \ifempty macro uses.

hoser21 avatar Apr 30 '20 18:04 hoser21

Thanks! +1 for the description as optional

CBroz1 avatar Oct 16 '22 14:10 CBroz1