LyXTitle on 2 lines

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
Michael86
Posts: 2
Joined: Thu Jun 30, 2011 2:55 pm

Title on 2 lines

Post by Michael86 »

Hi,

I'd like to use the "Title" environnment to write my title on 2 lines.

To do so, I write the first title, then press alt+return and write the following title. But when I look at the pdf, the first title is invisible.

Thanks for your help.

PS: I don't want to use the "Subtitle" environnment

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

torbjorn t.
Posts: 162
Joined: Wed Jun 17, 2009 10:18 pm

Title on 2 lines

Post by torbjorn t. »

No idea why the first line vanishes, but use Ctrl + Enter instead of Alt + Enter.

Edit: I looked at the LaTeX code generated by Lyx. A title in LaTeX is specified with the \title{} command, and typeset by putting \maketitle in the document where the title should appear. When you hit Alt + Enter you start a new \title{}, instead of keeping in the same. Only the last instance of \title will be called by \maketitle.

What happens with Alt + Enter:

Code: Select all

\documentclass{article}
\begin{document}
\title{First line of title}
\title{Second line of title}\maketitle
\end{document}
What happens with Ctrl + Enter:

Code: Select all

\documentclass{article}
\begin{document}
\title{First line of title \\
Second line of title}\maketitle
\end{document}
As mentioned, \maketitle prints what is given in the \title-command, and when there are two, only the last one. Double backslash (\\) signifies a line break.
Michael86
Posts: 2
Joined: Thu Jun 30, 2011 2:55 pm

Re: Title on 2 lines

Post by Michael86 »

Thanks a lot, CTRL + ENTER works perfectly!
Post Reply