On 08/12/2022 19:38, Carlos MartÃnez wrote:
#+MACRO: sc (eval (if (org-export-derived-backend-p
org-export-current-backend 'latex) (concat "@@latex:\\textsc{@@" $1
"@@latex:}@@") (concat "@@odt:<text:span
text:style-name=\"T1\">@@"$1"@@odt:</text:span>@@")))
^ ^
Your missed spaces around $1, but it is unlikely a problem.
Disclaimer: I know almost nothing about odt. Have you customized ODT
styles? I do not see "T1" in etc/styles/OrgOdtStyles.xml
info "(org) Advanced topics in ODT export"
https://orgmode.org/manual/Advanced-topics-in-ODT-export.html
I want to achieve something like this: "When exporting to LaTeX (o
derived formats), surround the argument with \textsc{}; if any other
format [it will always be odt], do the same with the proper odt code.
I recommend fallback to the argument as plain text for other backends:
(cond
((org-export-derived-backend-p org-export-current-backend 'latex)
(concat ; or format
))
((org-export-derived-backend-p org-export-current-backend 'odt)
; ...
))
(t $1))
If you are absolutely sure that you will never export the file to ascii
or html then no `eval' is necessary
#+MACRO: sc @@latex:\textsc{$1}@@@@odt:<text:span
text:style-name="T1">$1</text:span>@@
Here I assume that macro argument contains no markup and can be safely
put inside export snippets. Otherwise a bit longer version closer to
`concat' arguments in your original variant would be better.
Another point is the name. Small caps as "sc" means direct formatting. A
name based on "roman number" might be better. If some other objects
should be formatted as small caps then creating another macro might help
to change styles independently later.