0

In org mode, I have following table. (To enter | char inside table I used \vert)

#+attr_latex: :align |lclr| :placement [H]
|----------------+---------------------------------+----------------------------------+-------------|
| key            | sym                             | trans                            | description |
|----------------+---------------------------------+----------------------------------+-------------|
| ~().~          | $\left( \right)$                | ~\left( \right)~                 |             |
| ~()..~         | $\left( \middle\vert  \right)$  | ~\left( \middle\vert  \right)~   |             |
| ~[].~          | $\left[ \right]$                | ~\left[ \right]~                 |             |
| ~[]..~         | $\left[ \middle\vert  \right]$  | ~\left[ \middle\vert  \right]~   |             |
| ~{}.~          | $\left\{ \right\}$              | ~\left\{ \right\}~               |             |
| ~{}..~         | $\left\{ \middle\vert  \righ\}$ | ~\left\{ \middle\vert  \right\}~ |             |
| ~\vert\vert.~  |                                 |                                  |             |
| \vert\vert ~.~ | $\left\vert \right\vert$        | ~\left\vert \right\vert~         |             |
|----------------+---------------------------------+----------------------------------+-------------|

When exported to LaTeX PDF this above table becomes following: enter image description here

Question: How to make mono-space | character in Org table cell?

1
  • 1
    This looks like a latex question to me. Does the answer here answer your question? I think you can write latex by placing the 'definition' between $ signs (like you to in the 'sym' column). Apr 10, 2023 at 7:11

1 Answer 1

1

Instead of using \vert, as the Org mode manual recommends, in order to put a vertical bar inside a table so that it won't get confused with a table column delimiter, you might try \textbar: it's for use in text (outside math environments), so it will not grow or shrink in order to accommodate the math environment as \vert does; but it's fine for textual material like the one you show and you can typeset it in whatever font you want, so \texttt{\textbar} will do what you want:

#+attr_latex: :align |lclr| :placement [H]
|----------------------------------------+----------------------------------+----------------------------------+-------------|
| key                                    | sym                              | trans                            | description |
|----------------------------------------+----------------------------------+----------------------------------+-------------|
| ~().~                                  | $\left( \right)$                 | ~\left( \right)~                 |             |
| ~()..~                                 | $\left( \middle\vert  \right)$   | ~\left( \middle\vert  \right)~   |             |
| ~[].~                                  | $\left[ \right]$                 | ~\left[ \right]~                 |             |
| ~[]..~                                 | $\left[ \middle\vert  \right]$   | ~\left[ \middle\vert  \right]~   |             |
| ~{}.~                                  | $\left\{ \right\}$               | ~\left\{ \right\}~               |             |
| ~{}..~                                 | $\left\{ \middle\vert  \right\}$ | ~\left\{ \middle\vert  \right\}~ |             |
| ~\vert\vert.~                          |                                  |                                  |             |
| \texttt{\textbar}\texttt{\textbar} ~.~ | $\left\vert \right\vert$         | ~\left\vert \right\vert~         |             |
|----------------------------------------+----------------------------------+----------------------------------+-------------|


although the second and the third columns of the last row are now at least confusing and maybe inaccurate, but I'm not sure what you are trying to do with the table.

[Org mode material included in order to maintain a semblance of relevance to this site, but as @dalanicolai states in the comment, it's a LaTeX question mostly.]

2
  • 1
    Thanks, and sorry for posting LaTeX question here. Puttting \texttt{|} inside cell makes it divide into 2 cells. I didn't knew about \texttt{\textbar} exists. (On hindsight it was totally related to LaTeX)
    – Garid
    Apr 11, 2023 at 4:06
  • About the usage of the table, I'm writing (playing around) auto-expanding latex snippets written in Quail Input-method. here
    – Garid
    Apr 11, 2023 at 4:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.