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

\cvsubentry extra alignment and misplaced \omit fix #335

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 18 additions & 4 deletions awesome-cv.cls
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,21 @@
}{%
\end{center}
}
% Define a command for string equality checking
\makeatletter
\newcommand{\streqtest}[2]{%
\ifnum\pdfstrcmp{#1}{#2}=\z@
\expandafter\@firstoftwo
\else
\expandafter\@secondoftwo
\fi}
\makeatother
% Define a command for cv subentry description building
\newcommand{\cvsubentrydescbuilder}[1]{%
\streqtest{#1}{}%
{}
{\multicolumn{2}{L{17.0cm}}{\subdescriptionstyle{#1}}\\ }
}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran into a Tex capacity exceeded when trying to use this with xelatex.

! TeX capacity exceeded, sorry [input stack size=5000].
\reserved@a ->\def \reserved@a 
                               *{\@hspacer }\reserved@a 
l.48     }

Small example that triggered the issue for me.

\documentclass[10pt, a4paper]{awesome-cv}
\geometry{left=1.4cm, top=.8cm, right=1.4cm, bottom=1.8cm, footskip=.5cm}
\fontdir[awesome-cv/fonts/]
\colorlet{awesome}{awesome-red}
\setbool{acvSectionColorHighlight}{true}

% setup info

\name{Firstname}{Surname}
\position{Position Title}
\address{Home Address}

\begin{document}
\cvsection{Work Experience}

\begin{cventries}

  \cventry
    {Overall Title}
    {Employer}
    {Location}
    {Start date - End Date}
    {
      \begin{cvsubentries}
        \cvsubentry
          {}
          {Project 1}
          {2019 - Current}
          {
            \begin{cvitems}
              \item {responsibility 1.}
              \item {responsibility 1.}
              \item {responsibility 1.}
            \end{cvitems}
          }
        \cvsubentry
          {}
          {Project 2}
          {2018 - 2019}
          {
            \begin{cvitems}
              \item {responsibility 1.}
              \item {responsibility 1.}
              \item {responsibility 1.}
            \end{cvitems}
          }
      \end{cvsubentries}
    }
\end{cventries}

\end{document}

I did find another way, it appears tabular* is quite space sensitive and once line 625 in the original is fixed, and switched to using different if statements see #314, adding % to the end of all of the lines fixes the unusual alignment of the entries after the first. See #357 for more info.

% Define a subentry of cv information
% Usage: \cvsubentry{<position>}{<title>}{<date>}{<description>}
\newcommand*{\cvsubentry}[4]{%
Expand All @@ -622,13 +637,12 @@
\begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} L{\textwidth - 4.5cm} R{4.5cm}}
\setlength\leftskip{0.2cm}
\subentrytitlestyle{#2} & \ifthenelse{\equal{#1}{}}
{\subentrydatestyle{#3}}{}
{\subentrydatestyle{#3}}
{} \\
\ifthenelse{\equal{#1}{}}
{}
{\subentrypositionstyle{#1} & \subentrydatestyle{#3} \\}
\ifthenelse{\equal{#4}{}}
{}
{\multicolumn{2}{L{17.0cm}}{\subdescriptionstyle{#4}} \\}
\cvsubentrydescbuilder{#4}
\end{tabular*}
}

Expand Down