С помощью AwesomeCV возможно ли удалить пробелы, оставшиеся между заголовком и элементами? - PullRequest
1 голос
/ 03 мая 2020

Используя код ввода cv ниже, я остаюсь с пробелом между заголовком (исследование количественных методов) и предметами (расследование ...). Это происходит из-за того, что Роль пуста, поскольку мне часто это не нужно.

\documentclass[11pt, a4paper]{awesome-cv}
\begin{document}
\cvsection{Projects}

\begin{cventries}
\cventry
    {}% Role - Empty
    {Title}
    % Event
    {Everywhere} % Location
    {Current} % Date(s)
    {
      \begin{cvitems} % Description(s)
        \item {Item 1}
        \item{Item 2}
      \end{cvitems}
    }
\end{cventries}

Whitespace between Title and Items where Role is.

Недавно был PR для удаления пробела, когда позиция 5 оставлено пустым, обновляя код Cventry, как показано ниже

% 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*}%
}
\end{document}

Бесполезное условие во второй последней строке удаляет пробел, если позиции остаются пустыми. Я пытался воссоздать эту строку для ifempty {# 1}, но без особого успеха. Это возможно? Спасибо

1 Ответ

1 голос
/ 03 мая 2020

Быстрый взлом:

% !TeX TS-program = xelatex
\documentclass[11pt, a4paper]{awesome-cv}

% 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*}%
}

\begin{document}
\cvsection{Projects}

\begin{cventries}
\cventry
    {}% Role - Empty
    {Title}
    % Event
    {Everywhere} % Location
    {Current} % Date(s)
    {%
      \begin{cvitems} % Description(s)
        \item {Item 1}
        \item{Item 2}
      \end{cvitems}
    }
\end{cventries}

\begin{cventries}
\cventry
    {Duck}% Role - Empty
    {Title}
    % Event
    {Everywhere} % Location
    {Current} % Date(s)
    {%
      \begin{cvitems} % Description(s)
        \item {Item 1}
        \item{Item 2}
      \end{cvitems}
    }
\end{cventries}
\end{document}

enter image description here

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...