0

I write document in Latex

\documentclass[12pt,a4paper,notitlepage, twoside]{article}

And I created new command myparagraph, just to create new line (something like enter) effect (because \paragraph haven't done that.)

\newcommand{\myparagraph}[1]{\paragraph{#1}\mbox{}\\}

And now I have a new problem, because sometimes when I create new \myparagraph the paragraph title name stays one one page and the content is on the next one (beacuse it's to big to fit in the previous where the paragraph title is). What can I do to move the paragraph name to the next page, when content of this paragraph does that. I attach a photo which shows the problem.

enter image description here

2
  • 2
    If you don't want \paragraph to be a in-text header, but printed on a line on its own with standard class article, you should use a package like titlesec to reconfigure the style. Using \mbox[}\` is a ugly hack. Using \mbox{}\*` would also be a hack. There are also classes, that already provide interfaces for such changes.
    – cabohah
    Feb 6, 2023 at 14:04
  • Can you make a minimal reproducible example? Normally the figure should float to the next page, but the text from after the figure should appear below your paragraph heading. Feb 7, 2023 at 12:07

1 Answer 1

1

You could achieve placing the content of a paragraph on a new line below the title of that paragraph by adding these lines to your preamble:

\usepackage{titlesec}

\titleformat{\paragraph}[runin]{\sffamily\itshape}{}{0pt}{}[\quad -- \newline]

See the manual of titlesec (chapter 3) for the explanation of the formatting codes. Or even better - take a look at the excellent explanation and examples on the tutorial page of Overleaf: https://www.overleaf.com/learn/latex/Sections_and_chapters .

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .