`minitoc` 无法正常工作,并且 `3-column-index` 的显示存在问题

`minitoc` 无法正常工作,并且 `3-column-index` 的显示存在问题

我发现 latex 格式 统计分析原理_免费_v1.0.pdf紧凑而优雅,具有 2 列文本、每章的 minitoc、3 列索引等;并且我想尽可能以最小的方式粗略地重现它(即,仅加载必要的包和设置),如下所示:

\documentclass[a4paper,oneside,openany,9pt]{book}

\usepackage{lipsum}\usepackage{xcolor}

\usepackage{geometry}
\geometry{papersize={23cm,15cm}}
\geometry{top=1.5cm,bottom=1cm,left=1cm,right=1cm}

\usepackage{hyperref}
\hypersetup{bookmarksopen,bookmarksdepth=3}
\hypersetup{colorlinks=true,hidelinks}

\usepackage{fancyhdr}\pagestyle{fancy}\fancyhf{}
\fancyhead[L]{\slshape\nouppercase{\rightmark}}
\fancyhead[R]{\thepage}
\renewcommand{\headrulewidth}{1pt}
\renewcommand{\footrulewidth}{0pt}

%\renewcommand\thepart{\Alph{part}}
%\usepackage{titlesec}
%\titleformat{\part}[display]
%  {\normalfont\Huge\bfseries\filcenter}
%  {\MakeUppercase{\partname}~\thepart}{1pc}
%  {\MakeUppercase}
%\titleformat{\chapter}[display]
%  {\normalfont\Large\rmfamily\filcenter}
%  {\MakeUppercase{\chaptertitlename}~\thechapter}{1pc}
%  {{\color{brown}\titlerule[2pt]}\vspace{1pc}\MakeUppercase}
%\titleformat{name=\chapter,numberless}[display]
%  {\normalfont\bfseries\LARGE}{}{1pc}
%  {\MakeUppercase}

\usepackage{minitoc}
\usepackage{multicol}
\usepackage{natbib}
\usepackage{makeidx}

\begin{document}

\title{
Principles of Statistical Analysis\\
Statistical Inference based on Randomization
}
\author{Ery Arias-Castro}
\date{}
\maketitle

\clearpage %\cleardoublepage

\frontmatter

\twocolumn

\begin{center}
\chapter*{Publication}\label{publication}
\addcontentsline{toc}{chapter}{Publication}
\end{center}

\lipsum[1]
\vfill
Version of August 18, 2019

\begin{center}
\chapter*{Dedication}\label{dedication}
\addcontentsline{toc}{chapter}{Dedication}
\end{center}

\lipsum[2]

\dominitoc
\tableofcontents
\addcontentsline{toc}{chapter}{Contents}

\clearpage

\mainmatter

\part{Elements of Probability Theory}

\chapter{AXIOMS OF PROBABILITY THEORY}

\minitoc

\section{Elements of set theory}
\lipsum[4]

\section{Outcomes and events}
\lipsum[5]

\section{Probability axioms}
\lipsum[6]

\section{Inclusion-exclusion formula}
\lipsum[7]

\section{Conditional probability and independence}
\lipsum[8]

\section{Additional problems }
\lipsum[9]

\backmatter

\chapter{BIBLIOGRAPHY}
%\bibliographystyle{unsrtnat}
%\nocite{*}
%\bibliography{ref.bib}
%\addcontentsline{toc}{chapter}{BIBLIOGRAPHY}
\lipsum[20-23]

\clearpage

\chapter{INDEX}

\begin{multicols}{3}
\lipsum[10-15]
\end{multicols}

\end{document} 

然而,两个主要问题超出我的预期:

  • [1]minitoc for each chapter不起作用;

  • [2] 的显示3-column-index有问题。

另外,我可以忍受的一些其他小问题是:

  • (1)标题页后有空白页(\clearpage\cleardoublepage失败);

  • (2)\begin{center}不工作出版物奉献

  • (3)\twocolumn设置不工作内容

我该如何解决这些问题两个主要问题 [1] 和 [2]

答案1

我建议使用etoc而不是minitoc

.mtc由于它使用文件,因此编译速度更快,并且不会使工作目录因大量文件而变得混乱.aux。更重要的是:它与 一起工作titlesec

添加样式\etocsettocstyle{<code before>}{<code after>}并在文档中\minitoc替换。\localtableofcontents

A

\documentclass[a4paper,oneside,openany,9pt]{book}

\usepackage{lipsum}\usepackage{xcolor}

\usepackage{geometry}
\geometry{papersize={23cm,15cm}}
\geometry{top=1.5cm,bottom=1cm,left=1cm,right=1cm}

\usepackage{hyperref}
\hypersetup{bookmarksopen,bookmarksdepth=3}
\hypersetup{colorlinks=true,hidelinks}

\usepackage{fancyhdr}\pagestyle{fancy}\fancyhf{}
\fancyhead[L]{\slshape\nouppercase{\rightmark}}
\fancyhead[R]{\thepage}
\renewcommand{\headrulewidth}{1pt}
\renewcommand{\footrulewidth}{0pt}

%\renewcommand\thepart{\Alph{part}}
%\usepackage{titlesec}
%\titleformat{\part}[display]
%  {\normalfont\Huge\bfseries\filcenter}
%  {\MakeUppercase{\partname}~\thepart}{1pc}
%  {\MakeUppercase}
%\titleformat{\chapter}[display]
%  {\normalfont\Large\rmfamily\filcenter}
%  {\MakeUppercase{\chaptertitlename}~\thechapter}{1pc}
%  {{\color{brown}\titlerule[2pt]}\vspace{1pc}\MakeUppercase}
%\titleformat{name=\chapter,numberless}[display]
%  {\normalfont\bfseries\LARGE}{}{1pc}
%  {\MakeUppercase}

%\usepackage{minitoc}

\usepackage{etoc} % added <<<<<<<<<<<<
\etocsetnexttocdepth{section} %list up to and including section


\usepackage{multicol}
\usepackage{natbib}
\usepackage{makeidx}

\begin{document}
    
    \title{
        Principles of Statistical Analysis\\
        Statistical Inference based on Randomization
    }
    \author{Ery Arias-Castro}
    \date{}
    \maketitle
    
    \clearpage %\cleardoublepage
    
    \frontmatter
    
    \twocolumn
    
    \begin{center}
        \chapter*{Publication}\label{publication}
        \addcontentsline{toc}{chapter}{Publication}
    \end{center}
    
    \lipsum[1]
    \vfill
    Version of August 18, 2019
    
    \begin{center}
        \chapter*{Dedication}\label{dedication}
        \addcontentsline{toc}{chapter}{Dedication}
    \end{center}
    
    \lipsum[2]
    
%   \dominitoc
    \tableofcontents
    \addcontentsline{toc}{chapter}{Contents}
    
    \clearpage
    
    \etocsettocstyle{\vskip-2\baselineskip}{\vskip0.5\baselineskip} % etoc style for local TOC <<<<<<<<<<<<<
    
    \mainmatter
    
    \part{Elements of Probability Theory}
    
    \chapter{AXIOMS OF PROBABILITY THEORY}
    
    \localtableofcontents % local TOC <<<<<<<<< 
    
    \section{Elements of set theory}
    \lipsum[4]
    
    \section{Outcomes and events}
    \lipsum[5]
    
    \section{Probability axioms}
    \lipsum[6]
    
    \section{Inclusion-exclusion formula}
    \lipsum[7]
    
    \section{Conditional probability and independence}
    \lipsum[8]
    
    \section{Additional problems }
    \lipsum[9]
    
    \backmatter
    
    \chapter{BIBLIOGRAPHY}
    %\bibliographystyle{unsrtnat}
    %\nocite{*}
    %\bibliography{ref.bib}
    %\addcontentsline{toc}{chapter}{BIBLIOGRAPHY}
    \lipsum[20-23]
    
    \clearpage
    
    \chapter{INDEX}
    
    \begin{multicols}{3}
        \lipsum[10-15]
    \end{multicols}
    
\end{document} 

更新 后续问题之后<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

现在etoc一起 使用titlesec

帕

etoc要使用add获取两列目录

\bgroup
\etocsettocstyle{\twocolumn{\noindent\parbox{\columnwidth}{\centering\normalfont\bfseries\LARGE \MakeUppercase{Contents}}}\vspace{3pc} \par}{\thispagestyle{plain}} % two column ToC <<<<<<<<<<     
\tableofcontents
\egroup

续

要将未编号章节的标题居中,请使用

\titleformat{name=\chapter,numberless}[display]
  {\normalfont\bfseries\LARGE\filcenter}{}{1pc}
  {\MakeUppercase}

要更正 INDEX 的输出,请使用

\newgeometry{papersize={23cm,15cm},top=1.5cm,bottom=1cm,left=1cm,right=1cm}     % added <<<<<<<<<<<<<<<<    
\chapter{Index} 
\markright{Index}
\begin{multicols}{3}                
    \lipsum[10-15]
\end{multicols}

在

要将“出版物”和“献词”标题置于第一列中央,请使用\chapterx{<title>}

普

标题页后有一页空白且未编号的页面。

\documentclass[a4paper,oneside,openany,9pt]{book}

\usepackage{lipsum}\usepackage{xcolor}

\usepackage{geometry}
\geometry{papersize={23cm,15cm}}
\geometry{top=1.5cm,bottom=1cm,left=1cm,right=1cm}

\usepackage{hyperref}
\hypersetup{bookmarksopen,bookmarksdepth=3}
\hypersetup{colorlinks=true,hidelinks}

\usepackage{fancyhdr}
\pagestyle{fancy}\fancyhf{}
\fancyhead[L]{\slshape\nouppercase{\rightmark}}
\fancyhead[R]{\thepage}
\renewcommand{\headrulewidth}{1pt}
\renewcommand{\footrulewidth}{0pt}

\renewcommand\thepart{\Alph{part}}
\usepackage{titlesec}
\titleformat{\part}[display]
{\normalfont\Huge\bfseries\filcenter}
{\MakeUppercase{\partname}~\thepart}{1pc}
{\MakeUppercase}
\titleformat{\chapter}[display]
{\normalfont\Large\rmfamily\filcenter}
{\MakeUppercase{\chaptertitlename}~\thechapter}{1pc}
{{\color{brown}\titlerule[2pt]}\vspace{1pc}\MakeUppercase}
\titleformat{name=\chapter,numberless}[display]
{\normalfont\bfseries\LARGE\filcenter}{}{1pc}
{\MakeUppercase}

\usepackage{etoc} % added <<<<<<<<<<<<
\etocsetnexttocdepth{section} %list up to and including section

\usepackage{multicol}
\usepackage{natbib}
\usepackage{makeidx}

\newcommand{\chapterx}[1]{% center the title  in the first columns added <<<<<<<<<<<<<<
\clearpage\noindent\parbox{\columnwidth}{\centering\normalfont\bfseries\LARGE \MakeUppercase{{#1}}}\vspace{3pc}\thispagestyle{plain}\parindent0pt\addcontentsline{toc}{chapter}{#1}\markright{#1}}
        
\begin{document}

\title{
    Principles of Statistical Analysis\\
    Statistical Inference based on Randomization
}
\author{Ery Arias-Castro}
\date{}
\maketitle
\null\mbox{}\thispagestyle{empty}   % added to have an unnumbered blank page <<<<<<<<<< 
    
\frontmatter

\twocolumn

\chapterx{Publication}\label{publication}       % changed <<<<<<<<<<<<<<<<

\lipsum[1-2]
\vfill
Version of August 18, 2019
        
\chapterx{Dedication}\label{dedication}         % changed <<<<<<<<<<<<<<<<
\lipsum[2]

\bgroup
\etocsettocstyle{\twocolumn{\noindent\parbox{\columnwidth}{\centering\normalfont\bfseries\LARGE \MakeUppercase{Contents}}}\vspace{3pc} \par}{\thispagestyle{plain}} % two column ToC <<<<<<<<<<     
\tableofcontents
\egroup

\addcontentsline{toc}{chapter}{Contents}

\etocsettocstyle{\vskip-2\baselineskip}{\vskip0.5\baselineskip} % etoc style for local TOC <<<<<<<<<<<<<
\etocsetstyle{section}{}{}{\parbox{5ex}{\etocnumber}~\etocname \hfill {\color{brown} \etocpage}\par}{} % style for sections

\mainmatter

\part{Elements of Probability Theory}

\chapter{AXIOMS OF PROBABILITY THEORY}      

\localtableofcontents % local TOC <<<<<<<<< 

\section{Elements of set theory}
\lipsum[4]

\section{Outcomes and events}
\lipsum[5]

\section{Probability axioms}
\lipsum[6]

\section{Inclusion-exclusion formula}
\lipsum[7]

\section{Conditional probability and independence}
\lipsum[8]

\section{Additional problems }
\lipsum[9-10]

\backmatter

\chapter{Bibliography}  % changed <<<<<<<<<<<<<<<<
\markright{Bibliography}
%\bibliographystyle{unsrtnat}
%\nocite{*}
%\bibliography{ref.bib}
\lipsum[20-25]
\clearpage
        
\newgeometry{papersize={23cm,15cm},top=1.5cm,bottom=1cm,left=1cm,right=1cm}     % added <<<<<<<<<<<<<<<<    
\chapter{Index} 
\markright{Index}
\begin{multicols}{3}                
    \lipsum[10-15]
\end{multicols}

\end{document} 

相关内容