2

I hope that @michal.h21 can help me. I tried your solution which works well, but I did not mention that the section and subsections too are modified.

I generalized the situation with the following example and I expose the problem in the picture enter image description here

the problems are

  • the vertical alignment is broken with the sections and subsections

this is the .cfg

\Preamble{xhtml,sections+}

\NewSection\subsubsubsection{\theparagraph}


\Configure{section}
{\ifvmode\IgnorePar\fi\EndP\IgnorePar\Tg<section id="section.\thesection">}
{\ifvmode\IgnorePar\fi\EndP\IgnorePar\Tg</section>}
{\HCode{<font size="+0">}%
 \NoFonts\HCode{<span class="it">}%
 \TitleMark%
 \HCode{\Hnewline}}%
{\HCode{</span>}\EndNoFonts%
 \HCode{</font>}%
 \HCode{\Hnewline}%
 \par\IgnoreIndent\ShowPar%
}
\ConfigureMark{section}{\thesection~@@@~}

\Configure{subsection}
{\ifvmode\IgnorePar\fi\EndP\IgnorePar\Tg<subsection id="subsection.\thesubsection">}
{\ifvmode\IgnorePar\fi\EndP\IgnorePar\Tg</subsection>}
{\HCode{<font size="+0">}%
 \NoFonts\HCode{<span class="it">}%
 \TitleMark%
 \HCode{\Hnewline}}%
{\HCode{</span>}\EndNoFonts%
 \HCode{</font>}%
 \HCode{\Hnewline}%
 \par\IgnoreIndent\ShowPar%
}
\ConfigureMark{subsection}{\thesubsection~@@@~}



\Configure{subsubsection}
{\ifvmode\IgnorePar\fi\EndP\IgnorePar\Tg<subsubsection id="subsubsection.\thesubsubsection">}
{\ifvmode\IgnorePar\fi\EndP\IgnorePar\Tg</subsubsection>}
{\HCode{<font size="+0">}%
 \NoFonts\HCode{<span class="it">}%
 \TitleMark%
 \HCode{\Hnewline}}%
{\HCode{</span>}\EndNoFonts%
 \HCode{</font>}%
 \HCode{\Hnewline}%
 \par\IgnoreIndent\ShowPar%
}
\ConfigureMark{subsubsection}{\thesubsubsection~@@@~}



\Configure{subsubsubsection}
{\ifvmode\IgnorePar\fi\EndP\IgnorePar\Tg<subsubsubsection id="subsubsubsection.\theparagraph">}
{\ifvmode\IgnorePar\fi\EndP\IgnorePar\Tg</subsubsubsection>}
{\addtocounter{paragraph}{1}
 \HCode{<font size="+0">}%
 \NoFonts\HCode{<span class="it">}%
 \TitleMark%
 \HCode{\Hnewline}}%
{\HCode{</span>}\EndNoFonts%
 \HCode{</font>}%
 \HCode{\Hnewline}%
 \par\IgnoreIndent\ShowPar%
}
\ConfigureMark{subsubsubsection}{\theparagraph~@@@~}
\Configure{toToc}{subsubsubsection}{paragraph}


\Css{span.it{font-style:italic;}}
\ConfigureMark{subsubsubsection}{\theparagraph~@@@~}
\Configure{toToc}{subsubsubsection}{paragraph}


\ConfigureToc{paragraph}
{~~~\HCode{<span class="paragraphToc" >}}{~@@@~}{}{\HCode{</span>}\HCode{<br />\Hnewline}}

% \ConfigureToc{subsubsubsection}
% {~~~\HCode{<span class="subsubsubsectionToc" >}}{~@@@~}{}{\HCode{</span>}\HCode{<br />\Hnewline}}

\def\newncxtox#1#2{%
  \ConfigureToc{#1}%
  {\closelevels{#2}%
  \csname a:NavSection\endcsname\csname Ncx:Mark\endcsname}
  {\csname c:NavSection\endcsname~@@@~}
  {}
  {\csname b:NavSection\endcsname%
    \finishtoclevel{#1}%
  }
}

\begin{document}
\expandafter\def\csname ncx:title\endcsname{%
  \HCode{<docTitle>\Hnewline<text>}\Title\HCode{</text>\Hnewline</docTitle>\Hnewline}
\newncxtox{section}{section}
\newncxtox{subsection}{subsection}
\newncxtox{subsubsection}{subsubsection}
\newncxtox{paragraph}{paragraph}
\newncxtox{subparagraph}{subparagraph}
}
\EndPreamble

this is the tex file

    \documentclass{article} 

\makeatletter
\def\subsubsubsection{%
\@startsection{paragraph}{4}{0em}{0.1\parskip}{1em}{}
}
\makeatother


\setcounter{secnumdepth}{5}
\setcounter{tocdepth}{5}


    \begin{document}
    \tableofcontents
    \section{first seciton}
    \subsection{first subsection}
    \subsubsection{first subSUBsection}
    \subsubsubsection{first subSUBsubsection}

    my subsubsubsection here

    \paragraph{first para}

\subsection{AA subsection}
    \subsubsection{AA subSUBsection}
    \subsubsubsection{AA subSUBsubsection}

    my subsubsubsection here

    \paragraph{AA para}

    werfj


    \section{second seciton}
    \subsection{second subsection}
    \subsubsection{second subSUBsection}
    \subsubsubsection{second subSUBsubsection}

    my subsubsubsection here

    \paragraph{second para}


\subsection{AA subsection}
    \subsubsection{AA subSUBsection}
    \subsubsubsection{AA subSUBsubsection}

    my subsubsubsection here

    \paragraph{AA para}


    werfj

    \end{document}
1

The second parameter of newncxtox must contain all subdivisions of the configured section level. This is needed in order to get the correct hierarchy in your NCX table of contents. The problem in your example isn't the spacing, but the fact that your subsequent sections and subsections are printed on the same level as subsubsubsections.

You need to change in this way:

\newncxtox{section}{section,subsection,subsubsection,paragraph}
\newncxtox{subsection}{subsection,subsubsection,paragraph}    
\newncxtox{subsubsection}{subsubsection} 
\newncxtox{paragraph}{paragraph}    
\newncxtox{subparagraph}{subparagraph} 

enter image description here

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.