By verbatim, if you actually mean use some markup in the exported LaTeX, then you can just use =*shrug*=
. However if you just want it to be exported as *shrug*
, and you want to do this all the time, I would recommend filters. If however, you only need this for some instances of *shrug*
, you should use the alternative suggested by @wvxvw. You could do this cleanly using macros. Some examples follow.
Filters
(defun my-bold (contents backend info)
(when (org-export-derived-backend-p backend 'latex)
(replace-regexp-in-string "\\`\\\\textbf{\\(.+\\)}"
"\\\\ast{}\\1\\\\ast{}" contents)))
(add-to-list 'org-export-filter-bold-functions 'my-bold)
Essentially the above filter looks for the \textbf{..}
markup in the transcoded string, and replaces it with \ast{}..\ast{}
, without changing whatever was wrapped inside {..}
. I have not tested the regular expression and the replacement string, so there could be mistakes, but you get the idea. Similarly to cover other backends, one can include extra snippets like this:
(when (org-export-derived-backend-p backend 'html)
(replace-regexp-in-string "<b>\\(.+\\)</b>" "\a;\\1\a;" contents))
Same caveat holds for the regular expression above.
Macros
Org source:
#+macro: nobold @@latex:\ast{}$1\ast{}@@ @@html:a;$1a;@@
This text is *bold* this is nobold{{{not}}}
exports to LaTeX as:
This text is \textbf{bold} this is \ast{}not\ast{}
and to HTML as:
This text is <b>bold</b> this is a;nota;
You can of course add as many backends as you wish to the macro.
Edit: as Kaushal points out in the comments, the export snippet for latex is optional in this case. I however prefer to use them whenever bare latex is involved, since I find it rather difficult to keep track of the list of org-entities
and the specific rules behind identifying bare latex in Org source.
Note:
- the filter examples are untested,
- I don't know any
HTML
, so there might be some mistakes in the respective bits.
\ast{}shrug\ast{}
or\star{}shrug\star{}
, similar, with HTML you could use entity encoding:a;
, or if adding spaces before or after the asterisk is an option, that would work too. – wvxvw Sep 17 '15 at 8:41code
-tag, and in markdown has backticks. I want it to be not formatted in any way at all. – timor Sep 17 '15 at 16:08\ast{}shrug\ast{}
mentioned by wvxvw is probably your best option. it exports to html as∗shrug∗
and to latex as$\ast$shrug$\ast$
using the appropriate character entities.org-toggle-pretty-entities
displays them as UTF8 characters in the org buffer. – mutbuerger Sep 17 '15 at 16:49