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)。重新定義\chaptermark已解決的2)。使用 \fbox的重新定義\labelenumi解決了 4)。在已解決的 1)b)\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

在此輸入影像描述

顯示所需格式的典型偶數標題(數字-點-標題):

在此輸入影像描述

相關內容