[OS X TeX] regexp for matching entire footnotes

Martin Costabel costabel at wanadoo.fr
Sun Jul 30 14:01:08 CEST 2006


Steffen Wolfrum wrote:
[]
> \footnote{Vgl. zur Historie \it{Lerche}, 
> „Staatssekretär\index{Staatssekretär}}
> 
> ... as the found string shouldn't stop at the first "}" that was found.
> 
> 
> Somebody knows a syntax that ignores curled bracket pairs *included* in 
> footnotes and really matches the entire note?

I don't know a completely recursive solution that allows arbitrary 
newting depths, but if you know the maximal nesting depth that appears, 
it is not difficult:

For nesting depth 1, as in your example, the following works

\\footnote\{([^{}]*|\{[^{}]*\})*\}

This will not work with higher nesting depth as in your second example.

> \footnote{BVerwGE, NVwZ 1987, 578 (582); \Textit{Stelkens{|/|}Schmitz,
> }in: Stelkens{|/|}Bonk{|/|}Sachs, VwVfG, § 9, Rn. 60;
> \Textit{Kopp{|/|}Ramsauer,} VwVfG, § 20, Rn. 6; \Textit{Di Fabio}, in:
> Maunz{|/|}Dürig{|/|}Herzog, GG, Art. 2 Abs. 1, Rn. 72 f.}. Nur über den
> Weg des gesetzmäßigen Handelns der Verwaltung kann Rechtsklarheit und
> damit einhergehend Rechtssicherheit für die Bürger geschaffen werden.
> Ein rechtsstaatlich geordnetes Verwaltungsverfahren, das in diesem Sinne
> von vornherein größtmögliche Garantien für die Richtigkeit und
> Gerechtigkeit des Verwaltungshandelns bietet, stellt deshalb eine
> notwendige Voraussetzung der staatsbürgerlichen Freiheit
> dar\footnote{\Textit{Kopp}, Verfassungsrecht und
> Verwaltungsverfahrensrecht, S. 57, 88.}

For this example with nesting depth 2, you can use

\\footnote\{([^{}]*|\{([^{}]*|\{[^{}]*\})*\})*\}

For nesting depth at most 3, this would be

\\footnote\{([^{}]*|\{([^{}]*|\{([^{}]*|\{[^{}]*\})*\})*\})*\}

and so on.

-- 
Martin
------------------------- Info --------------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
          & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Archive: http://tug.org/pipermail/macostex-archives/




More information about the macostex-archives mailing list