Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

(Warning: Question from newbie to LaTeX :-)

Using koma-article in Org-mode, I want to show "X of Y" in the footer of all pages. I followed the instructions in this post, and it works fine for pages 2 and after, but the first page shows only "1" in the footer.

I have the following:

#+TITLE: Title
#+AUTHOR: Author
#+DATE: Today
#+OPTIONS:   H:3 num:nil toc:t \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t
#+OPTIONS:   TeX:t LaTeX:nil skip:nil d:nil todo:t pri:nil tags:not-in-toc
#+LaTeX_CLASS: koma-article
#+LaTeX_HEADER: \usepackage{lastpage}
#+LaTeX_HEADER: \usepackage{scrpage2}
#+LaTeX_HEADER: \pagestyle{scrheadings}
#+LaTeX_HEADER: \cfoot{\thepage\ of \pageref{LastPage}}

Adding the following 2 lines to the above makes the footer on the first page to show "1 of Y" as wanted, but then the title and author is missing from the top of the first page (although the date still shows at the top):

#+LaTeX_HEADER: \maketitle
#+LaTeX_HEADER: \thispagestyle{scrheadings}

How do I show "1 of Y" on the first page while keeping the title and author format intact?

Thank you in advance for any advice.

share|improve this question
    
Hello and welcome to TeX.SX! The best way to embed code in your questions is to simply paste it and indent it by 4 spaces. –  ℝaphink Sep 6 '11 at 7:56
    
What is this #+LaTeX_HEADER: kind of syntax you're using? I've never seen that before. –  ℝaphink Sep 6 '11 at 8:38
    
@Raphink: It's syntax of the Emacs Org mode for export to LaTeX. –  mhp Sep 6 '11 at 8:42
    
These are Emacs Org-mode in-buffer settings prefixes. Everything after the : gets passed to the LaTeX exporter from Org-mode, as I understand it. –  Toby Sep 6 '11 at 8:45
    
@Toby: You don't need to specify \maketitle explicitly since \maketitle should be automatically added by the Org mode export function. Moreover, #+LaTeX_HEADER: \thispagestyle{scrheadings} is not much good as this will be exported to the preamble (before \begin{document}). –  mhp Sep 6 '11 at 8:58
add comment

2 Answers

up vote 2 down vote accepted

Try

...
#+LaTeX_HEADER: \pagestyle{scrheadings}
#+LaTeX_HEADER: \renewcommand*{\titlepagestyle}{scrheadings}
...

Then, the style of the page containing the (in-page) title is the same as the main page style.

share|improve this answer
    
Brilliant! That's fixed it. Thank you both for your help. I've been searching through the KOMA-Script guide and online for ages trying to figure it out. Much appreciated! –  Toby Sep 6 '11 at 8:52
add comment

When using scrpage2 with scrheadings, you need to specify the whole headers and footers yourself. Here, you've only specified the \cfoot, so you need to also specify the header.

share|improve this answer
    
Hi Raphink, That you for the tip. I tried adding a header with: '#+LaTeX_HEADER: \ohead{\thepage\ of \pageref{LastPage}}' but unfortunately it still does not show on the first page without unless I use '#+LaTeX_HEADER: \maketitle #+LaTeX_HEADER: \thispagestyle{scrheadings}' which removes the title and author from the top of the first page. –  Toby Sep 6 '11 at 8:22
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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