emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Rasmus <rasmus@gmx.us>
To: alan.schmitt@polytechnique.org
Cc: emacs-orgmode@gnu.org
Subject: Re: interaction between org-latex-custom-lang-environments and name when exporting to latex
Date: Tue, 24 Nov 2015 14:14:25 +0100	[thread overview]
Message-ID: <87vb8rbkum.fsf@gmx.us> (raw)
In-Reply-To: <m2poyz3jnz.fsf@charm-ecran.irisa.fr> (Alan Schmitt's message of "Tue, 24 Nov 2015 09:07:12 +0100")

Hi,

Alan Schmitt <alan.schmitt@polytechnique.org> writes:

>> Then the cdr of an element in org-latex-custom-lang-environments can be
>> something like:
>>
>>    \begin{%e}[label=%l, myfunkyoption=val]
>>     %c
>>     \end{%e}
>
> What would "%e" be bound to? Since this is a customization for a given
> source block, it should be fixed, so I think we only need "%l" and "%c".

You are right on the %e of course.  You should check the things we bind in
the top let-binding.  The useful ones should be accessible.  A quick
guess (you’ll have to decide):

- lang
- caption
- label
- float
- perhaps more from attributes?


>> The only downside is that you’d have to somehow discriminate between the
>> "old" case where the cdr is a single word denoting an environment.
>> Something like this might work:
>>
>>           (string-match-p "\\`\\w+\\'" "hest1")
>
> This was the main reason why I did not want to go that route. This said,
> after understanding this regexp, I see how I can explain how the two
> cases are distinguished in the docstring.

Perhaps it’s safer to use [[:alnum:]] or even [a-zA-Z0-9].  \w follows the
syntax table which might go weird, though I’m not sure how.

>> Well, functions would be user written.  In general I’d favor info and
>> src-block, but I don’t think it’s very user-friendly, as it requires quite
>> some knowledge about how ox works.  Also, when using such functions, the
>> user would have to write a lot of boilerplate to get e.g . the label.
>
> Yes. I'll give the template string a try and will report back.

Thanks Alan!

Rasmus

-- 
Warning: Everything saved will be lost

  reply	other threads:[~2015-11-24 13:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-16 12:59 interaction between org-latex-custom-lang-environments and name when exporting to latex Alan Schmitt
2015-11-20  7:55 ` Alan Schmitt
2015-11-20 10:41   ` Rasmus
2015-11-20 11:06     ` Alan Schmitt
2015-11-23 11:13     ` Alan Schmitt
2015-11-23 17:54       ` Rasmus
2015-11-24  8:07         ` Alan Schmitt
2015-11-24 13:14           ` Rasmus [this message]
2015-11-25  7:59             ` Alan Schmitt
2015-11-25  9:57               ` Rasmus
2015-11-27 16:27                 ` Alan Schmitt
2015-11-27 21:05                   ` Rasmus
2015-11-30 12:12                     ` Alan Schmitt
2015-11-30 13:11                       ` Rasmus
2015-12-01  8:14                         ` Alan Schmitt

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=87vb8rbkum.fsf@gmx.us \
    --to=rasmus@gmx.us \
    --cc=alan.schmitt@polytechnique.org \
    --cc=emacs-orgmode@gnu.org \
    /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).