AwesomeCV 项目部分删除 \cventry 中的空格

AwesomeCV 项目部分删除 \cventry 中的空格

我想修改\cventryAwesomeCV模板中的定义。

在我的项目部分,我没有职位或日期,我希望这个额外的空间消失。

以下是初始版本cventry

\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} \\}
    \multicolumn{2}{L{\textwidth}}{\descriptionstyle{#5}}
  \end{tabular*}%
}

并给出以下结果:

在此处输入图片描述

当通过时:

  \cventry
    {} % Job title
    {Project Name} % Organization
    {Youtube Link} % Location
    {} % Date(s)
    {
      \begin{cvitems} % Description(s) of tasks/responsibilities
          \item {Project item 1}
      \end{cvitems}
    }

现在为了摆脱多余的空间,我将其修改\cventry如下:

\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} \\
      \ifempty{#1}{}{\entrypositionstyle{#1} & \entrydatestyle{#4} \\}}
    \multicolumn{2}{L{\textwidth}}{\descriptionstyle{#5}}
  \end{tabular*}%
}

\entrypositionstyle{#1} & \entrydatestyle{#4} \\}基本上改变了路线\ifempty{#1}{}{\entrypositionstyle{#1} & \entrydatestyle{#4} \\}}

在此处输入图片描述

空间消失了,但有些东西弄乱了列。我还收到此错误:

在此处输入图片描述

我怎样才能解决这个问题?

谢谢

答案1

在修补命令的前言中使用以下代码\cventry

\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}
      {\ifempty{#1#4}{}{\entrypositionstyle{#1} & \entrydatestyle{#4} \\}}
      {\entrytitlestyle{#2} & \entrylocationstyle{#3} 
       \ifempty{#1#4}{}{\\\entrypositionstyle{#1} & \entrydatestyle{#4}}}
    \ifempty{#5}{}{\\\multicolumn{2}{L{\textwidth}}{\descriptionstyle{#5}}}
  \end{tabular*}%
  \par % <============================================================== missing in class
}

请注意,我添加了对空参数 1 和 4 以及空参数 5 的检查。

使用以下可编译代码

%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode
% Awesome CV LaTeX Template for CV/Resume
%
% This template has been downloaded from:
% https://github.com/posquit0/Awesome-CV
%
% Author:
% Claud D. Park <[email protected]>
% http://www.posquit0.com
%
% Template license:
% CC BY-SA 4.0 (https://creativecommons.org/licenses/by-sa/4.0/)
%


%-------------------------------------------------------------------------------
% CONFIGURATIONS
%-------------------------------------------------------------------------------
% A4 paper size by default, use 'letterpaper' for US letter
\documentclass[11pt, a4paper]{awesome-cv}

% Configure page margins with geometry
\geometry{left=1.4cm, top=.8cm, right=1.4cm, bottom=1.8cm, footskip=.5cm}

% Specify the location of the included fonts
\fontdir[fonts/]

% Color for highlights
% Awesome Colors: awesome-emerald, awesome-skyblue, awesome-red, awesome-pink, awesome-orange
%                 awesome-nephritis, awesome-concrete, awesome-darknight
\colorlet{awesome}{awesome-red}
% Uncomment if you would like to specify your own color
% \definecolor{awesome}{HTML}{CA63A8}

% Colors for text
% Uncomment if you would like to specify your own color
% \definecolor{darktext}{HTML}{414141}
% \definecolor{text}{HTML}{333333}
% \definecolor{graytext}{HTML}{5D5D5D}
% \definecolor{lighttext}{HTML}{999999}

% Set false if you don't want to highlight section with awesome color
\setbool{acvSectionColorHighlight}{true}

% If you would like to change the social information separator from a pipe (|) to something else
\renewcommand{\acvHeaderSocialSep}{\quad\textbar\quad}


\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}
      {\ifempty{#1#4}{}{\entrypositionstyle{#1} & \entrydatestyle{#4} \\}}
      {\entrytitlestyle{#2} & \entrylocationstyle{#3} 
       \ifempty{#1#4}{}{\\\entrypositionstyle{#1} & \entrydatestyle{#4}}}
    \ifempty{#5}{}{\\\multicolumn{2}{L{\textwidth}}{\descriptionstyle{#5}}}
  \end{tabular*}%
  \par % <============================================================== missing in class
}



%-------------------------------------------------------------------------------
%   PERSONAL INFORMATION
%   Comment any of the lines below if they are not required
%-------------------------------------------------------------------------------
% Available options: circle|rectangle,edge/noedge,left/right
% \photo{./examples/profile.png}
\name{Claud D.}{Park}
\position{Software Architect{\enskip\cdotp\enskip}Security Expert}
\address{42-8, Bangbae-ro 15-gil, Seocho-gu, Seoul, 00681, Rep. of KOREA}

\mobile{(+82) 10-9030-1843}
\email{[email protected]}
\homepage{www.posquit0.com}
\github{posquit0}
\linkedin{posquit0}
% \gitlab{gitlab-id}
% \stackoverflow{SO-id}{SO-name}
% \twitter{@twit}
% \skype{skype-id}
% \reddit{reddit-id}
% \medium{madium-id}
% \googlescholar{googlescholar-id}{name-to-display}
%% \firstname and \lastname will be used
% \googlescholar{googlescholar-id}{}
% \extrainfo{extra informations}

\quote{``Be the change that you want to see in the world."}


%-------------------------------------------------------------------------------
\begin{document}

% Print the header with above personal informations
% Give optional argument to change alignment(C: center, L: left, R: right)
\makecvheader

% Print the footer with 3 arguments(<left>, <center>, <right>)
% Leave any of these blank if they are not needed
\makecvfooter
  {\today}
  {Claud D. Park~~~·~~~Curriculum Vitae}
  {\thepage}


%-------------------------------------------------------------------------------
%   CV/RESUME CONTENT
%   Each section is imported separately, open each file in turn to modify content
%-------------------------------------------------------------------------------
%\input{cv/education.tex}
\begin{cventries}
    \cventry
        {1 Degree ...}
        {2 University of ...}
        {3 London}
        {4 2011-2015}
        {5 \begin{cvitems} % Description(s) bullet points
                \item {ipsum dorem}
        \end{cvitems}}

    \cventry
        {}
        {2 College}
        {3 College}
        {4 2010-2011}
        {5 ipsum dorem}

    \cventry
        {1 Degree}
        {}
        {}
        {4 2010-2011}
        {5 ipsum dorem}

  \cventry
    {} % Job title
    {Project Name} % Organization
    {Youtube Link} % Location
    {} % Date(s)
    {
      \begin{cvitems} % Description(s) of tasks/responsibilities
          \item {Project item 1}
      \end{cvitems}
    }
\end{cventries}

%-------------------------------------------------------------------------------
\end{document}

您将获得以下结果:

在此处输入图片描述

相关内容