posquit0 / Awesome-CV

:page_facing_up: Awesome CV is LaTeX template for your outstanding job application
LaTeX Project Public License v1.3c
23.03k stars 4.79k forks source link

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

Open nikitavoloboev opened 5 years ago

nikitavoloboev commented 5 years ago

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 commented 5 years ago

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. 😞

LitePenguins commented 5 years ago

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

s9k96 commented 5 years ago

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

fabnavarro commented 5 years ago

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}
lucmos commented 5 years ago

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

nikitavoloboev commented 5 years ago

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

lucmos commented 5 years ago

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

karan-parekh commented 5 years ago

@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

at8865 commented 5 years ago

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

hoser21 commented 4 years ago

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.

CBroz1 commented 2 years ago

Thanks! +1 for the description as optional