1

I am using \resumeSubheading in my code. I wanted to remove the curly braces, which are adding an extra white line in the PDF.

If I simply remove the braces (erase it), I am getting an error. I have added the code below.

\documentclass[letterpaper,12pt]{article}

\usepackage{latexsym} \usepackage[empty]{fullpage} \usepackage{titlesec} \usepackage{marvosym} \usepackage[usenames,dvipsnames]{color} \usepackage{verbatim} \usepackage{enumitem} \usepackage[hidelinks]{hyperref} \usepackage{fancyhdr} \usepackage[english]{babel} \usepackage{fontawesome5} \usepackage{hyperref}

\makeatother \pagestyle{fancy} \fancyhf{} % clear all header and footer fields \fancyfoot{} \renewcommand{\headrulewidth}{0pt} \renewcommand{\footrulewidth}{0pt}

% Adjust margins \addtolength{\oddsidemargin}{-0.5in} \addtolength{\evensidemargin}{-0.5in} \addtolength{\textwidth}{1in} \addtolength{\topmargin}{-.5in} \addtolength{\textheight}{1.0in}

\urlstyle{same}

\raggedbottom \raggedright \setlength{\tabcolsep}{0in}

% Sections formatting \titleformat{\section}{ \vspace{-4pt}\scshape\raggedright\large }{}{0em}{}[\color{black}\titlerule\vspace{-5pt}]

%------------------------- % Custom commands \newcommand{\resumeItem}[2]{ \item\small{ \textbf{#1}{#2 \vspace{-2pt}} } }

\newcommand{\resumeSubheading}[4]{ \vspace{0pt}\item \begin{tabular}{0.97\textwidth}[t]{l@{\extracolsep{\fill}}r} \textbf{#1} & #2 \ \textit{\small#3} & \textit{\small #4} \ \end{tabular}\vspace{-5pt} }

\newcommand{\resumeSubItem}[2]{\resumeItem{#1}{#2}\vspace{-4pt}}

\renewcommand{\labelitemii}{$\circ$}

\newcommand{\resumeSubHeadingListStart}{\begin{itemize}[leftmargin=*]} \newcommand{\resumeSubHeadingListEnd}{\end{itemize}} \newcommand{\resumeItemListStart}{\begin{itemize}} \newcommand{\resumeItemListEnd}{\end{itemize}\vspace{-5pt}}

%------------------------------------------- %%%%%% CV STARTS HERE %%%%%%%%%%%%%%%%%%%%%%%%%%%%

\begin{document}

%----------HEADING----------------- %\begin{tabular*}{\textwidth}{l@{\extracolsep{\fill}}r} \begin{center} \textbf{\href{}{\Large Dummy Name}}\hspace {0.2cm} \vskip 0.2cm \href{}{\textit{Dummy Name@gmail.com}}$\diamond$ \hspace {0.1cm}

\end{center}

%\end{tabular*}

%-----------INTERNSHIPS----------------- \section{Work Experiences} \resumeSubHeadingListStart

\resumeSubheading {Dummy Name }{July 2021 -- December 2021}{}{} %--THESE BRACES RESULT IN EMPTY LINE--% \resumeItemListStart \resumeItem{} {Dummy Name}

  \resumeItemListEnd


\resumeSubHeadingListEnd

%--------PROGRAMMING SKILLS------------ \section{Technical Skills} \resumeSubHeadingListStart \item{\textbf{ Programming Languages}{: C++,Java,Python} \hfill \textbf{$\bullet$ Libraries}{: Scikit-learn,Pandas,Selenium}}

\resumeSubHeadingListEnd

\end{document}

vajr1
  • 23
  • 3
  • 1
    First of all Welcome to TeX.SX! Second, please try to provide a minimal working example so that we know what code you got and how to help you. Third, you cannot simply remove curly brackets from macros, because they contain the required arguments for this macro. If you want to change the output, you need to so otherwise (but I can't tell you how at the moment, because I don't know you code apart fom this tiny snippet). – Jasper Habicht Dec 01 '21 at 07:06
  • 1
    Please post real code, not screenshots. Also, a more complete (minimal yet working) example is sorely needed, as @JasperHabicht pointed out. – Ingmar Dec 01 '21 at 09:40
  • Thanks for adding the code! It is not the curly brace that is the reason for the empty line, but because of the definition of \resumeSubheading. As soon as this question has been re-opened, I will provide a quick-fix for your problem. – Jasper Habicht Dec 01 '21 at 10:29

1 Answers1

2

The reason for the output of the empty line lies in the definition of the macro \resumeSubheading which inserts a tabular environment that has two lines. Even if the second line is empty, it will still be part of the output.

In order to only output the second line if the contents of this line is not empty, you may replace this code in your document:

\newcommand{\resumeSubheading}[4]{
  \vspace{0pt}\item
    \begin{tabular*}{0.97\textwidth}[t]{l@{\extracolsep{\fill}}r}
      \textbf{#1} & #2 \\
      \textit{\small#3} & \textit{\small #4} \\
    \end{tabular*}\vspace{-5pt}
}

by the following code:

\newcommand{\resumeSubheading}[4]{
  \vspace{0pt}\item
    \def\tempscndline{#3#4}\ifx\tempscndline\empty
    \begin{tabular*}{0.97\textwidth}[t]{l@{\extracolsep{\fill}}r}
      \textbf{#1} & #2 \\
    \end{tabular*}
    \else
    \begin{tabular*}{0.97\textwidth}[t]{l@{\extracolsep{\fill}}r}
      \textbf{#1} & #2 \\
      \textit{\small#3} & \textit{\small #4} \\
    \end{tabular*}
    \fi\vspace{-5pt}
}

It is not an overly elegant solution, but it should solve your problem.