From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.comp.tex.context/39078 Path: news.gmane.org!not-for-mail From: "Thomas A. Schmitz" Newsgroups: gmane.comp.tex.context Subject: Re: {{ double braces }} Date: Tue, 12 Feb 2008 16:09:11 +0100 Message-ID: <3C90B1C8-F6D0-4313-A21A-B54141DBDC61@uni-bonn.de> References: <1DC0E56D-487C-41CB-941E-FC98B0597B36@st.estfiles.de> <20080123204948.GA10128@gaston.couberia.bzh> <20080123215013.GC11445@gaston.couberia.bzh> <111CFD7B-669B-4044-901A-0291DD898978@uni-bonn.de> Reply-To: mailing list for ConTeXt users NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (Apple Message framework v919.2) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1202829071 23163 80.91.229.12 (12 Feb 2008 15:11:11 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 12 Feb 2008 15:11:11 +0000 (UTC) To: mailing list for ConTeXt users Original-X-From: ntg-context-bounces@ntg.nl Tue Feb 12 16:11:33 2008 Return-path: Envelope-to: gctc-ntg-context-518@m.gmane.org Original-Received: from ronja.vet.uu.nl ([131.211.172.88] helo=ronja.ntg.nl) by lo.gmane.org with esmtp (Exim 4.50) id 1JOwmx-0001ss-Nc for gctc-ntg-context-518@m.gmane.org; Tue, 12 Feb 2008 16:11:15 +0100 Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 3C6CA1FB98; Tue, 12 Feb 2008 16:10:45 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 16743-05-7; Tue, 12 Feb 2008 16:10:03 +0100 (CET) Original-Received: from ronja.vet.uu.nl (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 7335B1FB5B; Tue, 12 Feb 2008 16:10:03 +0100 (CET) Original-Received: from localhost (localhost [127.0.0.1]) by ronja.ntg.nl (Postfix) with ESMTP id 437D11FB5B for ; Tue, 12 Feb 2008 16:10:01 +0100 (CET) Original-Received: from ronja.ntg.nl ([127.0.0.1]) by localhost (smtp.ntg.nl [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 16743-05-6 for ; Tue, 12 Feb 2008 16:09:26 +0100 (CET) Original-Received: from mailout08.sul.t-online.com (mailout08.sul.t-online.de [194.25.134.20]) by ronja.ntg.nl (Postfix) with ESMTP id 776B01FADB for ; Tue, 12 Feb 2008 16:09:26 +0100 (CET) Original-Received: from fwd32.aul.t-online.de by mailout08.sul.t-online.com with smtp id 1JOwlB-0005W4-04; Tue, 12 Feb 2008 16:09:25 +0100 Original-Received: from [192.168.0.2] (XZXqFwZUrhF6SEmN0SsBA+ajPfr31++AH+zi8FG79eBpEpXvQ6HbwP6CYLylvBQg4h@[87.178.73.58]) by fwd32.aul.t-online.de with esmtp id 1JOwkx-0IBQWG0; Tue, 12 Feb 2008 16:09:11 +0100 In-Reply-To: X-Mailer: Apple Mail (2.919.2) X-ID: XZXqFwZUrhF6SEmN0SsBA+ajPfr31++AH+zi8FG79eBpEpXvQ6HbwP6CYLylvBQg4h@t-dialin.net X-TOI-MSGID: 7eaf540e-47e3-41a4-8c71-19fa681ec5aa X-Virus-Scanned: amavisd-new at ntg.nl X-BeenThere: ntg-context@ntg.nl X-Mailman-Version: 2.1.9 Precedence: list List-Id: mailing list for ConTeXt users List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: ntg-context-bounces@ntg.nl Errors-To: ntg-context-bounces@ntg.nl X-Virus-Scanned: amavisd-new at ntg.nl Xref: news.gmane.org gmane.comp.tex.context:39078 Archived-At: Hi Aditya, now I need to apologize for being so slow to reply: thanks a lot, this looks really fascinating! I don't know how many things I've read on the web to understand if regexps can handle nested delimiters or not (I think the long and short of it was that on some mathematical principle it just isn't possible); there is some pretty obscure perl stuff that might be able to do it but is highly experimental. If gema really can do this, it should be a godsend for processing TeX files. I have it installed now on my OS X box (but couldn't build the gel binary) and am looking forward to experimenting with it. All best, and thanks! Thomas On Feb 6, 2008, at 8:01 AM, Aditya Mahajan wrote: > Nested patterns is something where gema really excels. Here is a gema > script to convert \footnote{{something}} to \footnote{something} > > :\\footnote\W\{\{\}\}=\\footnote\{$1\} > matchbrace:\{#\}=\{#\} > matchbrace:\\=\\$1 > > Save it as footnote.gema and then run > > gema -f footnote.gema tex-file > output-file > > It handles these expressions correctly: > > \footnote{{This $\frac{a}{b^{c+d}}$ is a strange footnote}} > > \footnote{{This $\frac{a}{b^{c+d}}$ is a strange footnote with > multiple {nested > {expressions}}}} > > \footnote{{This $\frac{\left[\frac {a}{b}\right\}}{c}$ is a strange > footnote}} > > It is much easier to write than regular expressions. Unfortunately, > gema > expressions can be as hard as regular expressions to read. > > Aditya ___________________________________________________________________________________ If your question is of interest to others as well, please add an entry to the Wiki! maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context webpage : http://www.pragma-ade.nl / http://tex.aanhet.net archive : https://foundry.supelec.fr/projects/contextrev/ wiki : http://contextgarden.net ___________________________________________________________________________________