How to escape an at-sign @ in Pandoc markdown
Using pandoc markdown to write a text book - I came across a table from Wikipedia I wanted to include.
--------- ------------------------------------------------- ------------------- @yearly Run once a year at midnight of January 1st ```0 0 1 1 *``` @monthly Run once a month, midnight 1st day of the month. ```0 0 1 * *``` @weekly Run once a week at midnight on Sunday morning ```0 0 * * 0``` @daily Run once a day at midnight ```0 0 * * *``` @hourly Run once an hour at the beginning of the hour. ```0 * * * *``` @reboot Run at startup. @reboot --------- ------------------------------------------------- -------------------
</code>
But using Pandoc markdown syntax on Windows (you need to use the MiKTeX Latex PDF engine) causes a crash when encountering @yearly
. Or so I thought. When I changed the code to look like this no crashing:
Entry Description Equivalent to --------- ------------------------------------------------- ------------------- @yearly Run once a year at midnight of January 1st ```0 0 1 1 *``` @monthly Run once a month, midnight 1st day of the month. ```0 0 1 * *``` @weekly Run once a week at midnight on Sunday morning ```0 0 * * 0``` @daily Run once a day at midnight ```0 0 * * *``` @hourly Run once an hour at the beginning of the hour. ```0 * * * *``` @reboot. Run at startup @reboot --------- ------------------------------------------------- -------------------
</code>
The @ sign is a reserved LaTeX word and causes a crash.
The solution is to use the HTML ascii code for an @ sign which is: &#64;
which will render correctly as ascii and unconfuse the LaTeX compiler and remove the error.