2

For a column document I need to use the \paragraph{} command as opposed to the common \par. Using \paragraph{}, however, introduces a space between paragraphs that I do not want (see the image below for said separation).

Since I am not using \par, I cannot use \setlength{\parskip}{0em} to remove the space between that \paragraph{} creates. I know that the simpler solution is not to use it, but it is necessary for what I am doing. I have tried \vspace{<negative value>}, but it is janky and depends on factors like word count and such, making it unreliable and unsuitable.

Taking the following code sample, what should be added to remove the highlighted separation and still continue using \paragraph{} as shown?:

\documentclass[9pt]{article}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
\usepackage{multicol}
\usepackage{titlesec}
    \titleformat{\paragraph}[leftmargin]{\normalfont}{}{}{}
    \setlength{\parindent}{0em}
    \setlength{\parskip}{0em}

\begin{document}
\begin{multicols*}{2}

\paragraph{A}\lipsum[1]

\paragraph{B}\lipsum[1]

\end{multicols*}
\end{document}

Remove separation hightlighted in red.

  • 1
    despite the name \paragraph is really unrelated to paragraphs of text it is the 4th level section heading and should only be used after \subsubsection otherwise the document structure (as seen for example \tableofcontents will be distorted if you increase secnumdepth. – David Carlisle Dec 13 '19 at 17:21
  • Thank you! I did not know that, but by chance your comment helped me solve my question and remove the spacing between paragraphs (and sections, which as you say is what they truly are). I will try to work what you said into my document; thanks again. – Joel Dacasa Dec 13 '19 at 17:43
3

Add a suitable \titlespacing command:

\documentclass[9pt]{article}
\usepackage[T1]{fontenc}
\usepackage{lipsum}
\usepackage{multicol}
\usepackage{titlesec}

\titleformat{\paragraph}[leftmargin]{\normalfont}{}{}{}
\titlespacing{\paragraph}{1em}{0pt}{0pt}
\setlength{\parindent}{0em}

\begin{document}
\begin{multicols*}{2}

\paragraph{A}\lipsum[1]

\paragraph{B}\lipsum[1]

\end{multicols*}
\end{document}

enter image description here

  • Thank you very much! – Joel Dacasa Dec 13 '19 at 17:46
3

There are two problems with your MWE: (1) the article class does not provide a 9pt option and (2) if you included a third paragraph, say C, which would start in the second column then the C interferes with the text in the first column.

If your paragraph titles are all single characters then using \llap might give you what you are after:

\llap{A} \lipsum[1]

\llap{B} \lipsum[1]

However for longer titles \rlap would be better:

\rlap{Letters} \lipsum[1]

Or what about just a simple

\textbf{A} \lipsum[1]
  • Duly noted. (1) The paragraph titles are indeed just single characters, so there is no overlap from the right to the left column; (2) I will take into account what you said about the article class, so thank you, sir; and (3), I was looking to get the letter character or label to the left of the paragraph, which the paragraph{<letter>} command accomplishes nicely combined with user egreg's answer above. I will take what you said into consideration, that said, and thanks again. – Joel Dacasa Dec 13 '19 at 18:21

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.