非線形ページ番号付き Latex 両面フォーマット

非線形ページ番号付き Latex 両面フォーマット

次のような問題があります:

最初の部分にローマ数字、2 番目の部分にアラビア数字で番号を付ける Latex ドキュメントを作成する必要があります。アラビア数字は 1 から始まる必要があります。さらに、間にページ数に加算されない空白ページをいくつか追加する必要があります。これらすべてにより、セットアップの余白が台無しになりますtwoside

次に例を示します。

\documentclass[11pt, bibliography=totoc, twoside]{article}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{abstract}
\usepackage{graphicx}
\graphicspath{{images/}{../images/}}
\usepackage{enumitem}
\usepackage{natbib}
\usepackage[onehalfspacing]{setspace}

\usepackage{subfiles}
\usepackage{siunitx}
\sisetup{per-mode=fraction}
\usepackage{amsmath}
\usepackage[many]{tcolorbox}

\usepackage{float}
\usepackage{acronym}
\usepackage{geometry}
\usepackage{hyperref}
\hypersetup{colorlinks,linkcolor=black,urlcolor=blue,citecolor=blue}
\usepackage{fancyhdr}

\usepackage{blindtext}
\usepackage{xcolor}
\usepackage{booktabs}
\usepackage{listings}
\usepackage{tabularx}
\usepackage{ltablex}
\usepackage{caption} 

\makeatletter
\g@addto@macro\@floatboxreset\centering
\makeatother

\definecolor{TU_blue}{RGB}{0, 102, 153}

\fancyhf{}
\fancyhead[LO]{left}
\fancyhead[RE]{right}
\fancyfoot[C]{\thepage}
\setlength{\headheight}{14pt}
\pagestyle{fancy}

\title{dummy}
\author{my name}
\date{December 2019}

\begin{document}

\maketitle
\newpage\null\thispagestyle{empty}\addtocounter{page}{-1}\newpage

\pagestyle{fancy}
\pagenumbering{Roman} 

\addcontentsline{toc}{section}{Acknowledgements}
\section*{Acknowledgements}
\blindtext
\newpage\null\thispagestyle{empty}\addtocounter{page}{-1}\newpage


\addcontentsline{toc}{section}{Abstract}
\section*{Abstract}
\blindtext
\newpage\null\thispagestyle{empty}\addtocounter{page}{-1}\newpage

\addcontentsline{toc}{section}{Abstract German}
\section*{Abstract German}
\blindtext
\newpage\null\thispagestyle{empty}\addtocounter{page}{-1}\newpage

\tableofcontents 
\newpage


\section*{List of Abbreviations}
\addcontentsline{toc}{section}{List of Abbreviations}
\markboth{List of Abbreviations}{LIST OF ABBREVIATIONS}
\begin{acronym}\itemsep0pt
\acro{ABC}{Alphabet}
\end{acronym}
\newpage

\listoffigures
\addcontentsline{toc}{section}{\listfigurename}
\newpage

\listoftables
\addcontentsline{toc}{section}{\listtablename}
\newpage


\pagenumbering{arabic} 
\section{Introduction}
\blindtext
\newpage

\section{Section 2}
\blindtext[4]
\subsection{subsection 2.1}
\blindtext[4]
\subsection{subsection 2.2}
\blindtext[4]
\subsection{subsection 2.3}
\blindtext[4]
\subsection{subsection 2.4}
\blindtext[4]
\newpage

\blindtext
\newpage


\end{document}

タイトルページ、謝辞、概要、概要(ドイツ語)はすべて右側に配置してください。ただし、空白ページを作らずに番号を付けるようにしてください。

「目次」から始めて、テキストは両面に表示されます。両面の「表の一覧」と「概要」は左ページとしてフォーマットされます。

現時点でかなり混乱しているので、もう 1 つ小さな質問をします。最初のページが正しいページのはずですが、正しいでしょうか?

答え1

MWE はもっとミニマルにすべきです。あなたの例では多くのパッケージは必要ありません。

自分自身に問いかけてください。文書の種類準備する。これは別の質問です文書の見た目はどうなっているか

MWE で、両面レイアウトのドキュメントを定義しました。両面レイアウトは、 のようなクラスのデフォルトですbook

クラス(articleまたはbook)に関係なく、次の文書を準備する必要があります。明白なこの点はいくら強調してもしすぎることはありません。両面レイアウトの文書を作成する場合、すべてのページに連続したページ番号が必要です。番号を印刷しないようにすることもできますが、番号は依然として存在するため、次のページは次の大きな番号になります。

あなたの質問から引用します:

タイトルページ、謝辞、概要、概要(ドイツ語)はすべて右側に配置してください。

articleこのことから、 は正しい選択ではないという結論に至りました。 代わりにreport、 または さえもbookクラスを選択する必要があります。 標準の LaTeX クラス、および KOMA-Script の置換クラスは、新しい章を の右側で開始します。もちろん、奇数ページ番号で識別することもできます。

でも、

ただし、空白ページを作らずにページ番号を付けるようにしてください。

上で説明したように、空白ページにページ番号が印刷されないようにすることができます。KOMA-Script はデフォルトでこれを実行します。

それとも、空白のページは数えられた? これにより、ページ番号が右ページであっても偶数になる可能性があります。すべての伝統を破ることになるのですか? 私はそれを強くお勧めしません!

もう一度、あなたの質問から引用します:

「目次」から始めて、テキストは両面に表示されます。両面の「表の一覧」と「概要」は左ページとしてフォーマットされます。

何を意味しているのか全く分かりません。LaTeX コードの結果について説明していますか? もしそうなら、それで大丈夫ですか?

標準の LaTeX クラス (reportおよびbook) とそれらの KOMA 置換は、前の章が右ページで終了している場合、新しい章を左側でも開くことができます。コマンドopenanyにクラス オプションを挿入するだけです。 、 、の\documentclassデフォルトでは、新しい章は右手 (奇数ページ) で開きます。したがって、デフォルトのオプションは です。reportscrreprtbookscrbookopenright

繰り返しになりますが、どちらのオプションを選択しても、ドキュメント全体のすべての章が、ドキュメント内の前の章と同じように扱われます。つまり、例外は発生しません。同じルール (openany または openright) が適用されます。これは良い判断です。

現時点でかなり混乱しているので、もう 1 つ小さな質問をします。最初のページが正しいページのはずですが、正しいでしょうか?

はい、その通りです。1 は奇数です。伝統的な規則では、本の印刷では奇数はすべて右ページになります。


不要なパッケージをすべて削除して、MWE を修正しました。1 冊の本を含む参考文献データベースを追加し、テキストにコマンドも追加しました。さらに重要なことは、クラスから非常に強力なKOMA-Script クラスに\cite切り替えたことです。articlescrbook

「あなたの」文書は現在ブックタイプなので、セクションコマンドを 1 レベル上にアップグレードしました。\sectionが に変更されました\chapter

\frontmatterおよびコマンドを追加して\mainmatter、ローマ字とアラビア語のページ番号を自動的に切り替え、同様の試みを削除しました。 および はブック クラスに特有のもの\frontmatter\mainmatter、記事やレポート クラスでは使用できません (LaTeX でも KOMA-Script でも)。 ただし、 を使用すると、\frontmatter\chapter の番号も変更されます。番号は付けられませんが、目次に組み込まれます。 簡単です。 :-)

頭字語の可能性については、頭字語マニュアルを注意深くお読みください。makeindex の助けを借りて、略語のリストを自動的に取得できます...

ドキュメントの最後に、\appendix通常のドキュメントを終了して付録を開始するためのコマンドを追加しました。 ご覧のとおり、このコマンドはセクション コマンドの扱いを に変更します\chapter。 今回は、章に番号ではなく文字が付けられます。

また、 による参考文献も追加しました\printbibliography。これは、BibLaTeX とバイナリを使用していることを前提としていますbiber。KOMA スクリプト クラスのオプションを使用しliststotocて、bibtotoc図表のリストと表のリスト、および参考文献が目次にリストされることを確認します。これも簡単です。:-)

私の仮定とそれに基づく修正を皆さんが受け入れていただけることを願っています。これが私の「改良された」MWE です。失礼にならないようにアドバイスします。「シンプルに、わかりやすく」。文書を書き始めてください。レイアウトについてはあまり心配しないでください (少なくともプロセスの初期段階では)。LaTeX は高品質の文書を作成します (印刷の観点から)。

書くことを楽しんでください。残りは少しずつ進んでいきます。きっと。


\documentclass[11pt, openright, liststotoc, twoside]{scrbook}
% \documentclass[11pt, openright, twoside]{book}
% \documentclass[11pt, openany, twoside]{book}

\usepackage[english]{babel}
\usepackage[utf8]{inputenc}
\usepackage{acronym}
\usepackage{blindtext}

%% Needed for the bibliography
\usepackage[backend=biber,style=numeric]{biblatex}
\begin{filecontents}{\jobname.bib}
@Manual{class:scrguide,
  title =    {{KOMA-Script}},
  author =   {Kohm, Markus},
  month =    May,
  year =     2016,
  url =      {http://www.komascript.de/~mkohm/scrguide.pdf},
  langid =   {ngerman},
  note =     {Bestandteil der Online-Dokumentation von \LaTeX,
                  Datei \texttt{scr\-guide.pdf}},
  keywords =     {manual},
}
\end{filecontents}
\bibliography{\jobname}

%% Maybe you don't need this in KOMA any more?
% \usepackage{fancyhdr}
% \fancyhf{}
% \fancyhead[LO]{left}
% \fancyhead[RE]{right}
% \fancyfoot[OL]{\thepage}
% \fancyfoot[ER]{\thepage}
% \pagestyle{fancy}

\title{dummy}
\author{my name}
\date{December 2019}

\begin{document}

%% Frontmatter starts the preliminaries and uses roman pagenumbers
\frontmatter

\maketitle

\chapter{Acknowledgements}
\blindtext

\chapter{Abstract}
\section*{German}
\blindtext[4]
\section*{English}
\blindtext[7]

%% Start the table of contents and further lists here
\tableofcontents
\listoffigures
%% only needed in book.cls.  KOMA class option "liststotoc" add these
%% entries automagically
% \addcontentsline{toc}{chapter}{\listfigurename}
\listoftables
%% only needed in book.cls.  KOMA class option "liststotoc" add these
%% entries automagically
% \addcontentsline{toc}{chapter}{\listtablename}

%% New: print the nomenclature/abbreviations here.  See package
%% acroynm handbook (texdoc acronym)!
% \printnomenclature

\chapter{List of Abbreviations}
\begin{acronym}\itemsep0pt
\acro{ABC}{Alphabet}
\end{acronym}


%% Here ends the preliminaries and the normal document starts.  The
%% \mainmatter command switches the page numbers to be arabic.
\mainmatter
\chapter{Introduction}
\blindtext

\chapter{Section 2}
\blindtext[4]
\section{subsection 2.1}
\blindtext[4]
\section{subsection 2.2}
\blindtext[4]
\section{subsection 2.3}
\blindtext[4]
\cite{class:scrguide}
\blindtext[3][2]

\section{subsection 2.4}
\blindtext[4]

%% What should this command be good for?
% \newpage

%% End of the document.  Start the appendencies
\appendix

\chapter{Some Appendix}
\blindtext[6]

\chapter{Next Appendix}

\section{First Subappendix}
\blindtext[4]

\section{Another Subappendix}
\blindtext[7]

%% Finally the bibliography
\printbibliography{}


%% Same as above!
% \newpage


\end{document}

関連情報