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
LyX ⇒ Title on 2 lines
NEW: TikZ book now 40% off at Amazon.com for a short time.

-
- Posts: 162
- Joined: Wed Jun 17, 2009 10:18 pm
Title on 2 lines
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:
What happens with Ctrl + Enter:
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.
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
Code, edit and compile here:
\documentclass{article}\begin{document}\title{First line of title}\title{Second line of title}\maketitle\end{document}
Code: Select all
Code, edit and compile here:
\documentclass{article}\begin{document}\title{First line of title \\Second line of title}\maketitle\end{document}
Re: Title on 2 lines
Thanks a lot, CTRL + ENTER works perfectly!