Merge pull request #7822 from Jellby/fix_numfig

Fix #7715: Issue \@addtoreset after loading hyperref
This commit is contained in:
Takeshi KOMIYA 2020-06-12 22:27:36 +09:00 committed by GitHub
commit 6c71445e86
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -881,52 +881,62 @@
\g@addto@macro\spx@preBthefigure{\fi}}% \g@addto@macro\spx@preBthefigure{\fi}}%
\fi \fi
\ifnum\spx@opt@numfigreset>1 \ifnum\spx@opt@numfigreset>1
\AtBeginDocument{%
\@addtoreset{figure}{section}% \@addtoreset{figure}{section}%
\@addtoreset{table}{section}% \@addtoreset{table}{section}%
\@addtoreset{literalblock}{section}% \@addtoreset{literalblock}{section}%
\ifspx@opt@mathnumfig \ifspx@opt@mathnumfig
\@addtoreset{equation}{section}% \@addtoreset{equation}{section}%
\fi \fi%
}%
\g@addto@macro\spx@preAthefigure{\ifnum\c@section>\z@\arabic{section}.}% \g@addto@macro\spx@preAthefigure{\ifnum\c@section>\z@\arabic{section}.}%
\g@addto@macro\spx@preBthefigure{\fi}% \g@addto@macro\spx@preBthefigure{\fi}%
\fi \fi
\ifnum\spx@opt@numfigreset>2 \ifnum\spx@opt@numfigreset>2
\AtBeginDocument{%
\@addtoreset{figure}{subsection}% \@addtoreset{figure}{subsection}%
\@addtoreset{table}{subsection}% \@addtoreset{table}{subsection}%
\@addtoreset{literalblock}{subsection}% \@addtoreset{literalblock}{subsection}%
\ifspx@opt@mathnumfig \ifspx@opt@mathnumfig
\@addtoreset{equation}{subsection}% \@addtoreset{equation}{subsection}%
\fi \fi%
}%
\g@addto@macro\spx@preAthefigure{\ifnum\c@subsection>\z@\arabic{subsection}.}% \g@addto@macro\spx@preAthefigure{\ifnum\c@subsection>\z@\arabic{subsection}.}%
\g@addto@macro\spx@preBthefigure{\fi}% \g@addto@macro\spx@preBthefigure{\fi}%
\fi \fi
\ifnum\spx@opt@numfigreset>3 \ifnum\spx@opt@numfigreset>3
\AtBeginDocument{%
\@addtoreset{figure}{subsubsection}% \@addtoreset{figure}{subsubsection}%
\@addtoreset{table}{subsubsection}% \@addtoreset{table}{subsubsection}%
\@addtoreset{literalblock}{subsubsection}% \@addtoreset{literalblock}{subsubsection}%
\ifspx@opt@mathnumfig \ifspx@opt@mathnumfig
\@addtoreset{equation}{subsubsection}% \@addtoreset{equation}{subsubsection}%
\fi \fi%
}%
\g@addto@macro\spx@preAthefigure{\ifnum\c@subsubsection>\z@\arabic{subsubsection}.}% \g@addto@macro\spx@preAthefigure{\ifnum\c@subsubsection>\z@\arabic{subsubsection}.}%
\g@addto@macro\spx@preBthefigure{\fi}% \g@addto@macro\spx@preBthefigure{\fi}%
\fi \fi
\ifnum\spx@opt@numfigreset>4 \ifnum\spx@opt@numfigreset>4
\AtBeginDocument{%
\@addtoreset{figure}{paragraph}% \@addtoreset{figure}{paragraph}%
\@addtoreset{table}{paragraph}% \@addtoreset{table}{paragraph}%
\@addtoreset{literalblock}{paragraph}% \@addtoreset{literalblock}{paragraph}%
\ifspx@opt@mathnumfig \ifspx@opt@mathnumfig
\@addtoreset{equation}{paragraph}% \@addtoreset{equation}{paragraph}%
\fi \fi%
}%
\g@addto@macro\spx@preAthefigure{\ifnum\c@subparagraph>\z@\arabic{subparagraph}.}% \g@addto@macro\spx@preAthefigure{\ifnum\c@subparagraph>\z@\arabic{subparagraph}.}%
\g@addto@macro\spx@preBthefigure{\fi}% \g@addto@macro\spx@preBthefigure{\fi}%
\fi \fi
\ifnum\spx@opt@numfigreset>5 \ifnum\spx@opt@numfigreset>5
\AtBeginDocument{%
\@addtoreset{figure}{subparagraph}% \@addtoreset{figure}{subparagraph}%
\@addtoreset{table}{subparagraph}% \@addtoreset{table}{subparagraph}%
\@addtoreset{literalblock}{subparagraph}% \@addtoreset{literalblock}{subparagraph}%
\ifspx@opt@mathnumfig \ifspx@opt@mathnumfig
\@addtoreset{equation}{subparagraph}% \@addtoreset{equation}{subparagraph}%
\fi \fi%
}%
\g@addto@macro\spx@preAthefigure{\ifnum\c@subsubparagraph>\z@\arabic{subsubparagraph}.}% \g@addto@macro\spx@preAthefigure{\ifnum\c@subsubparagraph>\z@\arabic{subsubparagraph}.}%
\g@addto@macro\spx@preBthefigure{\fi}% \g@addto@macro\spx@preBthefigure{\fi}%
\fi \fi