On 16/03/2022 21:04, Greg Minshall wrote:
hi.
@@org:@@^1 blah
i'm not familiar with the '@@' construct. in the manual, searching for
the string "@@", i see references to various =@@foo...=, but not, for
example, =@@org:@@=.
is there a general definition? might the index (or, one of the indices)
usefully have references to various "special" characters (like "^", "|",
and "@" when used in TODOs, iiuc)?
I have not found definition of export snippet in the manual as well, so:
https://orgmode.org/worg/dev/org-syntax.html#Export_Snippets
It is an export snippet that is expanded to nothing and "org" is the
backend name (alphanumeric characters). I choose "org" for two reasons:
- `org-lint' might report unknown backend (it does not do it currently
though and `ox-org' is not loaded by default)
- perfect solution should survive after export to org. From my point of
view, it is a bug in `ox-org' that it ignores @@org:...@@ (and other)
export snippets. My expectation that they should be copied verbatim to
allow further export to arbitrary format.
So the main problem with
@@org:@@^1 one
that it would not work after export to org.
Another solution:
#+options: broken-links:t
[[#not-found][{}]^2 two
It works but the price is that really broken links may remain unnoticed.
A custom entity may be better:
#+begin_src elisp :exports (if (org-export-derived-backend-p
org-export-current-backend 'org) "sources" "results") :results silent
(setq org-entities-user '(("relax" "" nil "" "" "")))
#+end_src
\relax^3 three
Actually all these recipes are the outcome of flame in the threads about
intra-word markup. Notice that a macro expanded to empty string does not
work.
P.S. Juan Manuel, I was expecting that you suggested a custom link:
#+begin_src elisp :exports (if (org-export-derived-backend-p
org-export-current-backend 'org) "sources" "results") :results silent
(org-link-set-parameters
"discard"
:export (lambda (_path _descr _backend) ""))
#+end_src
[[discard:][{}]]^5 four