Text FormattingJustified and lowercase Text with Syllabification in Headers

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

Justified and lowercase Text with Syllabification in Headers

Post by AleCes »

Hello everybody, on this:

Code: Select all

\documentclass[a4paper, 12pt]{book}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[LE]{\leftmark}
\fancyhead[RO]{\rightmark}
\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text}
\setmainfont{FreeSerif}
\usepackage{polyglossia}
\setmainlanguage{english}
\usepackage{xunicode}
\usepackage{xltxtra}
\usepackage{bookmark}
\usepackage{blindtext}

\begin{document}
  \chapter{testchapter}
    \blindtext[4]

    \section{testsec1}
      \blindtext[4]

    \section{testsec2}
      \blindtext[4]
\end{document}
I'd like to get my headers on lowercase (instead of small caps), with a justified and syllabified text. How can I do that?

Thanks

Recommended reading 2024:

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

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

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

Justified and lowercase Text with Syllabification in Headers

Post by localghost »

As the fancyhdr documentation describes in Section 9, you have to use \nouppercase to get lowercase header text.

It's not clear to me why you need hyphenation in your header. Perhaps you can provide an appropriate example instead of one that does not demonstrate this problem.


Thorsten
AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

Justified and lowercase Text with Syllabification in Headers

Post by AleCes »

localghost wrote:As the fancyhdr documentation describes in Section 9, you have to use \nouppercase to get lowercase header text.

It's not clear to me why you need hyphenation in your header. Perhaps you can provide an appropriate example instead of one that does not demonstrate this problem.


Thorsten
Because I like hyphenation, I'd like to get it even in chapter titles, is there a way to get it?
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Justified and lowercase Text with Syllabification in Headers

Post by Johannes_B »

Could you please replace the \chapter{testchapter} with one real example showing the problem? At least I guess that's what you mean ...
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

Justified and lowercase Text with Syllabification in Headers

Post by AleCes »

Johannes_B wrote:Could you please replace the \chapter{testchapter} with one real example showing the problem? At least I guess that's what you mean ...
I didn't do it because it's not in English, it's in Serbian, anyway:

Code: Select all

\chapter{Ираклијева династија. Арабљанска опасност и преображај царства у VI веку (610-717 г.)}
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Justified and lowercase Text with Syllabification in Headers

Post by Johannes_B »

Code: Select all

\chapter{Ираклијева династија. Арабљанска опасност и преображај царства у VI веку (610-717 г.)}
You can give an optional title, appearing in the table of contents and headers/footers, for example:

Code: Select all

\chapter[black and yellow bees]{Why bees are black and yellow all around the world}
I guess nobody is going to read the whole header anyway.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Justified and lowercase Text with Syllabification in Headers

Post by localghost »

AleCes wrote:Because I like hyphenation, I'd like to get it even in chapter titles, is there a way to get it?
Actually I expected a serious answer and not one that lets me think that I waste my time here. I just requested an example that shows the hyphenation problem. No more, no less.
AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

Justified and lowercase Text with Syllabification in Headers

Post by AleCes »

localghost wrote:
AleCes wrote:Because I like hyphenation, I'd like to get it even in chapter titles, is there a way to get it?
Actually I expected a serious answer and not one that lets me think that I waste my time here.
Because my titles are long and I don't like devising a shorter form thereof for usage in the header. I prefer it to be the same.
AleCes
Posts: 286
Joined: Sat Nov 13, 2010 9:54 pm

Justified and lowercase Text with Syllabification in Headers

Post by AleCes »

AleCes wrote:
localghost wrote:
AleCes wrote:Because I like hyphenation, I'd like to get it even in chapter titles, is there a way to get it?
Actually I expected a serious answer and not one that lets me think that I waste my time here.
Because my titles are long and I don't like devising a shorter form thereof for usage in the header. I prefer it to be the same.
Is it not enough as an answer? How can I provide you with examples "with hyphenation problems" if hyphenation is disabled in them? Please let me know! The real issue is, I want to learn how to customize headers with fancyhdr.
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

Justified and lowercase Text with Syllabification in Headers

Post by Johannes_B »

Code: Select all

\documentclass[a4paper, 12pt]{book}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead{}
\fancyhead[LE]{\nouppercase{\leftmark}}
\fancyhead[RO]{\nouppercase{\rightmark}}
\usepackage{fontspec}
\defaultfontfeatures{Mapping=tex-text}
\setmainfont{Linux Libertine O}%changed that, i don't like free serif
\usepackage{polyglossia}
\setmainlanguage{english}% Well, it's not really english
\usepackage{xunicode}
\usepackage{xltxtra}
\usepackage{bookmark}
\usepackage{blindtext}

\begin{document}
\chapter[Ираклијева династија]{Ираклијева династија. Арабљанска опасност и
    преображај царства у VI веку (610-717 г.)}
\blindtext[4]
\chapter{Ираклијева династија. Арабљанска опасност и
    преображај царства у VI веку (610-717 г.)}
\end{document}
This contains the information provided by you, suggestions by Thorsten. and me added. Right now i still cannot see, we you need hyphenation, but it might be the different font.

After all, headers are just for orientation (Where in the book am i right now?) and should therefore be kept short. Compare the headheight of the first chapter (the one with the optional argument) with the second one. The logfile gives you an explanation:

Code: Select all

Package Fancyhdr Warning: \headheight is too small (14.49998pt): 
 Make it at least 27.22604pt.
 We now make it that large for the rest of the document.
 This may cause the page layout to be inconsistent, however.
You need to manually adjust the headheight everytime you change your headings.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply