emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* including the | character in a table
@ 2018-07-25  9:22 Alan Schmitt
  2018-07-25 10:21 ` Michel Schinz
  0 siblings, 1 reply; 5+ messages in thread
From: Alan Schmitt @ 2018-07-25  9:22 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 430 bytes --]

Hello,

I'm writing a cheat sheet for a programming language, and I'm having
trouble with operators that use |. For instance:

| match expr with   | pattern matching |
| | pattern -> expr | action           |

How can I escape the |? I tried putting a \ before but it does not work.

Thanks,

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2018-06: 410.79, 2017-06: 408.84

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 528 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: including the | character in a table
  2018-07-25  9:22 including the | character in a table Alan Schmitt
@ 2018-07-25 10:21 ` Michel Schinz
  2018-07-25 11:43   ` Kevin Foley
  0 siblings, 1 reply; 5+ messages in thread
From: Michel Schinz @ 2018-07-25 10:21 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

On Wed, Jul 25, 2018, at 11:22, Alan Schmitt wrote:
> I'm writing a cheat sheet for a programming language, and I'm having
> trouble with operators that use |. For instance:
> 
> | match expr with   | pattern matching |
> | | pattern -> expr | action           |
> 
> How can I escape the |? I tried putting a \ before but it does not work.

I've used macros in the past for such a case. Quite heavyweight, but I didn't find anything better. Here is an example (which you could augment if you wanted to export to LaTeX too):

#+MACRO: I @@html:|@@

| match expr with        | pattern matching |
| {{{I}}}pattern -> expr | action           |

Michel.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: including the | character in a table
  2018-07-25 10:21 ` Michel Schinz
@ 2018-07-25 11:43   ` Kevin Foley
  2018-07-25 12:16     ` Alan Schmitt
  0 siblings, 1 reply; 5+ messages in thread
From: Kevin Foley @ 2018-07-25 11:43 UTC (permalink / raw)
  To: Michel Schinz; +Cc: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 835 bytes --]

You can use \vert to insert pipes in exported tables.


Kevin


On Wed, Jul 25, 2018, 6:21 AM Michel Schinz <michel@schi.nz> wrote:

> Hello,
>
> On Wed, Jul 25, 2018, at 11:22, Alan Schmitt wrote:
> > I'm writing a cheat sheet for a programming language, and I'm having
> > trouble with operators that use |. For instance:
> >
> > | match expr with   | pattern matching |
> > | | pattern -> expr | action           |
> >
> > How can I escape the |? I tried putting a \ before but it does not work.
>
> I've used macros in the past for such a case. Quite heavyweight, but I
> didn't find anything better. Here is an example (which you could augment if
> you wanted to export to LaTeX too):
>
> #+MACRO: I @@html:&#124;@@
>
> | match expr with        | pattern matching |
> | {{{I}}}pattern -> expr | action           |
>
> Michel.
>
>

[-- Attachment #2: Type: text/html, Size: 1284 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: including the | character in a table
  2018-07-25 11:43   ` Kevin Foley
@ 2018-07-25 12:16     ` Alan Schmitt
  2018-07-25 12:19       ` Kevin Foley
  0 siblings, 1 reply; 5+ messages in thread
From: Alan Schmitt @ 2018-07-25 12:16 UTC (permalink / raw)
  To: Kevin Foley; +Cc: emacs-orgmode, Michel Schinz

[-- Attachment #1: Type: text/plain, Size: 384 bytes --]

On 2018-07-25 07:43, Kevin Foley <kfoley15@gmail.com> writes:

> You can use \vert to insert pipes in exported tables.

Thank you Michel and Kevin for these proposals. \vert works great (as
long as it's outside ~~, but I can deal with it).

Thanks!

Alan

-- 
OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂, Mauna Loa Obs. 2018-06: 410.79, 2017-06: 408.84

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 528 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: including the | character in a table
  2018-07-25 12:16     ` Alan Schmitt
@ 2018-07-25 12:19       ` Kevin Foley
  0 siblings, 0 replies; 5+ messages in thread
From: Kevin Foley @ 2018-07-25 12:19 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: emacs-orgmode, Michel Schinz

[-- Attachment #1: Type: text/plain, Size: 108 bytes --]

No problem, I actually just ran into the need to do this yesterday so your
question was very timely.

Kevin

[-- Attachment #2: Type: text/html, Size: 176 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2018-07-25 12:20 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-25  9:22 including the | character in a table Alan Schmitt
2018-07-25 10:21 ` Michel Schinz
2018-07-25 11:43   ` Kevin Foley
2018-07-25 12:16     ` Alan Schmitt
2018-07-25 12:19       ` Kevin Foley

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).