3

How can the attached box diagram be drawn in latex? I have tried using the table environment, but it does not seem to work well. Is there a quicker and easier code for it? enter image description here

1
  • Welcome to TeX.SX! Your question leaves all the effort to our community, even typing the essentials of a TeX document such as \documentclass{}...\begin{document} etc. As it is, most of our users will be very reluctant to touch your question, and you are left to the mercy of our procrastination team who are very few in number and very picky about selecting questions. Consider adding a minimal working example (MWE) so that users can copy/paste it onto their systems to work on. If no hero takes the challenge we might have to close your question.
    – Adam Liter
    Jul 27, 2015 at 18:47

1 Answer 1

1

You can do this with a simple array:

enter image description here

The code:

\documentclass{article}
\usepackage{mathdots}
\usepackage{amsmath}

\begin{document}

\[
\renewcommand\arraystretch{1.6}
\begin{array}{c|ccccccc|}
\cline{2-8}
y_{q+1} & z_{0} & & \raisebox{-30pt}[0pt][0pt]{\makebox[0pt]{\Huge$0$}} & & & & 0 \\
y_{q} & z_{q} & & & & & z_{0} & \\
y_{q-1} & z_{q-1} & & & &  z_{0} & & \\
\vdots & \vdots & & & \iddots & & & \\
\vdots & \vdots & & z_{0} & & & & \\
y_{1} & z_{1} & z_ {0} & & & & \raisebox{20pt}[0pt][0pt]{\makebox[0pt]{\Huge$0$}} & \\
y_{0} & z_{q+1} & z_ {1} & z_{2} & \ldots & z_{q-1} & z_{q} & z_{0} \\
\cline{2-8}
\multicolumn{1}{c}{} 
  & x_{0} & x_ {1} & x_{2} & \ldots & x_{q-1} & x_{q} & \multicolumn{1}{c}{x_{q+1}}
\end{array}
\]

\end{document}
5
  • May I suggest the horizontal spacing would look better with \clap{\Huge$0$}?
    – Bernard
    Jul 27, 2015 at 18:39
  • @Bernard Yes, thanks. I used some 0pt wide \makeboxs which are basically \clap's. Jul 27, 2015 at 18:45
  • But \clap is shorter to type, and forces loading mathtoolsif not already done, which isn't a bad thing, from my point of view.
    – Bernard
    Jul 27, 2015 at 18:49
  • @Bernard I's rather stick to amsmath. I don't remember having to use mathtools ever (except for answer here), although I know it offers a lot of features. Jul 27, 2015 at 18:57
  • \DeclarePairedDelimiters or the different mathlaps commands are quite useful for fine-tuning math formulae, but that's a matter of personal habits.
    – Bernard
    Jul 27, 2015 at 19:01

You must log in to answer this question.

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