TransWikia.com

Non-standard ToC style

TeX - LaTeX Asked by Alexandra on January 8, 2021

I’m preparing my thesis in LYX.
Text is in russian, but there are a lot of symbols and chemical formulas in english. By now I work with "extended article" class, standard.
I need to make a ToC looking similar to this example (the rules for thesis style are quite strict):
image

So I need to use some special commands to change section titles and numbering. But I’m not familiar with this "fine-tuning". Are there any useful commands or some package that can easily help?

Code in .tex file:

 documentclass[14pt]{extarticle}
renewcommand{familydefault}{rmdefault}
usepackage[LGR,T1,T2A]{fontenc}
usepackage[koi8-r]{inputenc}
usepackage[a4paper]{geometry}
geometry{verbose,tmargin=2cm,bmargin=2cm,lmargin=2.5cm,rmargin=1.1cm,headheight=17pt}
usepackage{fancyhdr}
pagestyle{fancy}
setcounter{secnumdepth}{1}
setcounter{tocdepth}{1}
usepackage{float}
usepackage{units}
usepackage{textcomp}
usepackage{amsmath}
usepackage{stmaryrd}
usepackage{graphicx}
usepackage{setspace}
usepackage{esint}
usepackage{subscript}
onehalfspacing

makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
newcommand*LyXZeroWidthSpace{hspace{0pt}}
DeclareRobustCommand{greektext}{%
  fontencoding{LGR}selectfontdefencodingdefault{LGR}}
DeclareRobustCommand{textgreek}[1]{leavevmode{greektext #1}}
ProvideTextCommand{~}{LGR}[1]{char126#1}

DeclareRobustCommand{cyrtext}{%
  fontencoding{T2A}selectfontdefencodingdefault{T2A}}
DeclareRobustCommand{textcyr}[1]{leavevmode{cyrtext #1}}

newcommand{lyxmathsym}[1]{ifmmodebegingroupdefb@ld{bold}
  text{ifxmath@versionb@ldbfseriesfi#1}endgroupelse#1fi}

ProvideTextCommandDefault{guillemotleft}{%
  {usefont{U}{lasy}{m}{n}char'50kern-.15emchar'50}%
penalty10000hskip0ptrelax%
}
ProvideTextCommandDefault{guillemotright}{%
  penalty10000hskip0pt%
  {usefont{U}{lasy}{m}{n}char'51kern-.15emchar'51}%
}
DeclareTextSymbolDefault{textquotedbl}{T1}
%% Because html converters don't know tabularnewline
providecommand{tabularnewline}{}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
usepackage[koi8-r]{inputenc}
usepackage{mathtext}
usepackage{titlesec}
%usepackage[bibencoding=utf8]{biblatex}
usepackage[english, russian]{babel}
usepackage{tocloft}
renewcommand{cfttoctitlefont}{hfilLargebfseries}
renewcommand{cftaftertoctitle}{hfill}
renewcommand{cftsecpresnum}{Sect }
%renewcommand{cftchappresnum}{Chapter }
setlength{cftsecnumwidth}{6em}
renewcommand{headrulewidth}{0}
%renewcommand thepart {arabicpart}

makeatother

usepackage[style=gost-numeric,bibencoding=utf8, sorting=none]{biblatex}
addbibresource{0C__Users_1_Documents_My_diss_All_bib.bib}
begin{document}

rhead{}
chead{thepage}
cfoot{}
begin{center}
{large{}Титульная}newpage{}
parend{center}

tableofcontents 
clearpage

newpage{}

part*{{large{}Введение }}

section*{{normalsize{}Цели диссертационной работы}}

section*{{normalsize{}Апробация работы} }

Основные результаты диссертационной работы были представлены в виде ..

newpage{}
part{{normalsize{}Литературный обзор}}

vspace{42pt}

section{{normalsize{}Природа обменного взаимодействия}}

vspace{42pt}

section{{normalsize{}Обменные взаимодействия в соединениях РЗМ с Fe, Ni,
Mn}}

vspace{42pt}
В интерметаллических соединениях РЗМ с 3d переходными металлами..

newpage{}
part{{normalsize{}Технология приготовления и аттестация образцов }}

vspace{42pt}

section{{normalsize{}Микроструктура }}
section{{normalsize{}Измерение температуры Кюри и намагниченности }}
section{{normalsize{}Методика измерения ... }}

vspace{42pt}

newpage{}
part{{normalsize{}Результаты}}

vspace{42pt}

section{{normalsize{}Гигантская ... }}


section{{normalsize{}Магнитные свойства..}}

newpage{}
part{Выводы}

section*{newpage Литература}

nocite{*}
printbibliography

end{document}

Command "cftchappresnum" didn’t work for some reason – I’ve put it in comment in example above.

One Answer

As you have not provided an MWE I do not know how you have added your first, and later, unnumbered entries to the ToC. I don't read Russian; the following is in English and I hope that you are more multilingual than I am.

The tocloft package can be of some help.

% tocrussianprob.tex  SE 561296

documentclass{article}
usepackage{tocloft}

% centering the ToC title
renewcommand{cfttoctitlefont}{hfilLargebfseries}
renewcommand{cftaftertoctitle}{hfill}
% put section before section entries
renewcommand{cftsecpresnum}{Section }
setlength{cftsecnumwidth}{5em} % need more space for Section + num

begin{document}

tableofcontents
clearpage

section{First section}
subsection{A subsection}
subsubsection{A sub-subsection}

section{Second section}
subsection{A subsection with a very long title, I hope it's over one line in the ToC}
end{document}
 

I don't know how to get the second line of a title to be at the left margin. The normal typographic style is for the titles to be aligned as a block.

Answered by Peter Wilson on January 8, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP