1

I'd like to reproduce the formatting of MIX words in Knuth's The Art of Computer Programming. There is good example of what is giving me problems on the 3rd image on this page:

https://stackoverflow.com/questions/20924244/how-do-the-operations-lda-sta-sub-add-mul-and-div-work-in-knuths-machine-la

Namely, in the table at the center of that image,

|-|80|3|5|4|,

the "80" goes across two cells. How can I create the partial vertical lines "underneath" the 80? Thanks.

1 Answer 1

2

Not nice, but it works:

\documentclass{standalone}

\usepackage{tikz}
\usetikzlibrary{calc}
\tikzset{every picture/.append style = remember picture}

\newcommand{\myanchor}[1]{\tikz \node[coordinate] (#1) {};}

\usepackage{array} % used for setting extrarowheight

\begin{document}

\setlength\extrarowheight{1.5pt} % change to whatever font depth is
\begin{tabular}{*{6}{|c}|}
\hline
$ - $ & \myanchor{11} & \myanchor{12} & 3 & 5 & 4 \\
\hline
$ + $ & \myanchor{21} & \myanchor{22} & 3 & 5 & 4 \\
\hline
$ + $ & 0 & 0 & 3 & 5 & 4 \\
\hline
$ - $ & 0 & 0 & \myanchor{31} & \myanchor{32} & 3 \\
\hline
$ + $ & 0 & 0 & 0 & 0 & 5 \\
\hline
$ - $ & 0 & 0 & 0 & 0 & 0 \\
\hline
$ + $ & 0 & 0 & 0 & 0 & ? \\
\hline
\end{tabular}
\setlength\extrarowheight{0pt} % reset

\begin{tikzpicture}[overlay]
\foreach \tmp in {1,2,3} {
  \node[
    shape     = rectangle,
    inner sep = 2pt,
    fill      = white,
    anchor    = base,
  ] at ($(\tmp1)!0.5!(\tmp2)$) {80};
}
\end{tikzpicture}

\end{document}

Result:

enter image description here

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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