Skip to content

Commit

Permalink
Incorrect paragraph numbers in secref list.
Browse files Browse the repository at this point in the history
The definition of `\doxysection` etc. are using grouping around the section title, and this destroys the \label system as label names are stored locally.
(see also: https://tex.stackexchange.com/questions/502650/section-numbering-in-redefined-sections)

the `\doxysection` commands have been redefined (unfortunately partly copying values from book.cls)
  • Loading branch information
albert-github committed Aug 4, 2019
1 parent f6b570d commit 3eea436
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 19 deletions.
27 changes: 23 additions & 4 deletions doc/doxygen_manual.tex
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,31 @@
\usepackage{doxygen}
\usepackage{manual}
%%
% unfortunately constructs like:
% \renewcommand{\doxysection}[1]{\doxysubsection{##1}}
% using values from book.cls (see also doxygen.sty) and redefining sections to correct level.
\makeatletter
\newenvironment{DoxygenSubAppendix}{%
\renewcommand{\doxysection}{\@ifstar{\doxysubsection@star}{\doxysubsection@nostar}}%
\renewcommand{\doxysubsection}{\@ifstar{\doxysubsubsection@star}{\doxysubsubsection@nostar}}
\renewcommand{\doxysubsubsection}{\@ifstar{\doxyparagraph@star}{\doxyparagraph@nostar}}
\renewcommand{\doxyparagraph}{\@ifstar{\doxysubparagraph@star}{\doxysubparagraph@nostar}}
\renewcommand\doxysection{\@startsection{subsection}{2}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\raggedright\normalfont\large\bfseries}}
\renewcommand\doxysubsection{\@startsection{subsubsection}{3}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\raggedright\normalfont\normalsize\bfseries}}
\renewcommand\doxysubsubsection{\@startsection{paragraph}{4}{\z@}%
{3.25ex \@plus1ex \@minus.2ex}%
{-1em}%
{\raggedright\normalfont\normalsize\bfseries}}
\renewcommand\doxyparagraph{\@startsection{subparagraph}{5}{\parindent}%
{3.25ex \@plus1ex \@minus .2ex}%
{-1em}%
{\raggedright\normalfont\normalsize\bfseries}}
%%\renewcommand{\doxysection}[1]{\doxysubsection{##1}}
%%\renewcommand{\doxysubsection}[1]{\doxysubsubsection{##1}}
%%\renewcommand{\doxysubsubsection}[1]{\doxyparagraph{##1}}
%%\renewcommand{\doxyparagraph}[1]{\doxysubparagraph{##1}}
}{}
\makeatother
%%
Expand Down
36 changes: 21 additions & 15 deletions templates/latex/doxygen.sty
Original file line number Diff line number Diff line change
Expand Up @@ -539,22 +539,28 @@
\newcommand{\Hypertarget}[1]{\Hy@raisedlink{\hypertarget{#1}{}}}

% possibility to have sections etc. be within the margins
% unfortunately had to copy part of book.cls and add \raggedright
\makeatletter
\newcommand{\doxysection}{\@ifstar{\doxysection@star}{\doxysection@nostar}}
\newcommand{\doxysection@star}[1]{\begingroup\sloppy\raggedright\section*{#1}\endgroup}
\newcommand{\doxysection@nostar}[1]{\begingroup\sloppy\raggedright\section{#1}\endgroup}
\newcommand{\doxysubsection}{\@ifstar{\doxysubsection@star}{\doxysubsection@nostar}}
\newcommand{\doxysubsection@star}[1]{\begingroup\sloppy\raggedright\subsection*{#1}\endgroup}
\newcommand{\doxysubsection@nostar}[1]{\begingroup\sloppy\raggedright\subsection{#1}\endgroup}
\newcommand{\doxysubsubsection}{\@ifstar{\doxysubsubsection@star}{\doxysubsubsection@nostar}}
\newcommand{\doxysubsubsection@star}[1]{\begingroup\sloppy\raggedright\subsubsection*{#1}\endgroup}
\newcommand{\doxysubsubsection@nostar}[1]{\begingroup\sloppy\raggedright\subsubsection{#1}\endgroup}
\newcommand{\doxyparagraph}{\@ifstar{\doxyparagraph@star}{\doxyparagraph@nostar}}
\newcommand{\doxyparagraph@star}[1]{\begingroup\sloppy\raggedright\paragraph*{#1}\endgroup}
\newcommand{\doxyparagraph@nostar}[1]{\begingroup\sloppy\raggedright\paragraph{#1}\endgroup}
\newcommand{\doxysubparagraph}{\@ifstar{\doxysubparagraph@star}{\doxysubparagraph@nostar}}
\newcommand{\doxysubparagraph@star}[1]{\begingroup\sloppy\raggedright\subparagraph*{#1}\endgroup}
\newcommand{\doxysubparagraph@nostar}[1]{\begingroup\sloppy\raggedright\subparagraph{#1}\endgroup}
\newcommand\doxysection{\@startsection {section}{1}{\z@}%
{-3.5ex \@plus -1ex \@minus -.2ex}%
{2.3ex \@plus.2ex}%
{\raggedright\normalfont\Large\bfseries}}
\newcommand\doxysubsection{\@startsection{subsection}{2}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\raggedright\normalfont\large\bfseries}}
\newcommand\doxysubsubsection{\@startsection{subsubsection}{3}{\z@}%
{-3.25ex\@plus -1ex \@minus -.2ex}%
{1.5ex \@plus .2ex}%
{\raggedright\normalfont\normalsize\bfseries}}
\newcommand\doxyparagraph{\@startsection{paragraph}{4}{\z@}%
{3.25ex \@plus1ex \@minus.2ex}%
{-1em}%
{\raggedright\normalfont\normalsize\bfseries}}
\newcommand\doxysubparagraph{\@startsection{subparagraph}{5}{\parindent}%
{3.25ex \@plus1ex \@minus .2ex}%
{-1em}%
{\raggedright\normalfont\normalsize\bfseries}}
\makeatother
% Define caption that is also suitable in a table
\makeatletter
Expand Down

0 comments on commit 3eea436

Please sign in to comment.