![付録からページ番号を削除する](https://rvso.com/image/330745/%E4%BB%98%E9%8C%B2%E3%81%8B%E3%82%89%E3%83%9A%E3%83%BC%E3%82%B8%E7%95%AA%E5%8F%B7%E3%82%92%E5%89%8A%E9%99%A4%E3%81%99%E3%82%8B.png)
付録セクションからすべてのページ番号を削除しようとしています。次の修正方法が提案されました: コンテンツのページ番号を抑制する「インタールード環境」を作成します。(ソース:ページ数に加算されない中間ページはありますか?)
これは付録セクションのほとんどのページで機能しますが、付録見出し、章見出し、または参考文献見出しを含むすべてのページでは、番号がまだ表示されます。おそらく、これがコマンドに組み込まれているのは、それらが TOC に含まれるようにするためですが、これは私にとっては問題ではありません。
\documentclass[11pt]{report}
\usepackage[utf8]{inputenc}
\usepackage[
backend=biber,
style=numeric,
sortlocale=de_DE,
natbib=true,
url=false,
doi=true,
eprint=false
]{biblatex}
\bibliography{references}
\usepackage[toc,page]{appendix}
%create interlude environment:
\newcounter{mypagecount}% create a new counter
\setcounter{mypagecount}{0}% set it to something just in case
\newenvironment{interlude}{% create a new environment for the unnumbered section(s)
\clearpage
\setcounter{mypagecount}{\value{page}}% use the new counter we created to hold the page count at the start of the unnumbered section
\thispagestyle{empty}% we want this page to be empty (adjust to use a modified page style)
\pagestyle{empty}% use the same style for subsequent pages in the unnumbered section
}{%
\clearpage
\setcounter{page}{\value{mypagecount}}% restore the incremented value to the official tally of pages so the page numbering continues correctly
}
\begin{document}
body of document
\begin{interlude}
\begin{appendices}
\chapter{Code Name}
\label{codename}
code
\chapter{Name of more code}
more code
\end{appendices}
\pagebreak
\printbibliography
\end{interlude}
\end{document}
Charles Stewart は、ここで「区切りページ」から番号を削除するための修正を提案しています (彼は appendix.sty ソースを編集しています)。確かに、これを使用すると付録の区切りページの番号が解除されますが、章の見出しページに対してこれを変更する方法がわかりません。 https://stackoverflow.com/questions/2631973/no-page-number-for-divider-pages-in-latex
答え1
空にして適切なページ スタイルを使用することをお勧めします\thepage
。さらに、カウンターも使用しましたsuspended
がpage
、これは私の見解では実際には必要ありません。
\documentclass[11pt]{report}
\usepackage{appendix}
\usepackage[
backend=biber,
style=numeric,
sortlocale=de_DE,
natbib=true,
url=false,
doi=true,
eprint=false
]{biblatex}
\usepackage{xassoccnt}
\usepackage{fancyhdr}
\bibliography{references}
\usepackage{blindtext}
\pagestyle{fancy}%
\begin{document}
\tableofcontents
\chapter{Regular chapter}
\blindtext[20]
\nocite{*}
\SuspendCounters{page}
\renewcommand{\thepage}{}
\begin{appendices}
\chapter{Code Name}
\label{codename}
\blindtext[5]
\chapter{Name of more code}
\blindtext[10]
\end{appendices}
\pagebreak
\printbibliography
\end{document}
この小さなreferences.bib
@book{knuth1986texbook,
keywords = {book},
title={The texbook},
author={Knuth, D.E. and Bibby, D.},
volume={1993},
year={1986},
publisher={Addison-Wesley}
}
@article{knuth1977fast,
keywords = {article},
title={Fast pattern matching in strings},
author={Knuth, D.E. and Morris Jr, J.H. and Pratt, V.R.},
journal={SIAM journal on computing},
volume={6},
number={2},
pages={323--350},
year={1977},
publisher={SIAM}
}
答え2
appendix
パッケージも環境も必要ないと思いますinterlude
。ある時点 (付録の開始) でページ番号付けを抑制した場合、後で再開することはできません。
\documentclass[11pt]{report}
\usepackage[utf8]{inputenc}
\usepackage[
backend=biber,
style=numeric,
sortlocale=de_DE,
natbib=true,
url=false,
doi=true,
eprint=false
]{biblatex}
\addbibresource{biblatex-examples.bib}
% no need to load etoolbox
\makeatletter
\preto{\appendix}{%
\cleardoublepage
\pagestyle{empty}%
\let\ps@plain\ps@empty
\let\thepage\@empty
\addcontentsline{toc}{chapter}{Appendices}%
\part*{Appendices}%
}
\makeatother
\begin{document}
\tableofcontents
\chapter{Main}
body of document
\cite{weinberg}
\cite{yoon}
\appendix
\chapter{Code Name}
\label{codename}
code
\clearpage
code
\chapter{Name of more code}
more code
\clearpage
more code
\printbibliography
\end{document}
コツはplain
、章の開始ページで使用されるページ スタイルを と同じにすることですempty
。
ちなみに、を使用する場合は、\addbibresource
よりも が優先されることに注意してください。\bibliography
biblatex