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.

How could I draw lines (like those in a tabular environment drawn by \hline and |c|c|c| in the following code?

\resizebox{\textwidth}{!}{
    \xymatrix{
        x_0 \ar[dr]    & x_1 \ar[d] \ar[dr] & x_2 \ar[d]   \\
        % 
        \sum(x_0..x_0) & \sum(x_0..x_1)     & \sum(x_1..x_2)\\
    }
}

For some reason, I can't compile the document if I use *F{argument} in order to draw a box around each element.

To make more clear who ideally the output would be:

\begin{tabular}{| c| c| c|}
    \hline
    x_0& x_1& x_2\\ \hline
\end{tabular}

followed by the arrows.

share|improve this question

1 Answer 1

up vote 3 down vote accepted

Please provide a minimal example. You have to use the syntax: *+[F]{<argument>}

\documentclass{article}
\usepackage{graphicx}
\usepackage{xypic,xypdf}
\begin{document}
\noindent\resizebox{\textwidth}{!}{
    \xymatrix{
        *+[F]{x_0} \ar[dr]    & x_1 \ar[d] \ar[dr] & x_2 \ar[d]   \\
        % 
        \sum(x_0..x_0) & \sum(x_0..x_1)     & \sum(x_1..x_2)\\
    }
}
\end{document}

You can set the frame global:

\documentclass{article}
\usepackage{graphicx}
\usepackage{xypic,xypdf}
\begin{document}
\noindent\resizebox{\textwidth}{!}{
\entrymodifiers={++[F]}
    \xymatrix{
        x_0 \ar[dr]    & x_1 \ar[d] \ar[dr] & x_2 \ar[d]   \\
        % 
        \sum(x_0..x_0) & \sum(x_0..x_1)     & \sum(x_1..x_2)\\
    }
}
\end{document}

enter image description here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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