I am working on a .docx to .pdf script that use pandoc and latex,

I got requested to use the following improvement:

%suppression des \vbox underfull badness
\def\@textbottom{\vskip \z@ \@plus 7pt}
%numéros des sections en gras
%formatage des sections
\renewcommand\subsubsection{\@startsection{subsubsection}{3}{0pt}{6pt plus 2pt minus 2pt}{-.5em}{\normalfont\bfseries}}
\renewcommand\subsection{\@startsection{subsection}{2}{0pt}{6pt plus 2pt minus 0pt}{-.5em}{\normalfont\bfseries}}
\renewcommand\section{\@startsection{section}{1}\z@{0pt}{18pt plus 2pt minus 2pt}{\clearpage\normalfont\bfseries\centering}}
%\renewcommand\section{\@startsection{section}{1}\z@{24pt plus 2pt minus 2pt}{24pt plus 2pt minus 2pt}{\normalfont\bfseries\centering}}
%lignes de points TOC
%formatage numérotation TOC
\def\@seccntformat#1{\csname the#1\endcsname.\,}
%no indent after theorem like environments
%ajuster les hauteurs d'indices

I have tried to use it with --include-in-header option of pandoc but it failed with :

LaTeX Error: Command \@dotsep already defined.

So I replaced

- \newcommand\@dotsep{2}
+ \renewcommand\@dotsep{2}

Now I have the following error:

LaTeX Error: \tocsection undefined.

Can anybody help me understand what I am doing wrong?

  • Try ‘\renewcommand‘ or ‘\def‘ instead. – Weißer Kater Oct 7 '19 at 11:22
  • Welcome to TeX.SX! LaTeX's base classes already define \@dotsep, so it's normal that \newcommand raises an error. Try \renewcommand if you want to change the value of \@dotsep. – Phelype Oleinik Oct 7 '19 at 11:23
  • Thanks @PhelypeOleinik that did the trick... for that one... I have updated my question. – Dimitri Kopriwa Oct 7 '19 at 11:29
  • @DimitriKopriwa Make sure that @ is a letter token when you do that. Try \makeatletter\renewcommand{\@dotsep}{2}. However a few lines below in your code you already have \renewcommand\@dotsep{2} again, so I think you don't need to do that again... – Phelype Oleinik Oct 7 '19 at 11:31
  • Sorry, I have updated it once again with proper sourc e – Dimitri Kopriwa Oct 7 '19 at 11:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.