* Re [Patch] Pre-/postpend arbitrary LaTeX code to a section
@ 2022-09-19 8:59 Pedro Andres Aranda Gutierrez
2022-09-20 13:19 ` Ihor Radchenko
0 siblings, 1 reply; 5+ messages in thread
From: Pedro Andres Aranda Gutierrez @ 2022-09-19 8:59 UTC (permalink / raw)
To: Org Mode List, maciaschain
[-- Attachment #1: Type: text/plain, Size: 464 bytes --]
HI Juan Manuel,
Looks cool and would be a +1 from my side, since I need that too...
Can it be extended to add properties to a
#BEGIN_example
#END_example
snippet?
I already suggested that some time ago...
/PA
--
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler
Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet
[-- Attachment #2: Type: text/html, Size: 838 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Re [Patch] Pre-/postpend arbitrary LaTeX code to a section
2022-09-19 8:59 Re [Patch] Pre-/postpend arbitrary LaTeX code to a section Pedro Andres Aranda Gutierrez
@ 2022-09-20 13:19 ` Ihor Radchenko
2022-09-20 19:35 ` Juan Manuel Macías
0 siblings, 1 reply; 5+ messages in thread
From: Ihor Radchenko @ 2022-09-20 13:19 UTC (permalink / raw)
To: Pedro Andres Aranda Gutierrez; +Cc: Org Mode List, maciaschain
Pedro Andres Aranda Gutierrez <paaguti@gmail.com> writes:
> Can it be extended to add properties to a
> #BEGIN_example
> #END_example
> snippet?
Didn't we conclude that wrapping blocks during LaTeX export should be
done via special blocks? (This question has been raised multiple times,
I am unsure if you are referring to the same discussion I have in mind).
--
Ihor Radchenko,
Org mode contributor,
Learn more about Org mode at https://orgmode.org/.
Support Org development at https://liberapay.com/org-mode,
or support my work at https://liberapay.com/yantar92
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Re [Patch] Pre-/postpend arbitrary LaTeX code to a section
2022-09-20 13:19 ` Ihor Radchenko
@ 2022-09-20 19:35 ` Juan Manuel Macías
0 siblings, 0 replies; 5+ messages in thread
From: Juan Manuel Macías @ 2022-09-20 19:35 UTC (permalink / raw)
To: Ihor Radchenko; +Cc: Pedro Andres Aranda Gutierrez, Org Mode List
Ihor Radchenko writes:
>> Can it be extended to add properties to a
>> #BEGIN_example
>> #END_example
>> snippet?
>
> Didn't we conclude that wrapping blocks during LaTeX export should be
> done via special blocks? (This question has been raised multiple times,
> I am unsure if you are referring to the same discussion I have in mind).
Special blocks is usually the best solution for these cases. But
(without wishing to add more fuel to old discussions) I think it would
be nice to have as attr_latex a series of positions similar to the hooks
in the etoolbox LaTeX package:
\AtBeginEnvironment
\AtEndEnvironment
\BeforeBeginEnvironment
\AfterEndEnvironment
Something like :pre :post :precontent :postcontent.
In the case of blocks, I think this would simplify the documents a lot
if what you are looking for makes sense only in LaTeX export (special
blocks are exported to everything).
And in the case of floating objects such as tables or figures, it would
be really useful, since here you cannot resort to the use of special
blocks (*inside* those environments, I mean), and the workarounds that are
usually provided are still a bit tricky.
Best regards,
Juan Manuel
--
--
------------------------------------------------------
Juan Manuel Macías
https://juanmanuelmacias.com
https://lunotipia.juanmanuelmacias.com
https://gnutas.juanmanuelmacias.com
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Re: [Patch] Pre-/postpend arbitrary LaTeX code to a section
@ 2022-09-22 6:31 Pedro Andres Aranda Gutierrez
0 siblings, 0 replies; 5+ messages in thread
From: Pedro Andres Aranda Gutierrez @ 2022-09-22 6:31 UTC (permalink / raw)
To: Org Mode List
[-- Attachment #1: Type: text/plain, Size: 946 bytes --]
Ihor writes;
> More concretely, I mean something like
>
> * Section
> :PROPERTIES:
> :attr_latex: :prepend "section" \setcounter{secnumdepth}{0}
> :attr_latex+: :prepend "section"
\addtocontents{toc}{\protect\setcounter{tocdepth}{0}\ignorespaces}
> :attr_latex+: :append "section" \setcounter{secnumdepth}{2}
> :attr_latex+: :append "section"
\addtocontents{toc}{\protect\setcounter{tocdepth}{2}\ignorespaces}
> :END:
Could do if it where for the 'little' detail that a section is not an
environment in Latex
The ORG document structure mimics the LaTEX document structure. To control
headers, we need the \At... commands Juan Manuel suggests IMv(^n)HO [n>10]
My 10^-10 cents, /PA
--
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler
Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet
[-- Attachment #2: Type: text/html, Size: 1430 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Re: [Patch] Pre-/postpend arbitrary LaTeX code to a section
@ 2022-09-23 5:40 Pedro Andres Aranda Gutierrez
0 siblings, 0 replies; 5+ messages in thread
From: Pedro Andres Aranda Gutierrez @ 2022-09-23 5:40 UTC (permalink / raw)
To: Org Mode List; +Cc: Ihor Radchenko
[-- Attachment #1: Type: text/plain, Size: 1133 bytes --]
Ihor writes:
> * 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:
>
> #+ATTR_BACKEND: :export_template "can also work on non-headings"
> Paragraph.
That looks nice :-) If ypu could you do something like:
#+ATTR_BACKEND: :export_template "\begin{myenv}[myopts]\n%s\n\end{myenv}"
#+ATTR_BACKEND+: :export_template raw_text(exported="this")
#+BEGIN_example
...
#+END_example
I would be able to do what I asked for some time ago :-)
Thanks for the patience, /PA
--
Fragen sind nicht da um beantwortet zu werden,
Fragen sind da um gestellt zu werden
Georg Kreisler
Headaches with a Juju log:
unit-basic-16: 09:17:36 WARNING juju.worker.uniter.operation we should run
a leader-deposed hook here, but we can't yet
[-- Attachment #2: Type: text/html, Size: 1868 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-09-23 5:43 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-19 8:59 Re [Patch] Pre-/postpend arbitrary LaTeX code to a section Pedro Andres Aranda Gutierrez
2022-09-20 13:19 ` Ihor Radchenko
2022-09-20 19:35 ` Juan Manuel Macías
-- strict thread matches above, loose matches on Subject: below --
2022-09-22 6:31 Pedro Andres Aranda Gutierrez
2022-09-23 5:40 Pedro Andres Aranda Gutierrez
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).