用于多位作者的期刊式汇编的 Documentclass

用于多位作者的期刊式汇编的 Documentclass

我正在寻找一个 documentclass 来实现以下目的:我想排版一个汇编(一本书或一卷期刊),其中包含完全独立的文章(我在这里将其称为“贡献”,只是为了不将它们与 latex- 混淆\documentclass{article}),每篇文章均由不同的作者提供。研究一些这样的汇编书籍使我发现 documentclass 应满足以下标准要求:

  1. 每份投稿均应在目录中列出其各自的作者

  2. 每篇投稿都应从新的(奇数)页开始

  3. 捐款不应被编号

  4. 贡献内容不得带有任何附录,如“章节”或类似内容,无论是在目录中,还是在文档本身或文档标题中

  5. 每篇贡献的“章节”编号应从“1”开始(而不是从“0.1”开始)

  6. 当前投稿的(短)标题和作者应显示在文档的页眉中(偶数页显示作者,奇数页显示标题)

  7. toc 只显示每个贡献的标题和作者,而不是其各自的分段结构

  8. 每篇贡献的脚注编号应从“1”重新开始

我确信有一种方法可以通过对 \documentclass{book} 进行大量操作来实现这一点,就像这里描述的解决方案一样:

但总的来说,这些都是一堆东西,而且——此外,我需要花费大量时间来详细了解所有这些操作,以便根据我的需求进行调整——在我看来,它们很丑陋。所以我想知道是否有一个预定义的文档类,可以提供上述所有功能,或者至少“更接近”我想要的解决方案。

答案1

好吧,我以我称之为丑陋的方式解决了这个问题,即操纵书籍类。这是我的最小示例,它满足了线程开头要求的所有要求。以防万一,其他人想要类似的东西:

\documentclass{book}

\newcommand\contributionauthor{}
\newcommand\contributiontitle{}
\newcommand\ctitle{}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%   chapter  and section    %%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% to supress "chapter n" before each chapter we use \chapter*
% the solution with titlesec
%   \usepackage{titlesec}
%       \titleformat{\chapter}[display]
%       {\normalfont\bfseries}{}{0\Large\centering\scshapet}{\huge}
% does not work, since it seems to interfer with \usepackage{sectsty}
% which we want to use lateron to center the chapter- and section headings

% since we want the section numbering to start from 1 in each contribution
% we have to tell \chapter* to reset the section counter
% for the same reason we have to reset the footnote counter
\newcommand*\contribution{\setcounter{section}{0} \setcounter{footnote}{0}\chapter}

%center chapter, section, subsection and subsubsection headings
\usepackage{sectsty}
    \allsectionsfont{\centering}

%let section numbering start at "1." (instead of "0.1")
\renewcommand\thesection{\arabic{section}}

% show \contributionauthor after title oft chapter
\usepackage{suffix}
    \newcommand\chapterauthor{\printchapterauthor{\contributionauthor}\authortoc
    {\contributionauthor}}\WithSuffix\newcommand\chapterauthor*[1]
        {\printchapterauthor{#1}}

\makeatletter
\newcommand{\printchapterauthor}[1]{%
  {\parindent0pt\vspace*{-35pt}%
  \linespread{1.1}\Large\centering\scshape#1%
  \par\nobreak\vspace*{40pt}}
  \@afterheading%
}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%          headers          %%% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\usepackage{fancyhdr}
    % clear header
    \fancyhead{}
    % show author of the contribution in the header of even pages
    \fancyhead[CE]{\textsc{\contributionauthor}}
    % show title of the contribution in the header of odd pages
    \fancyhead[CO]{\contributiontitle}
    % activate the headerstyle  
    \pagestyle{fancy}

% suppress header on those empty pages standardly produced by \cleardoublepage 
% (in twosided documents \cleardoublepage lets every new chapter start on an odd page) 
\makeatletter
    \renewcommand*{\cleardoublepage}{\clearpage\if@twoside \ifodd\c@page\else
    \hbox{}%
    \thispagestyle{empty}%
    \newpage%
    \if@twocolumn\hbox{}\newpage\fi\fi\fi}
\makeatother

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%      table of contents    %%% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% show \contributionauthor in toc
\newcommand{\authortoc}[1]{%
  \addtocontents{toc}{\vskip -35pt}%
  \addtocontents{toc}{%
    \protect\contentsline{chapter}%
    {\mdseries\scshape\protect\normalsize#1}{}{}}
  \addtocontents{toc}{\vskip 35pt}%
}

% set depth of toc 0, so only chaptertitles appear, no section or subsections
\setcounter{tocdepth}{0}

\makeatother

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%      document itself      %%% 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{document}

\tableofcontents

\renewcommand\ctitle{First Contribution}
\contribution*{\ctitle}\addcontentsline{toc}{chapter}{\ctitle}
\renewcommand\contributiontitle{First Contribution}
\renewcommand\contributionauthor{Jane Doe}
\chapterauthor{}

\section{Section}
\subsection{Subsection}
\subsubsection{Subsubsection}
This is to show you that headings of sections and subsections and subsubsections are centered.\footnote{This is the first footnote.}
\newpage
\section{Another Section}
This page only exists to show you that header-behaviour is working on verso and recto pages.\footnote{This is the second footnote}
\newpage
This page only exists to show you that header-behaviour is working on verso and recto pages. Also have a look on the next (completely) blank page, which is automatically added by \textbackslash cleardoublepage to ensure that next chapter starts on an odd page. It does not have a header nor a footer.

\renewcommand\ctitle{Second Contribution}
\contribution*{\ctitle}\addcontentsline{toc}{chapter}{\ctitle}
\renewcommand\contributiontitle{Second Contribution}
\renewcommand\contributionauthor{John Doe}
\chapterauthor{}

\section{Again, a new section}
But since it is part of new contribution, it is numbered by "1."\footnote{This is the third footnote in the document, but the first in the current contribution, so it is numbered by "1"}

\section{One remark on the definition of a new contribution title}
We want the same title to appear in toc and in the heading of the contribution. That's why the title of the contribution is given to \{\}ctitle to print it in the chapter-title and in the toc. But the contribution title must not be given to the fancyheader before the \textbackslash chapter*, since else the header would change even one page before.

\end{document}

相关内容