\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}
The goal is:
-
Put the dots next to chapter
a) in ToC,
b) in text -
Get left marking work correct, meaning – I want a name of chapter, number of a chapter [with dot], but without a word:"Chapter"
-
Add dots from chapter to the page number in ToC,
-
Enumerate style change: from native to dark square with bold number inside
Best Answer
Below there's a possible solution: the
tocloft
package was used for 1)a) and 3). A redefinition of\chaptermark
solved 2). A redefinition of\labelenumi
using \fbox solved 4). Adding a dot after\thechapter
in the already existing definition of\@makechapterhead
solved 1)b). The code contains some comments showing where the changes were made:Some images of the resulting document showing the changes requested:
The ToC (dot after chapter number and leaders from the title to the page number):
A typical numbered chapter tile showing the requested ending dot; this image also shows the required formatting for the labels of the first level of an
enumerate
environment:A typical even-numbered header showing the desired formatting (number-dot-title):