2

(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.

5
  • 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.
    – raphink
    Commented Sep 6, 2011 at 7:56
  • What is this #+LaTeX_HEADER: kind of syntax you're using? I've never seen that before.
    – raphink
    Commented Sep 6, 2011 at 8:38
  • @Raphink: It's syntax of the Emacs Org mode for export to LaTeX.
    – mhp
    Commented Sep 6, 2011 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
    Commented Sep 6, 2011 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
    Commented Sep 6, 2011 at 8:58

2 Answers 2

2

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.

1
  • 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
    Commented Sep 6, 2011 at 8:52
0

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.

1
  • 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
    Commented Sep 6, 2011 at 8:22

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .