2

The following document renders fine with XeLaTeX...

\documentclass[12pt]{standalone}

%\usepackage{dejavu-otf}

\usepackage[all]{xy}

\newcommand*{\point}[1]{*+[F.]{\makebox[2.8em]{$#1\mathstrut$}}}
\newcommand*{\dotsitem}{*+[F.]{\makebox[2em]{\ldots\mathstrut}}}

\begin{document}
\xy
\xymatrix @C=0pt @R=0pt{
  *++{\textbf{mz\mathstrut}} &
  \point{0} & \point{1} & \dotsitem & \point{n - 1} &
  \point{n} & \point{n + 1} &  \dotsitem & \point{2n - 1} &
  \dotsitem & \dotsitem & \point{l - 2} & \point{l - 1}\\
  *++{\textbf{scan\mathstrut}} &
  \point{0} & \point{1} & \dotsitem & \point{n - 1} &
  \point{n} & \point{n + 1} &  \dotsitem & \point{2n - 1} &
  \dotsitem & \dotsitem & \point{l - 2} & \point{l - 1}\\
  *++{\textbf{intens\mathstrut}} &
  \point{0} & \point{1} & \dotsitem & \point{n - 1} &
  \point{n} & \point{n + 1} &  \dotsitem & \point{2n - 1} &
  \dotsitem & \dotsitem & \point{l - 2} & \point{l - 1}}
\save "1,2"."3,5"="chunk1" \restore
\save "1,6"."3,9"="chunk2" \restore
\save "1,11"."3,13"="chunkN" \restore
\POS"chunk1"!CD!<0pt,-2\jot>*\frm{_\}} *++!U\txt<6em>{Chunk $1$}
\POS"chunk2"!CD!<0pt,-2\jot>*\frm{_\}} *++!U\txt<6em>{Chunk $2$}
\POS"chunkN"!CD!<0pt,-2\jot>*\frm{_\}} *++!U\txt<6em>{Chunk $N$}
\save "chunk1"*\frm{-} \restore
\save "chunk2"*\frm{-} \restore
\save "chunkN"*\frm{-} \restore
\endxy
\end{document}

Correct

... unless I uncomment the

\usepackage{dejavu-otf}

line (I do want DejaVu fonts):

Incorrect

Is it a problem with xy or dejavu-otf, and can it be somehow worked around?

1
  • I added the fix also for the vertical braces (when \frm{\{}} or \frm{\}} are used).
    – egreg
    Mar 29, 2018 at 15:26

1 Answer 1

4

This happens as soon as you load unicode-math, which dejavu-otf does internally.

You have to restore some legacy symbols, namely those for the underbraces and overbraces, otherwise the commands point to the wrong symbol in the Unicode math font.

\documentclass[12pt]{standalone}

\usepackage{dejavu-otf}

\usepackage[all]{xy}

% restore the legacy brace pieces using cmex
\DeclareSymbolFont{oldlargesymbols}{OMX}{cmex}{m}{n}
% for horizontal braces
\DeclareMathSymbol{\braceld}{\mathord}{oldlargesymbols}{"7A}
\DeclareMathSymbol{\bracerd}{\mathord}{oldlargesymbols}{"7B}
\DeclareMathSymbol{\bracelu}{\mathord}{oldlargesymbols}{"7C}
\DeclareMathSymbol{\braceru}{\mathord}{oldlargesymbols}{"7D}
% for vertical braces
\DeclareMathSymbol{\braceur}{\mathord}{oldlargesymbols}{"38}
\DeclareMathSymbol{\braceul}{\mathord}{oldlargesymbols}{"39}
\DeclareMathSymbol{\bracedr}{\mathord}{oldlargesymbols}{"3A}
\DeclareMathSymbol{\bracedl}{\mathord}{oldlargesymbols}{"3B}
\DeclareMathSymbol{\bracecl}{\mathord}{oldlargesymbols}{"3C}
\DeclareMathSymbol{\bracecr}{\mathord}{oldlargesymbols}{"3D}
\DeclareMathSymbol{\bracec}{\mathord}{oldlargesymbols}{"3E}
%%% end of fix

\newcommand*{\point}[1]{*+[F.]{\makebox[2.8em]{$#1\mathstrut$}}}
\newcommand*{\dotsitem}{*+[F.]{\makebox[2em]{\ldots\mathstrut}}}    

\begin{document}

\begin{xy}
\xymatrix @C=0pt @R=0pt{
  *++{\textbf{mz\mathstrut}} &
  \point{0} & \point{1} & \dotsitem & \point{n - 1} &
  \point{n} & \point{n + 1} &  \dotsitem & \point{2n - 1} &
  \dotsitem & \dotsitem & \point{l - 2} & \point{l - 1}\\
  *++{\textbf{scan\mathstrut}} &
  \point{0} & \point{1} & \dotsitem & \point{n - 1} &
  \point{n} & \point{n + 1} &  \dotsitem & \point{2n - 1} &
  \dotsitem & \dotsitem & \point{l - 2} & \point{l - 1}\\
  *++{\textbf{intens\mathstrut}} &
  \point{0} & \point{1} & \dotsitem & \point{n - 1} &
  \point{n} & \point{n + 1} &  \dotsitem & \point{2n - 1} &
  \dotsitem & \dotsitem & \point{l - 2} & \point{l - 1}}
\save "1,2"."3,5"="chunk1" \restore
\save "1,6"."3,9"="chunk2" \restore
\save "1,11"."3,13"="chunkN" \restore
\POS"chunk1"!CD!<0pt,-2\jot>*\frm{_\}} *++!U\txt<6em>{Chunk $1$}
\POS"chunk2"!CD!<0pt,-2\jot>*\frm{_\}} *++!U\txt<6em>{Chunk $2$}
\POS"chunkN"!CD!<0pt,-2\jot>*\frm{_\}} *++!U\txt<6em>{Chunk $N$}
\save "chunk1"*\frm{-} \restore
\save "chunk2"*\frm{-} \restore
\save "chunkN"*\frm{-} \restore
\end{xy}

\end{document}

enter image description here

What's the problem? Xy-pic needs the \braceld command and the companions one for drawing the braces and it uses glyphs in the standard OMX encoded font for math extensions. Unfortunately, when unicode-math is loaded, the font used for the math extensions is the same as the main math font and this has different glyphs at the slots shown above. For instance, "7A is z, which is why you see a “z” in your picture. Those pieces the braces are made do not exist in Unicode, but we can easily use the ones in the standard math extension font, with the definitions above.

This might be a feature request for Xy-pic.

1
  • ok deleting my comments
    – user4686
    Mar 29, 2018 at 21:02

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .