[Tex/LaTex] LyX: Problems with title line breaks when writing in Memoir document style

line-breakinglyxmemoirtitles

I am pretty new both to LyX and to TeX.SX, and have no LaTeX background. I'm writing my master's thesis in LyX and have just changed the document style from book to book (Memoir). When I try to export to pdf (using pflatex), I get two error messages (1 and 2 below):

1)

Argument of \reserved@a has an extra }.

2)

Paragraph ended before \reserved@ was complete.

The explanations read:

1)

{\Large{ Masteroppgave i lingvistikk}}} 
I've run across a `}' that doesn't seem to match anything. 
For example, `\def\a#1{...}' and
`\a}' would produce this error. If you simply proceed now, the `\par'
that I've just inserted will cause me to report a runaway argument
that might be the root of the problem. But if your `}' was spurious,
just type `2' and it will go away.

2)

{\Large{ Masteroppgave i lingvistikk}}}
I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.`

Masteroppgave i lingvistikk is the last part of the my title, simply meaning 'Master thesis in linguistics'. I have separated my thesis title into three lines, using justified line breaks. All lines of the title are in title style, but they have different font sizes.

It seemed to work all right when I used the book document class, but after changing to Memoir something goes wrong.

EDIT: I've tried using ordinary vspace instead of justified line breaks, but then the pdf only shows one of the line breaks, the second one is somehow ignored.

EDIT: I'll try to make a minimal example (though I have never made one before):

\documentclass[norsk,english,oldfontcommands]{memoir}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setcounter{secnumdepth}{2}
\setcounter{tocdepth}{2}
\usepackage{babel}
\begin{document}
\selectlanguage{norsk}%

\title{{\huge{<<Første linje av første tittel, andre linje av hovedtittel>>
}}\linebreak{}
\linebreak{}
{\Large{Første linje av undertittel, og andre linje}}\linebreak{}
\linebreak{}
{\Large{Masteroppgave}}}\selectlanguage{english}%
\maketitle

\end{document}

Best Answer

If I understand correctly what you're after, you can try the following in LyX to create your title:

  1. Add the title via the drop down menu.
  2. Write your main title. If you want a line break in the middle of it, hit Ctrl + Enter.
  3. Add some vertical space with Insert --> Formatting --> Vertical space. If you use Custom you can define the length yourself.
  4. Write the subtitle, again using Ctrl + Enter for a line break.
  5. Again, add some vertical space.
  6. Write "Masteroppgave".
  7. Select the subtitle and "Masteroppgave", right click the text, choose Text style --> Customized, set the size to Larger, and hit OK.

enter image description here

A working LaTeX example. I added some vertical space between the main title and the subtitle with \\[<length>]. As Barbara mentioned in the comments, \huge, \large etc. are switches, not commands that take an argument, so I removed the braces after those.

\documentclass[norsk,english,oldfontcommands]{memoir}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\begin{document}
\title{\huge <<Første linje av første tittel, \\
andre linje av hovedtittel>> \\[2cm]
\Large Første linje av undertittel,\\ og andre linje
\\[1cm]
Masteroppgave}
\maketitle    
\end{document}
Related Question