[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Experimental public branch for inline special blocks
From: |
Juan Manuel Macías |
Subject: |
Experimental public branch for inline special blocks |
Date: |
Fri, 01 Mar 2024 20:34:35 +0000 |
Hi,
Finally, I have made public on GitLab my experimental branch for the new
(possible) inline-special-block element:
<https://gitlab.com/maciaschain/org-mode.git>
The code incorporates fixes and modifications and I have also added some
ideas from Maxim Nikulin. The LaTeX and HTML backends are complete,
although of course it can still be perfected. Recapitulating the
necessary information:
The new element can be nested and supports other elements such as links,
macros, emphasis marks, etc.
The basic syntax:
┌────
│ &foo{lorem ipsum dolor}
└────
produces in LaTeX:
┌────
│ \foo{lorem ipsum dolor}
└────
and in HTML:
┌────
│ <span class="foo">lorem ipsum dolor</span>
└────
There is also an anonymous variant:
┌────
│ &_{lorem ipsum dolor}
└────
Optional attributes in square brackets are supported. There are a series
of 'universal' attributes, common to each backend. At the moment:
`:lang', `:color' and `:smallcaps'. Example:
┌────
│ &foo[:color red :smallcaps t :lang it]{lorem ipsum dolor}
└────
Specific to the LaTeX backend we have the `:prelatex' and `:postlatex'
attributes (which introduce arbitrary code before and after the content)
and `:latex-command', which overrides the exported command.
`:latex-command nocommand' does not export a command flag. Examples:
┌────
│ &foo[:prelatex [bar] :postlatex {baz} :lang it :latex-command blah]{lorem
ipsum dolor}
└────
==>
┌────
│ \foreignlanguage{italian}{\blah[bar]{lorem ipsum dolor}{baz}}
└────
┌────
│ &_[:prelatex \foo{bar} :color red]{lorem ipsum dolor}
└────
==>
┌────
│ {\color{red}\foo{bar}lorem ipsum dolor}
└────
Likewise, for HTML we have the `:html-tag' and `:html-class' attributes
(which override the tags and the class name) and another one, more
generic, `:html', which introduces arbitrary code, such as
`style="..."'.
We can group lists of attributes as aliases. The syntax waould be:
┌────
│ &alias!{text}
└────
and we can also combine aliases with more single attributes:
┌────
│ &alias![more-attributes]{text}
└────
An example: let's imagine that we want a specific block for short quotes
in Latin and italics (it is normative in some typographical traditions
that quotes in classical Latin are put in italics instead of quotation
marks):
┌────
│ #+options: inline-special-block-aliases:(("latin" :lang "la" :latex-command
"textit" :html-tag "em"))
│
│ Caesar's famous quote: &latin!{Alea iacta est}
│
│ Caesar's famous quote: &latin![:smallcaps t :color blue]{Alea iacta est}
└────
==> LaTeX:
┌────
│ Caesar's famous quote: \foreignlanguage{latin}{\textit{Alea iacta est}}
│
│ Caesar's famous quote:
{\scshape{}\color{blue}\foreignlanguage{latin}{\textit{Alea iacta est}}}
└────
== HTML:
┌────
│ Caesar's famous quote: <em lang="la" class="latin">Alea iacta est</em>
│
│ Caesar's famous quote: <em style="color:blue;font-variant:small-caps;"
lang="la" class="latin">Alea iacta est</em>
└────
Best regards,
Juan Manuel
--
Juan Manuel Macías -- Composición tipográfica, tratamiento de datos, diseño
editorial y ortotipografía
- Experimental public branch for inline special blocks,
Juan Manuel Macías <=
- Re: Experimental public branch for inline special blocks, Stefan Nobis, 2024/03/02
- Re: Experimental public branch for inline special blocks, Juan Manuel Macías, 2024/03/03
- `:export' attribute?: Re: Experimental public branch for inline special blocks, Juan Manuel Macías, 2024/03/09
- Re: `:export' attribute?: Re: Experimental public branch for inline special blocks, Juan Manuel Macías, 2024/03/10
- Re: `:export' attribute?: Re: Experimental public branch for inline special blocks, Max Nikulin, 2024/03/11
- Re: `:export' attribute?: Re: Experimental public branch for inline special blocks, Juan Manuel Macías, 2024/03/11
- Re: `:export' attribute?: Re: Experimental public branch for inline special blocks, Max Nikulin, 2024/03/11
- Re: `:export' attribute?: Re: Experimental public branch for inline special blocks, Juan Manuel Macías, 2024/03/11
- Re: `:export' attribute?: Re: Experimental public branch for inline special blocks, Stefan Nobis, 2024/03/12