<p dir="ltr">It works fine on my workstation with the current tex file.</p>
<p dir="ltr">\begin{verbatim} is defined as a token at the beginning of the script. For the '}' match, maybe we can define a separate flag if begin{verbatim} is active and turn off the check on '}'.</p>
<p dir="ltr">Stefano</p>
<div class="gmail_quote">Il 08/ott/2015 08:50 PM, "Barry Smith" <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>> ha scritto:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
   I can't image this would work because \\begin{verbatim} is not a token. Plus if decrease for each } you will exit the verbatim "safe" zone as soon as you hit a }<br>
<br>
  Barry<br>
<br>
> On Oct 8, 2015, at 9:54 AM, Stefano Zampini <<a href="mailto:stefano.zampini@gmail.com">stefano.zampini@gmail.com</a>> wrote:<br>
><br>
> What about the patch in attachment?<br>
><br>
> 2015-10-08 1:54 GMT+03:00 Barry Smith <<a href="mailto:bsmith@mcs.anl.gov">bsmith@mcs.anl.gov</a>>:<br>
><br>
> > On Sep 30, 2015, at 7:46 AM, Stefano Zampini <<a href="mailto:stefano.zampini@gmail.com">stefano.zampini@gmail.com</a>> wrote:<br>
> ><br>
> > I just noticed that Figures 19 and 20 in the manual (current release and master) are messed up. The htmlmap process seems not to work properly.<br>
><br>
> The tool /bin/maint/mapnameslatex.py is what looks through the tokens in the .tex files and replaces PETSc functions etc with an href. Unfortunately it is simple minded. It should turn off replacement when it detects a \begin{verbatim} and turn it back on when it hits the \end{verbatim} here is the entire engine<br>
><br>
>     while 1:<br>
>         token = lex.token()       # Get a token<br>
>         if not token: break        # No more tokens<br>
>         if token.type == 'NEWLINE':<br>
>             print text<br>
>             text = ''<br>
>         else:<br>
>             # \href cannot be used in many places in Latex<br>
>             if token.value in ['\\href{','\\findex{','\\sindex{','\\subsection{','\\chapter{','\\section{','\\caption{','\\trl{']:<br>
>                 bracket = bracket + 1;<br>
>             if bracket == 0:<br>
>                 value = token.value<br>
>                 if mappedstring.has_key(value):<br>
>                     mvalue = mappedstring[value].replace('_','\\_')<br>
>                     value = '\\href{'+'<a href="http://www.mcs.anl.gov/petsc/petsc-'+version+'/docs/'+mappedlink[value]+'}{'+mvalue+'" rel="noreferrer" target="_blank">http://www.mcs.anl.gov/petsc/petsc-'+version+'/docs/'+mappedlink[value]+'}{'+mvalue+'</a>}\\findex{'+value+'}'<br>
>             else:<br>
>                 value = token.value<br>
>             if token.value[0] == '}' and bracket:<br>
>                 bracket = bracket - 1;<br>
>             text = text+value<br>
><br>
> You want to take a crack at fixing it? Because I don't really feel like it :-(<br>
><br>
>   Barry<br>
><br>
><br>
><br>
> ><br>
> > --<br>
> > Stefano<br>
><br>
><br>
><br>
><br>
> --<br>
> Stefano<br>
> <patch_manual><br>
<br>
</blockquote></div>