LyXFancy Heading too long.

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
Tsportmat
Posts: 5
Joined: Sat Jul 16, 2011 1:02 pm

Fancy Heading too long.

Post by Tsportmat »

Hello everyone, this is my first post.

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.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX books
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Fancy Heading too long.

Post by meho_r »

There is more than one way to do this. The usual one is to use short titles for long entries: click in front of a long title, go to Insert > Short Title and type in Literature.

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}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Tsportmat
Posts: 5
Joined: Sat Jul 16, 2011 1:02 pm

Re: Fancy Heading too long.

Post by Tsportmat »

Hello, thanks for you reply.

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. :?:
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Re: Fancy Heading too long.

Post by meho_r »

Can you post an example .lyx file which shows the issue with titlesec, please? Put it into a ZIP archive and attach it to your next post.
Tsportmat
Posts: 5
Joined: Sat Jul 16, 2011 1:02 pm

Re: Fancy Heading too long.

Post by Tsportmat »

Thanks for your reply again.

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 390 times
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Fancy Heading too long.

Post by meho_r »

OK, it seems that toctitles works for sections, but not chapters. So, for chapters, try adding the following code after the long title (Note: use Ctrl+L to open an ERT box in which you'll type this code):

Code: Select all

\chaptermark{A Shorter Title}
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Tsportmat
Posts: 5
Joined: Sat Jul 16, 2011 1:02 pm

Re: Fancy Heading too long.

Post by Tsportmat »

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!
meho_r
Posts: 823
Joined: Tue Aug 07, 2007 5:28 pm

Fancy Heading too long.

Post by meho_r »

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!
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
Posts: 5
Joined: Sat Jul 16, 2011 1:02 pm

Re: Fancy Heading too long.

Post by Tsportmat »

Spot on once again - thankyou! :mrgreen:
Post Reply