From: "Arnaldo Mandel" <am@ime.usp.br>
To: "Andreas Politz" <politza@fh-trier.de>
Cc: help-gnu-emacs@gnu.org
Subject: Re: regexp to strip off LaTeX command
Date: Thu, 18 Dec 2008 11:27:23 -0200 [thread overview]
Message-ID: <72df5b830812180527k60621054pb4b07385435035f7@mail.gmail.com> (raw)
In-Reply-To: <1229592056.359077@arno.fh-trier.de>
[-- Attachment #1: Type: text/plain, Size: 701 bytes --]
On Thu, Dec 18, 2008 at 7:19 AM, Andreas Politz <politza@fh-trier.de> wrote:
> henry atting wrote:
>
>> Hi,
>>
>> I am searching a regexp for `replace-regexp' to remove only one LaTeX
>> command. Let's say I want to remove all \textit{} commands but not the
>> text within the braces, how can I do this?
>>
>> henry
>>
>>
> \\textit{\([^}]*\)} -> \1
>
> If you need to handle escaped brackets the regexp gets a little longer.
>
They can get impossibly longer. There is no way to get regexps to do this
job in full.
Your best bet is to use an utility called detex together with
shell-command-on-region.
detex is in the Debian package texlive-extra-utils, but can certainly be
obtained directly.
am
[-- Attachment #2: Type: text/html, Size: 1182 bytes --]
next prev parent reply other threads:[~2008-12-18 13:27 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-18 9:08 regexp to strip off LaTeX command henry atting
2008-12-18 9:19 ` Andreas Politz
2008-12-18 9:47 ` henry atting
2008-12-18 15:15 ` Andreas Politz
2008-12-18 13:27 ` Arnaldo Mandel [this message]
2008-12-22 2:47 ` Plamen Tanovski
-- strict thread matches above, loose matches on Subject: below --
2008-12-19 9:47 Bourgneuf Francois
[not found] <mailman.3104.1229680078.26697.help-gnu-emacs@gnu.org>
2008-12-20 14:11 ` henry atting
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=72df5b830812180527k60621054pb4b07385435035f7@mail.gmail.com \
--to=am@ime.usp.br \
--cc=help-gnu-emacs@gnu.org \
--cc=politza@fh-trier.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.