Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I am nesting an \xygraph in an \xymatrix like so:

%\documentclass{article}
\documentclass{beamer}
\usepackage[utf8]{inputenc}
\usepackage[ngerman]{babel}
\usepackage{MnSymbol}
\usepackage{chemarr}
\usepackage{multirow}
\usepackage{verbatim}

\input xy
\xyoption{all}

\setlength{\parindent}{0pt}
\newtheorem{mydef}{Definition}
\def\pi{a}
\def\emptyline{\vspace{\baselineskip}}


\begin{document}
\shorthandoff{"}

\begin{frame}

\textbf{Reduktion von CI auf C}\\
\begin{tabular}{c}
\begin{xy}
\xymatrix
{
\ar[r] & _{c_k}\bullet \ar@{-->}[r] \ar@{.>}[r] & \cdots \ar@{-->}[r] & \bullet \ar@{-->}[r] & _{s_k}
\begin{xy}
$
\xygraph{
!{<0cm,0cm>;<1cm,0cm>:<0cm,0.5cm>::}
!{(0,0) }*+{\bullet}="a"
!{(3,0) }*+{(M_k,s_k)}
!{(4,1) }*+{}="b"
!{(4,-1) }*+{}="c"
"a"-"b" "a"-"c" "b"-"c"
}$
\end{xy} \\
}
\end{xy}

\end{tabular}
\end{frame}

\end{document}

Additionally I use a global shorthandoff{"} to circumvent an error caused by using the ngerman babel package. This displays fine in a \documentclass{article}, but everything goes haywire in a \documentclass{beamer}. I get errors about missing }'s and missing \end{xy}'s

What do I have to do to make this nesting work in the beamer class as well?

share|improve this question
    
Welcome to TeX.SX! It is always better to provide a minimal working example (mwe) such that it is possible to compile immediately your code and tell you which could be your problem. –  Claudio Fiandrino Jun 7 '12 at 11:50
    
I get an error only if the \shorthandoff{"} declaration is inside the frame. Use \begin{frame}[fragile] or make that declaration before \begin{frame}. Please, turn your code into a complete example that can be run through LaTeX. –  egreg Jun 7 '12 at 11:53
    
I did use \shorthandoff{"} outside of a frame environment and have already tried to use [fragile] with no luck. I now updated the code in the original post to be a fully working example - it works now in this single-frame document, but in my main presentation the same errors appear. If I remove this frame from my main presentation, the entire thing compiles without error though. –  MartinB Jun 7 '12 at 12:43
    
As it stands, I don't see how we can answer this. What has to happen to alter the example to give an error: as you say this compiles fine. –  Joseph Wright Aug 11 '12 at 14:22
add comment

closed as too localized by percusse, lockstep, Paul Gaborit, diabonas, egreg Sep 28 '12 at 15:06

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Browse other questions tagged or ask your own question.