Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to escape '|" character into an org-mode table

Tags:

emacs

org-mode

I am building some tables in org-mode and I need to enter "||" into the table (for the logical OR command) and nothing I try turns the two characters off as table constructors.

I've tried single quotes, double quotes, backticks and prefacing them with '\'. I've also tried every permutation of using ':=' to get a literal string and they don't work.

// Tony Williams

like image 245
Tony Williams Avatar asked Mar 17 '23 12:03

Tony Williams


2 Answers

Depending on what you want to do with the output of the table, you could use alternative unicode characters that look like vertical pipes (or double vertical pipes). Examples:

This is the pipe character written twice (as for logical OR):
||
Those are similar (or not too different) looking unicode characters
‖ - ¦¦ - ❘❘

Of course, this won't work for you if you are not just interested in the looks (but escaping pipes would not work either).

See here more unicode characters you might like better than those 3 above

like image 54
juanleon Avatar answered Mar 23 '23 22:03

juanleon


It turns out that you can use HTML entities in org-mode tables for output via pandoc.

\vert{} doesn't work but I went to the table pointed to by MrSpock and tried the HTML entity and the output when run through pandoc was perfect. || gives me '||'. I also tested a few other HTML entities and they also worked fine.

like image 34
Tony Williams Avatar answered Mar 23 '23 20:03

Tony Williams