>[TeX] | >[Package] | >[fancyhdr] Version: 4.1 2022-11-09 |
[パッケージについて] |
[articleの場合] [bookの場合] [reportの場合] |
[articleの場合] |
---|
1.
\pagestyle{fancy} \rhead{\leftmark} \lhead{\rightmark}
|
各節の始まりに\section{最初} \thispagestyle{fancy}を入れることで、他のページと同じ様式になります。 |
2.
\pagestyle{fancy} \lhead{} \chead{Headerの真ん中} \rhead{\thepage} \cfoot{}
|
3.
\pagestyle{fancy} \lhead{} \chead{Headerの真ん中} \rhead{\thepage} \lfoot{左下} \cfoot{Fotterの真ん中} \rfoot{\thepage} \renewcommand{\footrulewidth}{0.4pt}
|
破線にしたときは
\renewcommand\headrule{\vspace{-8pt}\dotfill}を用いる。 二重線にしたときは \makeatletter \def\headrule{{% \if@fancyplain\let\headrulewidth\plainheadrulewidth\fi \hrule\@height\headrulewidth\@width\headwidth\vskip2pt% \hrule\@height\headrulewidth\@width\headwidth\vskip-\headrulewidth\vskip-4pt }} \makeatotherをの前に入れます。 |
4.
\usepackage{lastpage} \pagestyle{fancy} \lhead{} \rhead{} \cfoot{\thepage{}/{}\pageref{LastPage}}
|
|
5. 上の状況にhyperrefを組み合わせる。 \cfoot{\thepage{}/{}\protect\pageref*{LastPage}}に変更します。 |
6. 右上にページ数を”1/総ページ数”の形で表示。他は、なし。 \usepackage{lastpage} \pagestyle{fancy} \lhead{} \rhead{\thepage{}/{}\pageref{LastPage}} \cfoot{} \renewcommand{\headrulewidth}{0pt} |
7. ヘッダーの左は”日付”、右は\oldstyenumsの書体でページ数。フッターの右にも同じ書体でページ数。 \usepackage{lastpage} \pagestyle{fancy} \lhead{\today} \rhead{[\ \scshape\oldstylenums{\thepage}\ / % \scshape\oldstylenums{\pageref{LastPage}}\ ]} \cfoot{} \rfoot{[\ \scshape\oldstylenums{\thepage}\ / % \scshape\oldstylenums{\pageref{LastPage}}\ ]} |
8. フッターの左にタイトルを入れる。ページ数は、右。 \pagestyle{fancy} \let\origtitle\title \renewcommand{\title}[1]{\lfoot{#1}\origtitle{#1}} \cfoot{} \rfoot{\thepage} |
9. フッターの真ん中に著者を入れる。ページ数は、右。 \pagestyle{fancy} \let\origauthor\author \renewcommand{\author}[1]{\cfoot{#1}\origauthor{#1}} \lfoot{} \rfoot{\thepage} |
10. 用紙左上に図を入れる。 |
11. 用紙右上に図を入れる。 |
textpos参照。 |
12. 最後のページの表示を変える。 |
13. ページスタイルの定義を用いる。 |
14. ページスタイルの定義を用いる。 |
15. ページスタイルの定義を用いる。 |
16. twosideを指定し、1頁目はタイトルページ、2ページ目以降でfancyhdrを利用。 |
TeX -- etc 2参照。 |
17. twosideを指定し、 奇数ページは左フッター部分に文字 偶数ページは右ヘッダー部分にページ数、右フッター部分に文字列 を入れる。 |
色をつける。 |
18. twosideを指定し、 奇数ページは左フッター部分に文字 偶数ページは右ヘッダー部分にページ数、右フッター部分に文字列 を入れ、ヘッダー部は偶数ページと奇数ページで異なるものを表示する。 |
19. twosideを指定し、ツメを付ける。 |
出席表:geometry、listliketab、lastpage、longtable、makecellを伴う。 |
|
|
1. fancyhdrを入れなく、 \makeatletter \def\@oddhead{\dotfill{\normalfont 暑い}\dotfill} \def\@oddfoot{\normalfont\rmfamily\dotfill Page \thepage\dotfill} \def\ps@titlepage{\let\@oddhead\@empty} \makeatotherをプレアンブルに入れる。 |
2. \usepackage[pagestyles]{titlesec} \newpagestyle{myps}[\small\sffamily\slshape]{ \headrule \sethead{タイトル}{\sectiontitle}{\usepage}} \pagestyle{myps}を入れる。 |
3. ファイル名、日付、ページ数・総ページ数を入れる。 |
4. ページ数を-で囲む。 |
[articleの場合] [bookの場合] [reportの場合] |
Tips |
Package Fancyhdr Warning: \headheight is too small (12.0pt): Make it at least 15.0pt. We now make it that large for the rest of the document. This may cause the page layout to be inconsistent, however.というような警告が出たときは、 \setlength{\headheight}{15pt}をプレアンブルに入れると警告がなくなります。 |
fancyheadingsを用いると下記のような警告がでます。
Package fancyheadings Warning: Please stop using fancyheadings! (fancyheadings) Use fancyhdr instead. (fancyheadings) We will call fancyhdr with the very same (fancyheadings) options you passed to fancyheadings. (fancyheadings) (fancyheadings) fancyhdr is 99 percent compatible with (fancyheadings) fancyheadings. The only incompatibility is (fancyheadings) that \headrulewidth and \footrulewidth and (fancyheadings) their \plain... versions are no longer length (fancyheadings) parameters, but normal macros (to be changed (fancyheadings) with \renewcommand rather than \setlength).. |
[パッケージについて] |
[articleの場合] [bookの場合] [reportの場合] |