[XeTeX] Search and replace (removing line break) for chapter title used in header

Pander pander at users.sourceforge.net
Wed Jun 24 13:09:46 CEST 2009


Pander wrote:
> Hi all,
> 
> Is it possible to do a search and replace which removes line breaks from
> the chapter's title which I use in (fanncy) header?
> 
> Sometimes, the title of a chapter looks better with a manual line break.
> This is no problem for the table of contents, it replaces the line break
> with a space. Fancy header is not replacing this, resulting in a line
> break in the heading.
> 
> How can I do this in manually in my definition:
>   \fancyhead[LO]{\footnotesize \leftmark}
> 
> Or/and is this a bug for fancyheader and how can it be solved there, in
> a similar way the table of contents is dealing with this?
> 
> Thanks,
> 
> Pander

possible fix is:

\fancyhead[LE,RO]{\def\\{ }\slshape\rightmark}
\fancyhead[LO,RE]{\def\\{ }\slshape\leftmark}

or:

\fancyhead[LO]{\let\\\space \footnotesize \leftmark}

and before the last run of xelatex, run this:

if [ -e $(TARGET).toc ]; then sed -ie 's/\\\\/ /g' $(TARGET).toc; fi

to fix the toc which was also showing the \\, unlike I had described
earlier.

Regards,

Pander


More information about the XeTeX mailing list