Is there any way to replace some text before or after exporting it with ^text^?
I have a TBX file with lots of notes that I want to use for a book (LaTeX→PDF) and a website. To keep the content and styling consistent, I keep the notes free from code and use only basic text formatting in the text editor. For the LaTeX export I use a LaTeX prototype with the appropriate markup in the Export Inspector. For the advanced formatting I wrote a LaTeX Template that works very well for me.
Now I have some web links inside my notes that export to:
(<a href="https://abc.de">my link</a>)
which confuses LaTeX. I’d like to change them to LaTeX hyperref syntax:
\href{https://abc.de}{my link}.
Of course, I can replace the link code using RegEx in my LaTeX template by replacing ^text^ with
This topic hasn’t come up for a bit but you might want to check this article on using LaTeX. I think others are using Markdown-based ‘HTML’ export to Pandoc and exporting LaTeX from there (but I’m less clear on the detail).
Thanks for the prompt reply! This article covers the basics but warns that some aspects of HTML markup, such as the link formatting, cannot be altered. But meanwhile I’ve found a solution…
Here’s how:
Define a string attribute $Text_LaTeX for the “top level” note used for exporting
Set up another LaTeX template "LaTeX postprocessing":