LyX ⇒ Fancy Heading too long.
Fancy Heading too long.
I have signed up as I am writing a report on LyX - I'm using the fancy headings, they're generally fine; however, on my Chapter called Literature Review & Background theory, the title is too long.
I would like to keep the name the same, but name it just Literature Review in the header bar.
I have managed to name all the subsequent pages Literature Review, but then all of my other chapter were incorrect, also the font was slightly off I think.
I would appreciate any help.
Thanks,
Mat.
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
Fancy Heading too long.
However, short titles are used not only for headers, but for Table of Contents too. If you want short titles only in headers, but full titles in TOC, then the easiest way would be to use titlesec package, with option toctitles. All you have to do is to type into the preamble (Document > Settings > LaTeX Preamble) the following code:
Code: Select all
\usepackage[toctitles]{titlesec}
Re: Fancy Heading too long.
The short title is excellent, just what I was looking for.
Strangely the titlesec package isn't doing what it should, however. It has no effect on the TOC, and still displays the short title.

Re: Fancy Heading too long.
Re: Fancy Heading too long.
I have chopped down my report, so that you can see the problem in Chapter 2.
Thanks.
- Attachments
-
- Title testing.zip
- (1.3 KiB) Downloaded 400 times
Fancy Heading too long.
Code: Select all
\chaptermark{A Shorter Title}
Re: Fancy Heading too long.
I added the short title again and it allowed me to create the PDF (But that messed up my TOC again). In the end, I made my 'short title' the same as my actual title, then used your code after it for the short title in my chapter marks.
Slightly strange, but had proved effective - can't thank you enough!
Fancy Heading too long.
If you put the ERT box after the chapter title in the next line, as standard paragraph, the error shouldn't occur. Or add \protect command in front of \chaptermark.Tsportmat wrote:Hello, I added that and deleted my 'shorter title', it then said TeX capacity exceeded, sorry [stack capacity=5000].
I added the short title again and it allowed me to create the PDF (But that messed up my TOC again). In the end, I made my 'short title' the same as my actual title, then used your code after it for the short title in my chapter marks.
Slightly strange, but had proved effective - can't thank you enough!
Re: Fancy Heading too long.
