Is it right that usage of structural commands like \chapter, \section, \subsection and the like inside of \newcommand screws up the document's structure? I've got a \section*{...} inside a \newcommand block and using that new command does not work properly.
In Texmaker when I use the structure view to navigate through the document, clicking on the corresponding node in the tree moves the focus to the one \section command inside the \newcommand block instead of the ones that should actually be generated by usage of the custom command in different spots of the document. Complicating, I know.
I hope you'll get the point. What do I have to do to get custom commands to produce a correct document structure?
//edit: Here's an example of my problem:
\documentclass[a4paper,10pt]{report}
\newcommand{\sectionexample}[2]{
\section*{#1}
This is an Example of what I think is not working...
#2
}
\begin{document}
\tableofcontents
\sectionexample{Test}{Hello World!}
\end{document}
This generates correct output aside from the fact that the section headline is missing in the \tableofcontents.
TexMakercan not properly navigate it? If it is the latter I think my comments starting at Displaying current chapter/section in your editor, and the follow on comments would explain what is going on. – Peter Grill Nov 17 '12 at 22:08section*which not only suppresses the section number but also does not add it to the TOC. You need to do a\phantomsection(needed forhyperref) and\addcontentslinewith\section*to get the unnumbered section in the TOC. – Peter Grill Nov 18 '12 at 09:33hyperrefand PDF bookmarks. – cyberSingularity Nov 18 '12 at 11:54