title: Matching parentheses over multiple lines (with awk?)
body: <p>I want to filter out footnotes from a LaTeX document using a bash script. It may look like either of these examples:</p>
  
  <pre class="lang-tex prettyprint-override"><code>Some text with a short footnote.\footnote{Some \textbf{explanation}.}
  
  Some text with a longer footnote.%
    \footnote{Lorem ipsum dolor
       sit amet, etc. etc. etc. \emph{along \emph{multiple} lines}
       but all lines increased indent from the start.}
  </code></pre>
  
  <p>The remains should be:</p>
  
  <pre class="lang-tex prettyprint-override"><code>Some text with a short footnote.
  
  Some text with a longer footnote.%
  </code></pre>
  
  <p>I don't care about extra whitespace.</p>
  
  <p>Since matching parentheses cannot be done with regular expressions, I presume I cannot use <code>sed</code> for this. Is it possible with <code>awk</code> or some other tool?</p>