4

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.

Rachel
  • 1,722
  • 8
  • 29
  • 34
  • I don't think this will work without tinkering with TeX commands. What you could do is use the report class, then you have Chapter as additional level on top. Works fine for the TOC, but the chapter headings are very large in the text. – vaettchen May 12 '12 at 12:59
  • @vaettchen I am using the report class and am in fact using Chapters.. Any other ideas? I wouldn't mind entering some TeX commands if that's what necessary, I'm just not familiar with LaTeX in general. – Rachel May 12 '12 at 13:04
  • 3
    You'll probably find that moving this question to TeX.SX (tex.stackexchange.com) will get you a broad choice of answers. – Brent.Longborough May 12 '12 at 14:12
  • Thanks for the suggestion @Brent.Longborough. Can I move the question myself? – Rachel May 12 '12 at 14:17
  • I just flagged it for the moderators, asking them to move it for you. – Brent.Longborough May 12 '12 at 14:26
  • @Rachel: The moderators seem to be a bit busy with other stuff, so I guess it's do-it-yourself time. I suggest this: (1) Go to Tex.stackexchange and make sure you're registered (with the same SX ID). (2) Start a new question over there - you can edit this question in a separate browser window, and cut-and-paste. (3) When you've posted the question there, come back and edit this question, to say at the top "I've migrated this to TeX.SX". – Brent.Longborough May 14 '12 at 11:06
  • Thank you for taking the time to reply again @Brent.Longborough. I think I sould leave the question here though now that it's been answered... Thanks again! – Rachel May 14 '12 at 13:28

2 Answers2

8

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

borgdb
  • 96
  • 1
  • 2
  • 2
    For this solution to work in a regular preamble, one needs to wrap it into `\makeatletter` and `\makeatother`. Otherwise LaTeX will not recognise the commands containing an `@` and throw an error. See https://tex.stackexchange.com/a/8353/5267 for details. – fbmd Aug 18 '17 at 16:14
0

I am sure all of this works fine, but a long time ago, I learned KISS - Keep it simple, stupid. This works fine: \paragraph{Paragraph Title} , \newline Just my two cents later