Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

何番目の偶数ページか

6 views
Skip to first unread message

NAKAJI Hiroyuki

unread,
Feb 21, 2006, 10:13:36 PM2/21/06
to
中治です。

A4の2ページ分をならべてB4に縮小した配布資料を作るとき、

2、4、6、…ページに1、2、3、…と番号を振りたいのですが、\ifoddを使うとして、
どうするのが正しいでしょうか?

今、下記のソースで空の2ページの文書を作ったところ、2頁目に「No.0」と出て
きます。何かを間違えていることはたしかなのですが、直せないでいます。

\documentclass[11pt,twoside]{jarticle}
\usepackage{fancyhdr}

\newcounter{Page}
\makeatletter
\def\Page{\Page=\page
\ifodd\Page\advance\Page by1\fi
\divide\Page by2\relax}
\makeatother

\begin{document}
\pagestyle{fancy}

\fancyhead{}
\fancyhead[RE]{\large\bf No.\thePage}
\renewcommand{\headrulewidth}{0pt}
\fancyhfoffset{0pt}
\fancyfoot{}

\mbox{}
\newpage{}
\mbox{}

\end{document}
--
NAKAJI Hiroyuki (中治 弘行)

Akira Kakuto

unread,
Feb 22, 2006, 8:50:14 AM2/22/06
to

"NAKAJI Hiroyuki" <nak...@takamatsu-nct.ac.jp> wrote in message news:87r75w8...@roddy.c3922.takamatsu-nct.ac.jp...

\newcounter{Page}
\makeatletter
\def\PPage{\c@Page\c@page%
\ifodd\c@Page\advance\c@Page by 1\fi
\divide\c@Page by 2}
\makeatother

\begin{document}
\pagestyle{fancy}

\fancyhead{}
\fancyhead[RE]{\PPage\large\bf No.\thePage}

NAKAJI Hiroyuki

unread,
Feb 22, 2006, 9:20:52 AM2/22/06
to
>>>>> In <q_ZKf.2028$R62....@news-virt.s-kddi1.home.ne.jp>
>>>>> "Akira Kakuto" <kak...@fuk.kindai.ac.jp> wrote:

> \newcounter{Page}
> \makeatletter
> \def\PPage{\c@Page\c@page%
> \ifodd\c@Page\advance\c@Page by 1\fi
> \divide\c@Page by 2}
> \makeatother

> \begin{document}
> \pagestyle{fancy}

> \fancyhead{}
> \fancyhead[RE]{\PPage\large\bf No.\thePage}

なるほど、そのようにするとできるのですね。ありがとうございます。

早速、来週から始まる学年末テストに使わせていただきます。

0 new messages