unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Hongyi Zhao <hongyi.zhao@gmail.com>
To: Michael Heerdegen <michael_heerdegen@web.de>
Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>
Subject: Re: Convert some Latex expressions in Emacs.
Date: Tue, 17 May 2022 10:12:39 +0800	[thread overview]
Message-ID: <CAGP6POLexT7jkkwcibK4K9pqG0jedvPzpJNFf_1Ob_1C67LabQ@mail.gmail.com> (raw)
In-Reply-To: <87k0alvxf4.fsf@web.de>

On Tue, May 17, 2022 at 8:02 AM Michael Heerdegen
<michael_heerdegen@web.de> wrote:
>
> Hongyi Zhao <hongyi.zhao@gmail.com> writes:
>
> > 1. Remove the following stuff: `\begin{array}{l}', `\end{array}'.
> > 2. For each word, remove '{' and '}', spaces, and add * between two
> > characters of it, i.e., `P^{5} Q^{2} R' should be changed to
> > `P^5*Q^2*R'.
> > [...]
>
> If you have some time you might have a look at peg.el (from Gnu Elpa).
> PEGs (Parsing Expression Grammars) are a bit more expressive than
> regular expressions.  Takes a bit of time to get used to the concept but
> if you have to solve such tasks more often it may pay off.

I roughly browse the relevant introduction here [1]. It seems that all
Emacs Lisp based regex patterns are more complicated and tedious than
other languages, e.g., python, wolfram, and so on.

[1] https://elpa.gnu.org/packages/peg.html

> Michael.
>
Regards,
Hongsheng



  reply	other threads:[~2022-05-17  2:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-16  3:25 Convert some Latex expressions in Emacs Hongyi Zhao
2022-05-16  4:49 ` Emanuel Berg
2022-05-17  0:02 ` Michael Heerdegen
2022-05-17  2:12   ` Hongyi Zhao [this message]
2022-05-17  2:22     ` Emanuel Berg
2022-05-17  3:23     ` Michael Heerdegen
2022-05-17  3:38       ` Michael Heerdegen
2022-05-17  3:44       ` Hongyi Zhao
2022-05-17  4:46         ` Emanuel Berg
2022-05-18  0:25           ` Hongyi Zhao
2022-05-17 23:45         ` Michael Heerdegen
2022-05-18  0:23           ` Hongyi Zhao

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAGP6POLexT7jkkwcibK4K9pqG0jedvPzpJNFf_1Ob_1C67LabQ@mail.gmail.com \
    --to=hongyi.zhao@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=michael_heerdegen@web.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).