On the question How to automatically put a [Go To Summary] | [Go Back] on each section? I learned how to create a go to summary on each section on the text. However now I am having a errors when I change this:
\documentclass[10pt,a5paper,twoside]{abntex2}
To this:
\documentclass[10pt,a5paper,twoside,chapter=TITLE,section=TITLE]{abntex2}
Also the errors are fixed when I remove the go to summary section command.
This is an example with errors, i.e., using chapter=TITLE,section=TITLE
\documentclass[10pt,a5paper,twoside,chapter=TITLE,section=TITLE]{abntex2}
% Incompatible color definition when using tikz with color package
% https://tex.stackexchange.com/questions/150369/incompatible-color-definition-when-using-tikz-with-color-package
\usepackage{xcolor}
\definecolor{darkblue}{RGB}{26,13,178}
\definecolor{darkgreen}{rgb}{0,0.6,0}
\hypersetup{colorlinks,linkcolor=darkblue,citecolor=darkgreen}
% How to automatically put a [Go To Summary] | [Go Back] on each section?
% https://tex.stackexchange.com/questions/367859/how-to-automatically-put-a-go-to-summary-go-back-on-each-section
\definecolor{ultramarine}{RGB}{0,32,96}
\makeatletter
\newcommand{\goToSummaryText}
{
\hyperlink{summary} {\textcolor{ultramarine}{\small\mdseries [Go To Top]}}
{\small\mdseries |}
\Acrobatmenu{GoBack}{\textcolor{ultramarine}{\small\mdseries [Go Back]}}
}
\newcommand{\addGoToSummary}{\renewcommand{\Sectionformat}[2]{##1 \goToSummaryText}}
\newcommand{\removeGoToSummary}{\renewcommand{\Sectionformat}[2]{##1}}
\let\oldtableofcontents\tableofcontents
\renewcommand{\tableofcontents}
{
% Insert internal document link
\hypertarget{summary}
\oldtableofcontents
}
\makeatother
\begin{document}
\tableofcontents*
\addGoToSummary
\chapter[Nullam]{Nullam elementum}
Nullam elementum
\section[Some encoding tests]{showfont}
\end{document}
Just by running this simple example only with one command \section I got several errors:
! Undefined control sequence.
\hyper@@link ->\let \Hy@reserved@a
\relax \@ifnextchar [{\hyper@link@ }{\hyp...
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Use of \hyper@link@ doesn't match its definition.
<argument> \def
l.41 \section[Some encoding tests]{showfont}
If you say, e.g., `\def\a1{...}', then you must always
put `1' after `\a', since control sequence names are
made up of letters only. The macro here has not been
followed by the required stuff, so I'm ignoring it.
! Undefined control sequence.
\@calc@post@scan ...st@scan \else \def \calc@next
{\calc@error #1}\fi \fi \f...
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\@calc@post@scan ...fi \fi \fi \fi \fi \calc@next
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GTS@RemoveLeft ...{}{}\GTS@Nil }\edef \GTS@Token
{\the \toks@ }\GTS@Predefi...
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GTS@TestLeft #1#2->\def \GTS@temp
{#1}\ifx \GTS@temp \GTS@Token \toks@ \exp...
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
<argument> \Hy@phantomsection
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GTS@RemoveLeft ...{}{}\GTS@Nil }\edef \GTS@Token
{\the \toks@ }\GTS@Predefi...
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GTS@TestLeft #1#2->\def \GTS@temp
{#1}\ifx \GTS@temp \GTS@Token \toks@ \exp...
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
<argument> \Hy@phantomsection
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GTS@RemoveLeft ...{}{}\GTS@Nil }\edef \GTS@Token
{\the \toks@ }\GTS@Predefi...
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GTS@TestLeft #1#2->\def \GTS@temp
{#1}\ifx \GTS@temp \GTS@Token \toks@ \exp...
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
<argument> \Hy@phantomsection
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GTS@RemoveLeft ...{}{}\GTS@Nil }\edef \GTS@Token
{\the \toks@ }\GTS@Predefi...
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GTS@TestLeft #1#2->\def \GTS@temp
{#1}\ifx \GTS@temp \GTS@Token \toks@ \exp...
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
<argument> \Hy@phantomsection
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GTS@RemoveLeft ...{}{}\GTS@Nil }\edef \GTS@Token
{\the \toks@ }\GTS@Predefi...
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GTS@TestLeft #1#2->\def \GTS@temp
{#1}\ifx \GTS@temp \GTS@Token \toks@ \exp...
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
<argument> \Hy@phantomsection
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GTS@RemoveLeft ...{}{}\GTS@Nil }\edef \GTS@Token
{\the \toks@ }\GTS@Predefi...
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GTS@TestLeft #1#2->\def \GTS@temp
{#1}\ifx \GTS@temp \GTS@Token \toks@ \exp...
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
<argument> \Hy@phantomsection
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GTS@RemoveLeft ...{}{}\GTS@Nil }\edef \GTS@Token
{\the \toks@ }\GTS@Predefi...
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GTS@TestLeft #1#2->\def \GTS@temp
{#1}\ifx \GTS@temp \GTS@Token \toks@ \exp...
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
<argument> \Hy@phantomsection
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GTS@RemoveLeft ...{}{}\GTS@Nil }\edef \GTS@Token
{\the \toks@ }\GTS@Predefi...
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GTS@TestLeft #1#2->\def \GTS@temp
{#1}\ifx \GTS@temp \GTS@Token \toks@ \exp...
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
<argument> \Hy@phantomsection
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GTS@RemoveLeft ...{}{}\GTS@Nil }\edef \GTS@Token
{\the \toks@ }\GTS@Predefi...
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GTS@TestLeft #1#2->\def \GTS@temp
{#1}\ifx \GTS@temp \GTS@Token \toks@ \exp...
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
<argument> \Hy@phantomsection
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GTS@RemoveLeft ...{}{}\GTS@Nil }\edef \GTS@Token
{\the \toks@ }\GTS@Predefi...
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GTS@TestLeft #1#2->\def \GTS@temp
{#1}\ifx \GTS@temp \GTS@Token \toks@ \exp...
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
<argument> \Hy@phantomsection
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GTS@RemoveLeft ...{}{}\GTS@Nil }\edef \GTS@Token
{\the \toks@ }\GTS@Predefi...
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GTS@TestLeft #1#2->\def \GTS@temp
{#1}\ifx \GTS@temp \GTS@Token \toks@ \exp...
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
<argument> \Hy@phantomsection
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GTS@RemoveLeft ...{}{}\GTS@Nil }\edef \GTS@Token
{\the \toks@ }\GTS@Predefi...
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GTS@TestLeft #1#2->\def \GTS@temp
{#1}\ifx \GTS@temp \GTS@Token \toks@ \exp...
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
<argument> \Hy@phantomsection
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GTS@RemoveLeft ...{}{}\GTS@Nil }\edef \GTS@Token
{\the \toks@ }\GTS@Predefi...
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GTS@TestLeft #1#2->\def \GTS@temp
{#1}\ifx \GTS@temp \GTS@Token \toks@ \exp...
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
<argument> \Hy@phantomsection
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GTS@RemoveLeft ...{}{}\GTS@Nil }\edef \GTS@Token
{\the \toks@ }\GTS@Predefi...
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
! Undefined control sequence.
\GTS@TestLeft #1#2->\def \GTS@temp
{#1}\ifx \GTS@temp \GTS@Token \toks@ \exp...
l.41 \section[Some encoding tests]{showfont}
The control sequence at the end of the top line
of your error message was never \def'ed. If you have
misspelled it (e.g., `\hobx'), type `I' and the correct
spelling (e.g., `I\hbox'). Otherwise just continue,
and I'll forget about whatever was undefined.
Running the example above removing the chapter=TITLE,section=TITLE correctly generates the document as follows:
How can the go to summary be fixed so the chapter=TITLE,section=TITLE does not throw all these errors?
Update
I failed to create a minimal example before posting this question. Now I am going to dig on my main document to find out how to reproduce the problem correctly.
I already fixed the question with the real error/problem.




\showfontin a section heading? – TeXnician Aug 24 '17 at 17:48go to summaryfeature. – user Aug 24 '17 at 17:50\makeatotherafter the\showfontdefinition, remove the 'intermediate' one before\showfont, the first one causesjumping outof the@catcode regime – Aug 24 '17 at 17:51chapter=TITLE,section=TITLE. – user Aug 24 '17 at 18:21\tableofcontentsbut use\tableofcontents, so the\hypertarget{summary}is never set yet – Aug 24 '17 at 18:29tableofcontentsto add a link to it. But I use the\tableofcontents*on my document. The document is compilling if I remove thechapter=TITLE,section=TITLE. – user Aug 24 '17 at 18:36\tableofcontents*above -- a typo – Aug 24 '17 at 20:55showfontbut the error has\showfontat that place. (Not the error, but the context.) Is that error produced from the code you posted *exactly*? – cfr Aug 24 '17 at 23:01\hyperlink? – cfr Aug 25 '17 at 04:04\small\mdseriesand\textcolor{ultramarine}. But I added those to make the document more beauty. – user Aug 25 '17 at 15:41