[XeTeX] escaping the pipe

R (Chandra) Chandrasekhar chyavana at gmail.com
Wed Mar 3 13:06:19 CET 2010


maxwell wrote:

> I want to output something like
>    a {b|c} d
> from XeLaTeX.  I've managed to get part way there by escaping the curly
> braces in the input, but I can't figure out how to escape the pipe
> character.  

Try
---
\documentclass{article}
\usepackage{xltxtra}
\defaultfontfeatures{Mapping=tex-text,Scale=MatchLowercase}
\setmainfont{DejaVu Sans}
\setmonofont{Inconsolata}

% Assuming textmode in XeLaTeX
% a{b|c}d with and without spaces

\begin{document}
a \{ b \textbar\ c \} d

\texttt{a \{ b \textbar\ c \} d}

a\{b\textbar c\}d

\texttt{a\{b\textbar c\}d}

% If in mathode, use instead

$\mbox{\textbar}$

\end{document}
---

and see if it fits the bill.

Chandra


More information about the XeTeX mailing list