Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
nikitavoloboev opened this issue Nov 28, 2018 · 11 comments

Comments

@nikitavoloboev
Copy link
Contributor

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
Copy link
Contributor Author

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
Copy link

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

@s9k96
Copy link

s9k96 commented Feb 25, 2019

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

@fabnavarro
Copy link

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
Copy link

lucmos commented Mar 7, 2019

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
Copy link
Contributor Author

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

@lucmos
Copy link

lucmos commented Mar 7, 2019

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

@karan-parekh
Copy link

@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
Copy link

at8865 commented Oct 11, 2019

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
Copy link

hoser21 commented Apr 30, 2020

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
Copy link

CBroz1 commented Oct 16, 2022

Thanks! +1 for the description as optional

lucmann added a commit to lucmann/resume that referenced this issue Jul 16, 2024
Suggested by @lucmos posquit0#249

Signed-off-by: Luc Ma <onion0709@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants