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?
1 Answer
You can do this with a simple array
:
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}
-
May I suggest the horizontal spacing would look better with
\clap{\Huge$0$}
?– BernardJul 27, 2015 at 18:39 -
@Bernard Yes, thanks. I used some
0pt
wide\makebox
s which are basically\clap
's. Jul 27, 2015 at 18:45 -
But
\clap
is shorter to type, and forces loadingmathtools
if not already done, which isn't a bad thing, from my point of view.– BernardJul 27, 2015 at 18:49 -
@Bernard I's rather stick to
amsmath
. I don't remember having to usemathtools
ever (except for answer here), although I know it offers a lot of features. Jul 27, 2015 at 18:57 -
\DeclarePairedDelimiters
or the differentmathlap
s commands are quite useful for fine-tuning math formulae, but that's a matter of personal habits.– BernardJul 27, 2015 at 19:01
\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.