diff --git a/Manual_tools/scripts/generate_reference_manual/copy_doxygen_latex_doc b/Manual_tools/scripts/generate_reference_manual/copy_doxygen_latex_doc index 682978f3c64..e7f5c06872b 100755 --- a/Manual_tools/scripts/generate_reference_manual/copy_doxygen_latex_doc +++ b/Manual_tools/scripts/generate_reference_manual/copy_doxygen_latex_doc @@ -165,6 +165,11 @@ sub latex_unmangle $buf =~ s/ +\n/\n/g; # Convert buffer back to Doxygen 1.5.5 format + # remove nested brackets + if ($buf =~ m/\\paragraph\[([^\]]*?)\[[^\[\]]*?\](.*?)\]/) + { + $buf =~ s/\\paragraph\[([^\]]*?)\[[^\[\]]*?\](.*?)\]/\\paragraph\[$1$2\]/g; + } $buf =~ s/\\paragraph\[.*?\]/\\paragraph/g; # remove \paragraph[...] -> \paragraph # Unmangle comma (,), _, ~, <, >, *, &, [] characters mangled for Latex @@ -200,8 +205,12 @@ sub latex_unmangle $buf =~ s/\{\\footnotesize\s+(.*?)\s*\}\\\\/$1/smg; # replace {\footnotesize xxx} by xxx } - # - $buf =~ s/\\index\{[^\\]*\}//g; # remove \index{...} + # remove nested braces + while ($buf =~ m/\\index\{([^\}]*?)\{[^\{\}]*?\}(.*?)\}/) + { + $buf =~ s/\\index\{([^\}]*?)\{[^\{\}]*?\}(.*?)\}/\\index\{$1$2\}/g; + } + $buf =~ s/\\index\{.*?\}//g; # remove \index{...} $buf =~ s/\\setlength\{\\rightskip\}\{0pt plus 5cm\}//g; # remove \setlength{\rightskip}{0pt plus 5cm}