Page Layoutproblems with sectionmark

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
Post Reply
sil
Posts: 12
Joined: Mon Sep 14, 2009 4:22 pm

problems with sectionmark

Post by sil »

Hi,

I had some problems with the header of certain pages because my section titles were quite long. I found that I could use the \sectionmark command to include the short title in the header but the complete one in the table of contents. This command solved most of my problems, but there is one page which begins with a new section where the header is not correct (so it seems that the \sectionmark is not working in this case). I tried to write the \sectionmark command right before the section but it did not work..

Does anybody know how I could solve it?

Thanks!!

Silvia

Recommended reading 2024:

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

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

User avatar
Stefan Kottwitz
Site Admin
Posts: 10324
Joined: Mon Mar 10, 2008 9:44 pm

problems with sectionmark

Post by Stefan Kottwitz »

Hi Silvia,

in that case call \sectionmark twice like this:

Code: Select all

\section[short or original version]{original version%
  \sectionmark{head mark version}}
\sectionmark{head mark version}
Stefan
LaTeX.org admin
sil
Posts: 12
Joined: Mon Sep 14, 2009 4:22 pm

Re: problems with sectionmark

Post by sil »

It works!!!! Thanks a lot Stefan!!
yftk54
Posts: 1
Joined: Sun May 23, 2010 5:58 pm

problems with sectionmark

Post by yftk54 »

Hello,

I had the same problem and hopefully found that solution, thank you.
In the first place, I tried without the option :

Code: Select all

\section{original version%
  \sectionmark{head mark version}}
\sectionmark{head mark version}
which led to the error "Fatal error occurred, no output PDF file produced".

Apparently, the "option" is required for this trick to work :

Code: Select all

\section[short or original version]{original version%
  \sectionmark{head mark version}}
\sectionmark{head mark version}
But this it really black magic to me. Shouldn't we consider that it is a bug when the section mark is not correctly set by \sectionmark{...} ? Where shall it be signaled ? Or has it already been signaled ?

Best regards,

O.C.
thefloyd
Posts: 1
Joined: Wed Mar 07, 2012 8:34 pm

Re: problems with sectionmark

Post by thefloyd »

Hi,

I'm having trouble since this doesn't work in the book class (at least not for me).

Any help?

Thanks

Diego
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

problems with sectionmark

Post by localghost »

thefloyd wrote:[…] I'm having trouble since this doesn't work in the book class (at least not for me). […]
For an adequate problem description you should prepare a proper minimal example. And perhaps it's better to open a new thread instead of hijacking a solved topic and possibly refer to this topic here by a link.


Thorsten
Post Reply