emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[testing patch] inline-special-block with full implementation for LaTeX


From: Juan Manuel Macías
Subject: [testing patch] inline-special-block with full implementation for LaTeX backend
Date: Fri, 23 Feb 2024 23:50:52 +0000

This patch is for testing purposes only, although the implementation for
LaTeX backend is perfectly usable.

The basic syntax of the new element is:

&foo{lorem ipsum dolor}

=> LaTeX: \foo{lorem ipsum dolor}

Nested elements are possible, as well as the inclusion of other elements
such as macros, links or emphasis marks.

The element also supports a list of optional arguments. For the LaTeX
backend there are two specific arguments: :prelatex and :postlatex.
Example:

&foo[:prelatex [bar] :postlatex {baz}]{lorem ipsum dolor}

=> LaTeX: \foo[bar]{lorem ipsum dolor}{baz}

Additionally, there are a number of universal arguments that should be
equivalent between backends where it makes sense to use them (LaTeX,
HTML, odt...). At the moment you can use: :color, :lang and :smallcaps.
Example:

&foo[:color red :smallcaps t :lang french :prelatex [bar] :postlatex 
{baz}]{lorem ipsum dolor}

=> LaTeX: {\scshape{}\color{red}\foreignlanguage{french}{\foo[bar]{lorem ipsum 
dolor}{baz}}}

The element also has an anonymous variant that only accepts universal
arguments. If set without arguments it simply returns the content
string. Example:

&_[:color blue :lang italian]{lorem ipsum dolor}

=> LaTeX: {\color{blue}\foreignlanguage{italian}{lorem ipsum dolor}}

We can define in the document a list of aliases that group several arguments:

#+options: inline-special-block-aliases:(("myalias" :color "magenta" :lang 
"klingon") ("myalias2" :smallcaps t :color "blue" :prelatex "{2345}")) 

&_[:alias myalias :smallcaps t]{lorem ipsum dolor}

=> LaTeX: {\scshape{}\color{magenta}\foreignlanguage{klingon}{lorem ipsum 
dolor}}

&foo[:alias myalias2]{lorem ipsum dolor}

=> LaTeX: {\scshape{}\color{blue}\foo{2345}{lorem ipsum dolor}}

There can only be one alias per element, but an alias can be combined
with other attributes. It is the closest thing to using styles,
and perhaps the most appropriate term would be ":style". But you can get
confused with the html "style" attribute.

Best regards,

Juan Manuel

Attachment: 0001-org-element.el-New-element-Inline-Special-Block.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]