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

Empty Space if Role is not entered in cventry. #327

Open
micullen opened this issue May 2, 2020 · 7 comments
Open

Empty Space if Role is not entered in cventry. #327

micullen opened this issue May 2, 2020 · 7 comments

Comments

@micullen
Copy link

micullen commented May 2, 2020

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

@yxcho
Copy link

yxcho commented May 3, 2020

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

@micullen
Copy link
Author

micullen commented May 3, 2020

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

@yxcho
Copy link

yxcho commented May 3, 2020

That helps, thank you!

@StevenSalazarM
Copy link

StevenSalazarM commented Nov 4, 2020

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

@minsung-k
Copy link

Do you know how to make another eventry.

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

@fulcus
Copy link

fulcus commented Aug 8, 2022

The PR in question is #428

@fulcus
Copy link

fulcus commented Aug 8, 2022

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

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

5 participants