From: "Juan Manuel Macías" <maciaschain@posteo.net>
To: Ihor Radchenko <yantar92@gmail.com>
Cc: orgmode <emacs-orgmode@gnu.org>
Subject: Re: [Patch] Pre-/postpend arbitrary LaTeX code to a section
Date: Sat, 24 Sep 2022 14:50:32 +0000 [thread overview]
Message-ID: <87h70wbzd3.fsf@posteo.net> (raw)
In-Reply-To: <87czbna4e4.fsf@localhost> (Ihor Radchenko's message of "Thu, 22 Sep 2022 22:08:03 +0800")
Hi, Ihor, sorry for the late reply,
Ihor Radchenko writes:
> Having read the available replies in this thread, I am thinking of the
> following:
>
> 1. Instead of explicit prefix and suffix, we can unify extra text around
> the exported Org element to a template:
>
> * headline
> :PROPERTIES:
> :ATTR_BACKEND: :export_template "\begin{myenv}\n%s\n\end{myenv}"
> :ATTR_BACKEND+: "The %%s instances are replaced by the exported element"
> :ATTR_BACKEND+: (concat "arbitrary sexp, the exported element is bound to: " *this*)
> :ATTR_BACKEND+: babel_block_name(exported=*this*)
> :ATTR_BACKEND+: "the property lines are concatenated with \" \" (space),"
> :ATTR_BACKEND+: "just like the usual approach in `org-export-read-attribute'"
> :END:
I really like this approach and I would buy it. On the one hand, if I
understand correctly, it's a universal solution that doesn't depend on a
particular backend (although, to be honest, I don't see much use for
this beyond LaTeX: maybe in HTML). And, on the other hand,
`:export_template' is an attribute that can be, as you say, very
versatile. With this, in my opinion, it would no longer be necessary to
define two 'pre' and 'post' attributes.
I imagine the value of ATTR_BACKEND (would quotes be necessary?) could
be easily converted to a plist, with code borrowed from
`org-export-read-attribute':
(:export_template "\\begin{myenv}\\n%s\\n\\end{myenv} ... etc. ...")
> #+ATTR_BACKEND: :export_template "can also work on non-headings"
> Paragraph.
In this case I would not see it necessary, IMHO. For simple things (of
the begin/end style) there are the special blocks. And for more complex
pre- and/or post- code we have export blocks and export snippets. Since
there is no heading involved here, there would be no danger of the
pre-code leaving with the content of the previous header.
Best regards,
Juan Manuel
--
--
------------------------------------------------------
Juan Manuel Macías
https://juanmanuelmacias.com
https://lunotipia.juanmanuelmacias.com
https://gnutas.juanmanuelmacias.com
next prev parent reply other threads:[~2022-09-24 14:51 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-18 12:27 [Patch] Pre-/postpend arbitrary LaTeX code to a section Juan Manuel Macías
2022-09-18 16:14 ` Max Nikulin
2022-09-19 10:04 ` Fraga, Eric
2022-09-20 13:26 ` Ihor Radchenko
2022-09-20 17:18 ` Juan Manuel Macías
2022-09-21 8:55 ` Ihor Radchenko
2022-09-21 9:32 ` Fraga, Eric
2022-09-21 9:49 ` Timothy
2022-09-22 13:50 ` Ihor Radchenko
2022-09-21 13:55 ` Daniel Fleischer
2022-09-21 14:51 ` Juan Manuel Macías
2022-09-21 15:21 ` Fraga, Eric
2022-09-22 13:51 ` Ihor Radchenko
2022-09-21 14:42 ` Max Nikulin
2022-09-21 14:43 ` Juan Manuel Macías
2022-09-22 14:08 ` Ihor Radchenko
2022-09-24 14:50 ` Juan Manuel Macías [this message]
2022-09-25 3:33 ` Ihor Radchenko
2022-09-25 12:06 ` Juan Manuel Macías
2022-09-26 3:56 ` Ihor Radchenko
2022-09-26 7:47 ` Juan Manuel Macías
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=87h70wbzd3.fsf@posteo.net \
--to=maciaschain@posteo.net \
--cc=emacs-orgmode@gnu.org \
--cc=yantar92@gmail.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).