0

I have been given a preamble prepared for writing in English, but I am writing in Danish. And at the top of page there is a small header, e.g.,

Chapter 8. My native chapter title

And I would like to change that to

Kapitel 8. My native chapter title

And by commenting out this line in my preamble this header disapears

\makeoddhead{my_page_style}{}{\small\sffamily\leftmark}{}

So, how do I modify this \makeoddhead to show chapter in my language? N.B. I am using Memoir.

3
  • \usepackage[danish]{babel} in the preamble should do.
    – egreg
    Apr 12, 2013 at 7:53
  • I tried that without success
    – jens
    Apr 12, 2013 at 8:01
  • Without seeing your preamble it's impossible to say more. You should use that line nonetheless, in order to ensure correct hyphenation for Danish. Say also \usepackage[T1]{fontenc}.
    – egreg
    Apr 12, 2013 at 8:07

2 Answers 2

2

Danish babel does work, so would you please show us what you did in the first place. You should be using \chaptername to refer to the name (actually \@chapapp is better).

Plus there is no need for that test inside \chaptermark, this does the same thing

\createmark{chapter}{left}{shownumber}{\@chapapp\ }{. \ }

(from the default definition of headings in memoir.

0

I fixed it by modifying the line with the comment "THIS LINE!!" - I didn't show all the code - sorry for that. Was convinced it was the \makeoddhead line that should be modified

\makepagestyle{my_page_style}
\makeoddhead{my_page_style}{}{\small\sffamily\leftmark}{}
\makeoddfoot{my_page_style}{}{}{\small\sffamily\thepage}
\setlength{\parindent}{0pt}
\makeatletter
\makepsmarks{my_page_style}{%
  \renewcommand\chaptermark[1]{%
    \markboth{%
      \ifnum \value{secnumdepth} > 1
      \if@mainmatter % 
      \ Kapitel \thechapter. \ % THIS LINE!!
      \fi
      \fi
      ##1}{}}%
  \renewcommand\tocmark{\markboth{\contentsname}{\contentsname}}%
  \renewcommand\lofmark{\markboth{\listfigurename}{\listfigurename}}%
  \renewcommand\lotmark{\markboth{\listtablename}{\listtablename}}%
  \renewcommand\bibmark{\markboth{\bibname}{\bibname}}%
  \renewcommand\indexmark{\markboth{\indexname}{\indexname}}%
  \renewcommand\sectionmark[1]{\markright{##1}}%
  \renewcommand\subsectionmark[1]{\markright{##1}}%
  \renewcommand\subsubsectionmark[1]{\markright{##1}}%
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.