ToC,章节问题,在章节号旁边添加一个点

ToC,章节问题,在章节号旁边添加一个点
\documentclass[openany, 10pt]{book}
\usepackage[utf8]{inputenc}
\usepackage[MeX]{polski}
\usepackage{titleps}
\usepackage[Lenny]{fncychap}

%\usepackage{tocloft}
\makeatletter
    \renewcommand\@seccntformat[1]{\csname the#1\endcsname.\quad}
    \renewcommand\contentsname{Spis}
    \renewcommand\numberline[1]{#1.\hskip0.7em}
    %\renewcommand{\cftchapleader}{\cftdotfill{\cftdotsep}}
\makeatother

\newcommand\MyTitle{\scshape Pacjent i Analityk}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead[LE,RO]{\normalsize\thepage}
\fancyhead[RE]{\scriptsize \textsc{\leftmark}}
\fancyhead[LO]{\scriptsize \textsc{\MyTitle}}
\fancyfoot[L,C,R]{}


 \frenchspacing

 %style form chapter
      %http://zoonek.free.fr/LaTeX/LaTeX_samples_chapter/0.html
 \usepackage{pstcol}
 \makeatletter
     \def\LigneVerticale{\vrule height 5cm depth 2cm\hspace{0.1cm}\relax}
     \def\LignesVerticales{
     \let\LV\LigneVerticale\LV\LV\LV\LV\LV\LV\LV\LV\LV\LV}
     \def\GrosCarreAvecUnChiffre#1{%
     \rlap{\vrule height 0.8cm width 1cm depth 0.2cm}%
     \rlap{\hbox to 1cm{\hss\mbox{\white #1}\hss}}%
     \vrule height 0pt width 1cm depth 0pt}

     \def\@makechapterhead#1{\hbox{%
     \huge 
     \LignesVerticales
     \hspace{-0.5cm}%
     \GrosCarreAvecUnChiffre{\thechapter}
     \hspace{0.2cm}\hbox{#1}%
     \renewcommand\numberline[1]{#1.\hskip0.7em}
   }\par\vskip 2cm}

   \def\@makeschapterhead#1{\hbox{%
   \huge 
   \LignesVerticales
   %\hspace{0.5cm}%
   \hbox{#1}%
   }\par\vskip 2cm}

   \newcommand\MySquare{% thanks to Gonzalo Medina
     %http://tex.stackexchange.com/users/3954/gonzalo-medina
   \leavevmode\hbox to 1.2ex{\hss\vrule height .9ex width .7ex depth -.2ex\hss}}
   \renewcommand\labelitemi{\MySquare}

   \usepackage{titletoc}

   \title{Foo is getting older}
   \author{Joseph Bar}
   \date{}

   \begin{document}
   \maketitle



   \frontmatter
       \tableofcontents
\chapter*{Chapter whitout a number}
\addcontentsline{toc}{chapter}{Chapter without a number}

\mainmatter
    \chapter{Solution}\label{chap:one}
    \section{One}
    \section{Two}
    \section{Another section}
    \chapter{Second solution}
    \chapter{Third chapter}
    \chapter*{Chapter without a number}
    \section{One}
    \section{Two}
\end{document}

目标是:

  1. 将点放在目录中 a) 章节旁边,将 b) 章节旁边

  2. 得到左侧标记工作正确,意思是 - 我想要一个章节名称,章节编号 [带点],但没有单词:“章节”

  3. 在目录中的页码中添加章节号的点,

  4. 枚举样式变化:从原生到深色方块,内部带有粗体数字

答案1

下面是一个可能的解决方案:该tocloft包用于 1)a) 和 3)。重新定义\chaptermarksolved 2)。使用 \fbox solved 重新定义4)。在已经存在的 solved 1)b) 定义\labelenumi后面添加一个点。代码包含一些注释,显示了所做的更改:\thechapter\@makechapterhead

\documentclass[openany, 10pt]{book}
\usepackage[utf8]{inputenc}
\usepackage[MeX]{polski}
\usepackage{titleps}
\usepackage[Lenny]{fncychap}
\usepackage{lipsum}

\usepackage{tocloft}
\renewcommand\cftchapaftersnum{.}% adds dot after chapter title in ToC
\renewcommand\cftchapdotsep{\cftdotsep}% adds leader dots from chapter titles to page numbers

\makeatletter
    \renewcommand\@seccntformat[1]{\csname the#1\endcsname.\quad}
    \renewcommand\contentsname{Spis}
    \renewcommand\numberline[1]{#1.\hskip0.7em}
\makeatother

\newcommand\MyTitle{\scshape Pacjent i Analityk}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhead[LE,RO]{\normalsize\thepage}
\fancyhead[RE]{\scriptsize \textsc{\leftmark}}
\fancyhead[LO]{\scriptsize \textsc{\MyTitle}}
\fancyfoot[L,C,R]{}
\renewcommand\chaptermark[1]{%
  \markboth{\MakeUppercase{\thechapter.\ #1}}{}} % chapter mark wothout "Chapter"


 \frenchspacing

 %style form chapter
      %http://zoonek.free.fr/LaTeX/LaTeX_samples_chapter/0.html
 \usepackage{pstcol}
 \makeatletter
     \def\LigneVerticale{\vrule height 5cm depth 2cm\hspace{0.1cm}\relax}
     \def\LignesVerticales{
     \let\LV\LigneVerticale\LV\LV\LV\LV\LV\LV\LV\LV\LV\LV}
     \def\GrosCarreAvecUnChiffre#1{%
     \rlap{\vrule height 0.8cm width 1cm depth 0.2cm}%
     \rlap{\hbox to 1cm{\hss\mbox{\white #1}\hss}}%
     \vrule height 0pt width 1cm depth 0pt}

     \def\@makechapterhead#1{\hbox{%
     \huge 
     \LignesVerticales
     \hspace{-0.5cm}%
     \GrosCarreAvecUnChiffre{\thechapter.}% the final dot adds a dor after the chapter number in the document
     \hspace{0.2cm}\hbox{#1}%
     \renewcommand\numberline[1]{#1.\hskip0.7em}
   }\par\vskip 2cm}

   \def\@makeschapterhead#1{\hbox{%
   \huge 
   \LignesVerticales
   %\hspace{0.5cm}%
   \hbox{#1}%
   }\par\vskip 2cm}

   \newcommand\MySquare{% thanks to Gonzalo Medina
     %http://tex.stackexchange.com/users/3954/gonzalo-medina
   \leavevmode\hbox to 1.2ex{\hss\vrule height .9ex width .7ex depth -.2ex\hss}}
   \renewcommand\labelitemi{\MySquare}

   \title{Foo is getting older}
   \author{Joseph Bar}
   \date{}

\begin{document}
\maketitle

\frontmatter
\tableofcontents

\chapter*{Chapter whitout a number}
\addcontentsline{toc}{chapter}{Chapter whitout a number}

\renewcommand\labelenumi{%
  {\setlength\fboxsep{2pt}\fbox{\bfseries\arabic{enumi}}}} %redefinition for first level labels of enumerate

\mainmatter
\chapter{Solution}\label{chap:one}
\begin{enumerate}
\item First item.
\item Second item.
\item Third item.
\end{enumerate}
\lipsum[1-20]
\section{One}
\section{Two}
\section{Another section}
\chapter{Second solution}
\chapter{Third chapter}
\chapter*{Chapter whitout a number}
\section{One}
\section{Two}

\end{document}

生成的文档的一些图像显示了所要求的更改:

目录(章节号后的点以及从标题到页码的引文):

在此处输入图片描述

典型的编号章节图块显示了所请求的结束点;此图还显示了环境第一级标签所需的格式enumerate

在此处输入图片描述

显示所需格式的典型偶数标题(数字-点-标题):

在此处输入图片描述

相关内容