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

Conversation

boi-wan
Copy link

@boi-wan boi-wan commented Jul 28, 2020

When using \cvsubentries and \cvsubentry elements, XeLaTex compiler raises the below errors:

  1. Extra alignment tab has been changed to \cr.
    [...]
    You have given more \span or & marks than there were
    in the preamble to the \halign or \valign now in progress.
    So I'll assume that you meant to type \cr instead.

    OverLeaf hint:
    You have written too many alignment tabs in a table, causing one of them to be turned into a line break. Make sure you have specified the correct number of columns in your table.

  2. Misplaced \omit.
    \multispan ->\omit
    @multispan
    [...]
    I expect to see \omit only after tab marks or the \cr of
    an alignment. Proceed, and I'll ignore this case.

First error seems to be caused by a missing new line command inside the \cvsubentry declaration on awesome-cv.cls.

This piece of code:

\newcommand*{\cvsubentry}[4]{%
\setlength\tabcolsep{0pt}
  \setlength{\extrarowheight}{0pt}
  \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} L{\textwidth - 4.5cm} R{4.5cm}}
    \setlength\leftskip{0.2cm}
    \subentrytitlestyle{#2} & \ifthenelse{\equal{#1}{}}
      {\subentrydatestyle{#3}}{}
    \ifthenelse{\equal{#1}{}}
      {}
      {\subentrypositionstyle{#1} & \subentrydatestyle{#3} \\}
    \ifthenelse{\equal{#4}{}}
      {}
      {\multicolumn{2}{L{17.0cm}}{\subdescriptionstyle{#4}} \\}
  \end{tabular*}
}

should become:

\newcommand*{\cvsubentry}[4]{%
\setlength\tabcolsep{0pt}
  \setlength{\extrarowheight}{0pt}
  \begin{tabular*}{\textwidth}{@{\extracolsep{\fill}} L{\textwidth - 4.5cm} R{4.5cm}}
    \setlength\leftskip{0.2cm}
    \subentrytitlestyle{#2} & \ifthenelse{\equal{#1}{}}
      {\subentrydatestyle{#3}}{} \\
    \ifthenelse{\equal{#1}{}}
      {}
      {\subentrypositionstyle{#1} & \subentrydatestyle{#3} \\}
    \ifthenelse{\equal{#4}{}}
      {}
      {\multicolumn{2}{L{17.0cm}}{\subdescriptionstyle{#4}} \\}
  \end{tabular*}
}

Second issue, seems to be related to a problem between \ifthenelse and \multicolumn.

As stated here, \multicolumn must be the first thing TeX sees in a table cell, after expanding commands; unfortunately, the workings of \ifthenelse leave something before \multicolumn when the test is computed false.

A good solution could be to use a different test making command.

Paolo Boi added 3 commits July 28, 2020 17:25
Added new command for cvsubentry description building
\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.

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

Successfully merging this pull request may close these issues.

2 participants