如何减少 \section 特殊命令的间距

如何减少 \section 特殊命令的间距

我有一个命令:

\newcommand{\NewPart}[1]{\section*{\uppercase{#1}}}

我使用此命令来分隔我的职称,但我希望教育背景和工作经历之间的间距更小。目前它看起来像这样:

\NewPart{Education}{}
\EducationEntry
{University of Test}
{Test 2018}
{\begin{itemize} \itemsep -1pt
    \item Test
    \end{itemize}}

%%% Work experience
\NewPart{Work Experience}{}

输出:

恢复 latex

我希望工作经验和最后学历之间的差距能够缩小。

可供尝试的完整乳胶代码:

\documentclass[fontsize=11pt]{article}
    \usepackage[english]{babel}
\usepackage[utf8x]{inputenc}
\usepackage[protrusion=true,expansion=true]{microtype}
\usepackage[svgnames]{xcolor}  % Colours by their 'svgnames'
\usepackage[margin=0.75in]{geometry}
  \textheight=700px
\usepackage{url}
\usepackage{lmodern} % Allow arbitrary font sizes
\usepackage{textcomp}

%% Define a new 'modern' style for the url package that will use a smaller font.
\makeatletter
\def\url@modernstyle{
  \@ifundefined{selectfont}{\def\UrlFont{\sf}}{\def\UrlFont{}}}
\makeatother
\urlstyle{modern} %% And use the newly defined style.

\frenchspacing              % Better looking spacings after periods
\pagestyle{empty}           % No pagenumbers/headers/footers

\renewcommand{\familydefault}{\sfdefault}

%%% Custom sectioning (sectsty package)
%%% ------------------------------------------------------------
\usepackage{sectsty}

\sectionfont{                 % Change font of \section command
  \usefont{OT1}{phv}{b}{n}%   % bch-b-n: CharterBT-Bold font
  \sectionrule{0pt}{0pt}{-5pt}{2pt}}
  %\titlespacing*{0pt}{13.2pt}{*0}
  %\sectionrule{0pt}{0pt}{-5pt}{3pt}}

%%% Macros
%%% ------------------------------------------------------------
\newlength{\spacebox}
\settowidth{\spacebox}{8888888888}      % Box to align text
\newcommand{\sepspace}{\vspace*{1em}}   % Vertical space macro

\newcommand{\MyName}[1]{ % Name
    \Huge \usefont{OT1}{phv}{b}{n} \hfill #1
    \par \normalsize \normalfont}

\newcommand{\MySlogan}[1]{ % Slogan (optional)
    \large \usefont{OT1}{phv}{m}{n}\hfill \textit{#1}
    \par \normalsize \normalfont}

\newcommand{\NewPart}[1]{\section*{\uppercase{#1}}}
%\newcommand{\NewPart}[1]{\uppercase{#1}}

\newcommand{\PersonalEntry}[2]{
    \noindent\hangindent=2em\hangafter=0 % Indentation
    \parbox{\spacebox}{                  % Box to align text
    \textit{#1}}                      % Entry name (birth, address, etc.)
    \hspace{1.5em} #2 \par}              % Entry value

\newcommand{\SkillsEntry}[2]{                % Same as \PersonalEntry
    \noindent\hangafter=0 % Indentation
    \parbox{\spacebox}{                  % Box to align text
    \textit{#1}}                    % Entry name (birth, address, etc.)
    \hspace{1.5em} #2 \par}              % Entry value

\newcommand{\AwardsEntry}[2]{                % Same as \PersonalEntry
    \noindent\hangindent=2em\hangafter=0 % Indentation
    \parbox{\spacebox}{                  % Box to align text
    \textit{#1}}                    % Entry name (birth, address, etc.)
    \hspace{1.5em} #2 \par}              % Entry value

\newcommand{\EducationEntry}[4]{
    \noindent \textbf{#1} \hfill      % Study
    \colorbox{White}{
      \parbox{8.5em}{
      \hfill\color{Black}#2}} \par  % Duration
    \noindent \textit{#3} \par        % School
    \noindent\hangindent=2em\hangafter=0 \small #4 % Description
    \normalsize \par}

\newcommand{\WorkEntry}[4]{       % Same as \EducationEntry
    \noindent \textbf{#1} \hfill      % Jobname
    \colorbox{White}{%
      \parbox{12em}{%
      \hfill\color{Black}#2}} \par   % Duration
        \noindent \textit{#3} \par        % Company
    \noindent\hangindent=2em\hangafter=0 \small #4 % Description
    \normalsize \par}

\newcommand{\ProjectEntry}[4]{
    \noindent \textbf{#1} \hfill      % Jobname
    \colorbox{White}{%
      \parbox{25em}{%
      \hfill\color{Black}#2}} \par   % Duration
        \noindent \textit{#3} \par        % Company
    \noindent\hangindent=2em\hangafter=0 \small #4 % Description
    \normalsize \par}

\newcommand{\ProjectEntryTwo}[4]{
    \noindent \textbf{#1} \hfill      % Jobname
    \colorbox{White}{%
      \parbox{10em}{%
      \hfill\color{Black}#2}} \par   % Duration
        \noindent \textit{#3} \par        % Company
    \noindent\hangindent=2em\hangafter=0 \small #4 % Description
    \normalsize \par}
%\newcommand{\ProjectEntry}[4]{         % Similar to \EducationEntry
  %  \noindent \textbf{#1} \noindent \textit{#3} \hfill {#2} \par
   % \noindent \small #4 % Description
    %\normalsize \par}

\newcommand{\AwardEntry}[4]{         % Similar to \EducationEntry
    \noindent \textbf{#1} \noindent \textit{#3} \hfill {#2} \par
    \noindent \small #4 % Description
    \normalsize \par}
    \begin{document}
\MyName{\centerline{Sample Name}}
\NewPart{Education}{}
    \EducationEntry
    {University of Test}
    {Test 2018}
    {\begin{itemize} \itemsep -1pt
        \item Test
        \end{itemize}}

    %%% Work experience
    \NewPart{Work Experience}{}

答案1

你可以把\vspace{-2\baselineskip}\newpart 放在前面...

%%% Work experience
\vspace{-2\baselineskip} % 
\NewPart{Work Experience}{}

我得到了这个:

在此处输入图片描述

这是您想要的结果吗?

PSD: 你忘了放\end{document}xD

相关内容