emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Kaushal Modi <kaushal.modi@gmail.com>
To: William Denton <wtd@pobox.com>
Cc: emacs-org list <emacs-orgmode@gnu.org>
Subject: Re: How to handle strings with commas in macros?
Date: Thu, 7 Apr 2022 12:42:40 -0400	[thread overview]
Message-ID: <CAFyQvY3QyHP57Ev0ij2d57sF9TykSihybBpa=3rZgGOD7S7FMQ@mail.gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.22.394.2204071222270.52468@shell3.miskatonic.org>

[-- Attachment #1: Type: text/plain, Size: 700 bytes --]

On Thu, Apr 7, 2022 at 12:30 PM William Denton <wtd@pobox.com> wrote:

> I'm using macros to format names in a LaTeX export, like so:
>
> on export and LaTeX will format it.  That works fine.  But in an index of
> names,
> if I want
>
> {{{m(Denton, William)}}}
>
> then Org takes that as two arguments to the macro, and outputs
>
> \m{Denton}
>
> Is there a way to get around this?
>

The comma needs to be backslash escaped.

{{{m(Denton\, William)}}}

Ref: (org) Macro Replacement

> (1) Since commas separate the arguments, commas within arguments have
to be escaped with the backslash character.  So only those backslash
characters before a comma need escaping with another backslash
character.

[-- Attachment #2: Type: text/html, Size: 1127 bytes --]

  reply	other threads:[~2022-04-07 16:43 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-07 16:29 How to handle strings with commas in macros? William Denton
2022-04-07 16:42 ` Kaushal Modi [this message]
2022-04-07 19:46   ` William Denton
2022-04-07 16:55 ` Eric S Fraga

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.orgmode.org/

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

  git send-email \
    --in-reply-to='CAFyQvY3QyHP57Ev0ij2d57sF9TykSihybBpa=3rZgGOD7S7FMQ@mail.gmail.com' \
    --to=kaushal.modi@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=wtd@pobox.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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).