ページ番号を再開せずに本のタイトルページを2つ作成する

ページ番号を再開せずに本のタイトルページを2つ作成する
\documentclass[11pt,twoside]{book}
\input{Brillpreamble}
\begin{document}
\frontmatter
\include{titleBrill}
\include{abbrevBrill}
\include{prefaceandintroBrill}
\mainmatter
\input{./title1.tex}
\include{text1}
\input{./title2.tex}
\include{text2}
\backmatter
\printindex[nominum]
\printindex[rerum]
\pagestyle{myheadings}
\include{Biblio}
\end{document}

これは私の序文ですBrillコード:

% XeLaTeX can use any Mac OS X font. See the setromanfont command below.
% Input to XeLaTeX is full Unicode, so Unicode characters can be typed directly into the source.

% The next lines tell TeXShop to typeset with xelatex, and to open and save the source with Unicode encoding.

%!TEX TS-program = xelatex
%!TEX encoding = UTF-8 Unicode

\usepackage{booktabs}
\usepackage{ledmac}
\linenummargin{inner}
\sidenotemargin{outer}
\usepackage{fancyhdr}
\usepackage{adforn}
\usepackage{amsmath}
\usepackage{lmodern}
\pagestyle{myheadings}
\usepackage{hanging}
\usepackage{pdfpages}
\textheight = 180.5 mm
\textwidth = 108.5 mm
\pagenumbering{arabic}
\usepackage[hang]{footmisc}
\setlength{\footnotemargin}{12pt}
\makeatletter
\renewcommand\@makefntext[1]{%
  \noindent\makebox[1em][r]{\@makefnmark}#1}
\makeatother
\usepackage{imakeidx} 
\makeindex[name=nominum, title=Index nominum, columns=2]
\makeindex[name=rerum, title=Index rerum, columns=2]
\pretolerance=100
\usepackage{microtype}
\makeatletter
% And in the paragraphed footnotes, I'd like no colon too:
\def\parafootfmt#1#2#3{%
  \normal@pars
  \parindent=0pt \parfillskip=0pt plus 1fil
  {\bf\printlines#1|}%
  {\select@lemmafont#1|#2}~%
  #3\penalty-10 }
\makeatother
\let\Afootfmt\parafootfmt

%\newcommand{\rhet}[2]{\edtext{#1}{\Afootnote{#2}}}
\newcommand{\rhet}[2]{\edtext{ #1}{\Afootnote{] #2}}}
\newcommand{\oed}[2]{\edtext{ #1}{\Bfootnote{] #2}}}
\footparagraph{A}
\footparagraph{B}

%%%%%%%%%%%%%%%%
\raggedbottom


\newcommand*{\LeftWidth}{3.0cm}%
\newcommand*{\RightWidth}{\dimexpr\linewidth-\LeftWidth-2em\relax}%
\newcommand{\AlignedBrace}[2]{%
    \medskip\par\noindent%
    \parbox{\LeftWidth}{\raggedleft\textbf{#1}\strut~}%
    $\left\{~\parbox{\RightWidth}{\strut\textit{#2}\strut}\right.$%
}%


%\usepackage{geometry}                % See geometry.pdf to learn the layout options. There are lots.
%\geometry{a4paper}                   % ... or a4paper or a5paper or ... 
%\geometry{landscape}                % Activate for for rotated page geometry
%\usepackage[parfill]{parskip}    % Activate to begin paragraphs with an empty line rather than an indent
\usepackage{graphicx}

\usepackage{amssymb}
%\renewcommand %These two commands are for double-spacing
%\baselinestretch{2}

% Will Robertson's fontspec.sty can be used to simplify font choices.
% To experiment, open /Applications/Font Book to examine the fonts provided on Mac OS X,
% and change "Hoefler Text" to any of these choices.

\usepackage{fontspec,xltxtra,xunicode}
\defaultfontfeatures{Mapping=tex-text}
\setromanfont[Mapping=tex-text]{Brill}
\setsansfont[Scale=MatchLowercase,Mapping=tex-text]{Gill Sans}
\setmonofont[Scale=MatchLowercase]{Andale Mono}
\frenchspacing

\newfontfamily{\H}[Scale=0.9]{Lucida Grande}
\usepackage{caption}
\captionsetup{aboveskip=5pt}

\def\changemargin#1#2{\list{}{\rightmargin#2\leftmargin#1}\item[]}
\let\endchangemargin=\endlist

答え1

の問題\maketitleは、 を使用して呼び出された後に、それ自体を無効にするコマンドであることです(など\global\let\maketitle\relaxについても同様です\title) 。\author

これは、関連するコードを再定義する\maketitleか、使用して削除することで無効にできます。\xpatch

これにより、ページ番号の再開が防止されます。

次の原因は、 が暗黙的にbookを使用することですtitlepage。このオプションを使用すると、 maketitle は を使用し、\begin{titlepage}...\end{titlepage}ページ番号を自動的にリセットします。

notitlepageとりあえずここではバージョンを提供し、titlepage後で完全なバージョンを入手しようと思います。

\documentclass[notitlepage]{book}



\usepackage{xpatch}

\newcounter{titlescntr}

\makeatletter

\xpatchcmd{\maketitle}{\par
}{%
  \par%
  \stepcounter{titlescntr}
  \ifnum\value{titlescntr} > 0 
  \cleardoublepage
  \fi
}{}{}

\xpatchcmd{\maketitle}{%
  \global\let\thanks\relax
  \global\let\maketitle\relax
  \global\let\@maketitle\relax
  \global\let\@thanks\@empty
  \global\let\@author\@empty
  \global\let\@date\@empty
  \global\let\@title\@empty
  \global\let\title\relax
  \global\let\author\relax
  \global\let\date\relax
  \global\let\and\relax
}{%
  \clearpage
}{\typeout{Patched!}}{\typeout{Patching failed!}}

\makeatother

\title{Two treatises} 
\author{Guillaume Coatalen} 
\date{} 

\usepackage{blindtext}

\begin{document}

\maketitle 

\title{Theory of Brontosaurs}
\author{Ann Elk}
\maketitle

\blindtext


\end{document}

titlepage更新:が使用されている場合のページ番号のリセットを削除

\documentclass[titlepage]{book}
\usepackage{xpatch}
\newcounter{titlescntr}

\makeatletter

\if@titlepage
\xpatchcmd{\maketitle}{%
  \global\let\thanks\relax
  \global\let\maketitle\relax
  \global\let\@thanks\@empty
  \global\let\@author\@empty
  \global\let\@date\@empty
  \global\let\@title\@empty
  \global\let\title\relax
  \global\let\author\relax
  \global\let\date\relax
  \global\let\and\relax
}{%
}{\typeout{patched maketitle for titlepage}}{}

\xpatchcmd{\titlepage}{%
  \setcounter{page}\@ne
}{%
}{\typeout{patched titlepage}}{}

\xpatchcmd{\endtitlepage}{%
  \setcounter{page}\@ne
}{%
}{\typeout{patched endtitlepage}}{}

\else

\xpatchcmd{\maketitle}{\par
}{%
  \par% 
  \stepcounter{titlescntr}
  \ifnum\value{titlescntr} > 0 % Make a new page for the next title
  \cleardoublepage
  \fi
}{}{}

\xpatchcmd{\maketitle}{%
  \global\let\thanks\relax
  \global\let\maketitle\relax
  \global\let\@maketitle\relax
  \global\let\@thanks\@empty
  \global\let\@author\@empty
  \global\let\@date\@empty
  \global\let\@title\@empty
  \global\let\title\relax
  \global\let\author\relax
  \global\let\date\relax
  \global\let\and\relax
}{%
  \clearpage
}{\typeout{Patched!}}{\typeout{Patching failed!}}
\fi

\makeatother

\title{Two treatises} 
\author{Guillaume Coatalen} 
\date{} 

\usepackage{blindtext}

\begin{document}

\maketitle 

\title{Theory of Brontosaurs}
\author{Ann Elk}
\maketitle

\blindtext


\end{document}

答え2

私は怠け者です。もし誰かがすでにその仕事をしていて、私がそれを利用できるのであれば、彼らが「ホイール」と呼ぶ新しい発明のさまざまな設計をじっくり調べるのに時間を費やす必要はないと思います。


私は使うだろうツールボックスタイトルにデフォルトで使用するtitlepage環境にパッチを当て、bookタイトル残りをやってください。

\usepackage{etoolbox,titling}
\makeatletter
\patchcmd{\titlepage}{\setcounter{page}\@ne}{}{\message {Successfully patched titlepage.}}{\message {Failed to patch titlepage.}}
\makeatother

このパッチは、titlepagebyの使用\maketitleによる番号付けスキームの再開を停止するだけです。ただし、メイン マターで最初にアラビア数字に切り替えると、\mainmatter自動的に処理されるため、1 から番号が付けられます。

読み込み中タイトル通常の、、、コマンドを文書内で何度でも使用できるよう\titleになります。\author\date\maketitle

\title{Title 1}
\author{Author 1}
\date{Date 1}
\maketitle

\title{Title 2}
\author{Author 2}
\date{Date 2}
\maketitle

[私は の使用に反対ではありません\maketitleが、誤解されると望ましくない影響が出る可能性があり、おそらく不幸な名前が付けられています。いずれにせよ、 は使いやすく、ここでのコードはシンプルに保たれているので、他のコンテキストでの馬の価値について一般的な疑問があったとしても、与えられた馬の口を調べる理由はないと思います。]

すでに と を使用しているため\frontmatter、クラスではデフォルトで前付に小文字のローマ数字、本付にアラビア数字が使用される\mainmatterため、ページ番号の種類の設定について心配する必要はありません。book

\frontmatter

1 から始まる小文字のローマ数字に切り替わります。

\mainmatter

その後、アラビア数字に切り替わり、カウントが 1 から再開されます。

2つのタイトルページ、小文字のローマ字と連続アラビア数字

完全なコード:

\documentclass[11pt]{book}
\usepackage{etoolbox,titling}
\makeatletter
\patchcmd{\titlepage}{\setcounter{page}\@ne}{}{\message {Successfully patched titlepage.}}{\message {Failed to patch titlepage.}}
\makeatother
\pagestyle{myheadings}
\usepackage{kantlipsum}
\begin{document}
\frontmatter
\kant[1-5]
\mainmatter
\title{Title 1}
\author{Author 1}
\date{Date 1}
\maketitle
\kant[6-10]
\title{Title 2}
\author{Author 2}
\date{Date 2}
\maketitle
\kant[11-15]
\backmatter
\kant[16-20]
\end{document}

関連情報