0

I would like to avoid the mandatory line break after \section{title}, so that the text after \section{title} continues on the same line.

One way to answer the question may proceed by modifying David Carlisle's answer to my question May I avoid new line for subsubsections, and I did not succeed with that.

The MWE makes the question more precise:

\documentclass[]{article}

\begin{document}

The command $\backslash$section{title} text gives the text below the section title, as follows:

\section{title} text

\noindent Is there a way to cheat so that we may use something like the command

\medskip

$\backslash$cheatsection{title} text

to appear like the following:

\medskip

\noindent{\Large \textbf{2\indent text}}?

\end{document}

  • my answer was avoiding the break before the heading avoiding the break after is just a standard latex run-in heading like \paragraph you can use that for \section by changing the sign in its definition – David Carlisle Feb 09 '23 at 18:28
  • @DavidCarlisle "avoiding the break after is just a standard latex run-in heading like \paragraph you can use that for \section by changing the sign in its definition "

    Unfortunately, I do not understand how I may change the sign in the definition of \section to obtain the desired result.

    – Frode Alfson Bjørdal Feb 09 '23 at 18:41
  • @DavidCarlisle I did attempt to emulate your previous answer, but as I mentioned, I did not succeed. Just substituting with "section" for "subsubsection" generates a flood of errors with me. – Frode Alfson Bjørdal Feb 09 '23 at 18:44
  • see https://tex.stackexchange.com/questions/215863/how-to-have-run-in-section-in-a-separate-command/215864#215864 – David Carlisle Feb 09 '23 at 18:48
  • @DavidCarlisle Great! That solved my problem. :) – Frode Alfson Bjørdal Feb 09 '23 at 18:56

0 Answers0