latexparagraphlyxtableofcontents

How to start new line after paragraph title in Lyx?


I am using the Lyx document processor for LaTeX.

I need to use the Paragraph environment (because I have Subsubsubsections), and I want the paragraphs to appear in the Table of Contents.

I managed to get the Paragraph to appear in the TOC by changing the Document Settings. However, the text right after the title does NOT start in a new line.

I sort of fixed this by inserting ERT (LaTeX code) \newline.

However, now I have a problem because the page number for the paragraphs in the table of contents is also being shown on the next line! (Instead of to the right of the page, under the other page numbers.)

So how do I get the paragraph's body text to start from a new line, without affecting the TOC?

Thank you.


Solution

  • To get new lines after paragraphs, you need to re-define the paragraph command.

    Go to

    Document -> Settings -> Latex Preamble

    and add

    \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
       {-3.25ex\@plus -1ex \@minus -.2ex}%
       {1.5ex \@plus .2ex}%
       {\normalfont\normalsize\bfseries}}
    

    Src: http://www.latex-community.org/forum/viewtopic.php?f=5&t=1383

    Modify the second and third lines to increase or decrease the space before and after the paragraph title.

    For additional information about \@startsection (in case you need more tweaks) http://infohost.nmt.edu/tcc/help/pubs/nmtthesis/old/annotated/at.startsection.html