0

I am aware that there are several ways to insert a horizontal space in a LaTeX document - What commands are there for horizontal spacing?, but none of them seems to work in my case.

This is the undesired behaviour in my rendered document - bad spacing in pdf

This is my code -

\Section{Programming Skills}
\vspace{-5pt}
\textbf{Languages:} Python, Java, C, C++\\
\textbf{Libraries/Frameworks:} numpy, ROOT, git, CUDA, *nix, \LaTeX{}
\vspace{-5pt}

where Languages is indented more than Libraries/Frameworks. Unindenting Languages or indenting Libraries/Frameworks so that they line up both are fine. (should line up in their current positions, not more to the left or right)

definition of \Section is in my .cls -

\newcommand{\Section}[1]{
    \Line \par
    \vspace{1pt}
    \textbf{\fontsize{13}{13}\selectfont #1} \par
    \vspace{-7pt}
    \Line \par
    \vspace{3pt}
}
  • 2
    Remove the \\ after "C++".and add an empty line instead. Additinoally, you can add \setlength{\parindent}{0pt} to your preamble to get rid of the indentation. – leandriis Apr 15 '20 at 12:24
  • Replacing the \\ with \newline did not change anything :( Adding \setlength{\parindent}{0pt} to the preamble fixes this case but messes up indentation in the rest of the file. – Pratyush Das Apr 15 '20 at 13:41
  • Please make your code fragments compilable. – leandriis Apr 15 '20 at 16:36

1 Answers1

1

I have tried to put together a compilable version of your code.

% secprob.tex  SE 538713

\documentclass{article}

\newcommand{\Section}[1]{
%    \Line % don't know what this is, using \mbox{} instead
    \mbox{} \par
    \vspace{1pt}
    \textbf{\fontsize{13}{13}\selectfont #1} \par
    \vspace{-7pt}
%    \Line 
    \mbox{}\par
    \vspace{3pt}
}

\begin{document}

\Section{Programming Skills}
\vspace{-5pt}
\textbf{Languages:} Python, Java, C, C++ % \\ % just leave an empty line

\textbf{Libraries/Frameworks:} numpy, ROOT, git, CUDA, *nix, \LaTeX{}
\vspace{-5pt}

\end{document}

Replacing your \\ with an empty line gives a result you were asking for.

Peter Wilson
  • 28,066