mr.johnson wrote:Code: Select all
\newcommand{\mysection}[2]{\FloatBarrier \section{#1} \label{sec:{#2}}}
Now my problem is that the Texniccenter navigator doesn't show the chapter/section titles anymore but just something like
Because the PDF comes out perfectly fine, I'm not sure if this has something to do with "fragile" and "robust" commands in LaTex, if I forgot something or if this is a bug...
As you mention, the PDF builds fine, and so the problem has nothing to do with LaTeX.
[ Aside: You only need to worry about using \fragile when you're using commands that will be "moved." For example, when you usewith a table of contents, the
\mymacroSectionName will be "called" from
two places --- on the page with the
\section and in the table of contents. Some commands (e.g.,
\footnote) might not be happy with this. ][/i]
In your case, TeXnicCenter attempts to parse your document and extract enough meaning for it to display the section summary. It's "smart" enough to expand your
\mysection to find each
\section, but it's not smart enough to go ahead and do the substitution of the first parameter with
#1.
You might get away with doing something more like...
Code: Select all
\let\origSection\section
\renewcommand{\section}[2]{\FloatBarrier \origSection{#1} \label{sec:#2}}
Then use
\section instead of
\mysection. For example, try
or
and see if TeXnicenter is happier with that.
[ NOTE: This modification prevents you from using \section* or \section[stuff]{stuff}. If you need the old \section behavior, use \origSection instead (or build your own new \section that handles these cases too). ]