Tweaking a Multiplication Table

  • Context: MHB 
  • Thread starter Thread starter topsquark
  • Start date Start date
  • Tags Tags
    Multiplication Table
Click For Summary
SUMMARY

The forum discussion focuses on enhancing the visual presentation of multiplication tables using LaTeX and TikZ. Users suggest methods to emphasize specific lines in the tables, particularly through the use of MathJAX and TikZ libraries. A key recommendation is to utilize a matrix of math nodes in TikZ to simplify the formatting process, eliminating the need for dollar signs around math symbols. This approach allows for a cleaner and more efficient representation of mathematical tables.

PREREQUISITES
  • Familiarity with LaTeX typesetting
  • Understanding of TikZ for creating graphics in LaTeX
  • Basic knowledge of MathJAX for rendering mathematical expressions
  • Experience with matrix notation in mathematics
NEXT STEPS
  • Explore advanced TikZ features for customizing table designs
  • Learn how to implement MathJAX for enhanced web-based mathematical rendering
  • Investigate LaTeX packages for improved table formatting
  • Practice creating complex matrices using TikZ
USEFUL FOR

Mathematicians, educators, and anyone involved in typesetting mathematical content who seeks to improve the visual clarity of multiplication tables and other mathematical structures.

topsquark
Science Advisor
Homework Helper
Insights Author
MHB
Messages
2,020
Reaction score
843
I recently posted a couple of multiplication tables and I feel it needs a tweak:

[math]\begin{array}{c||c|c|c|c|}
V & e & a & b & c \\
\hline \hline
e & e & a & b & c \\
a & a & e & c & b \\
b & b & c & e & a \\
c & c & b & a & e
\end{array}
[/math]

The LaTeX on the forum doesn't like the double lines || or = (as lines, not the equal sign!). Does anyone know how to make the lines bold faced or something? I feel the top line and first vertical line should be singled out in some way.

-Dan
 
Physics news on Phys.org
Hey Dan,

There are some suggestions in https://mathhelpboards.com/tikz-pictures-63/4-element-4-element-multiplication-table-21434.html.
In particular a MathJAX suggestion and a TikZ suggestion.

To summarize:
Opalg said:
One way is to keep only those two lines and remove all the others: $$\begin{array}{c|cccc} + & a&b&c&d \\ \hline a&a&b&c&d\\ b&b&a&d&c \\ c&c&d&a&b \\ d&d&c&b&a \end{array}.$$

I like Serena said:
My previous TikZ suggestion had the 'problem' that math symbols had to have \$ symbols around them.
Turns out there is a better way by using a [M]matrix of math nodes[/M] instead of a [M]matrix of nodes[/M].
Then all nodes are already in math mode.
Other than that the solution is the same.
\begin{tikzpicture}
\usetikzlibrary{matrix}

\matrix (m) [nodes={minimum width=3em,minimum height=3ex},matrix of math nodes]
{
\times & 0 & 1 & \theta & \theta + 1 \\
0 & 0 & 0 & 0 & 0\\
1 & 0 & 1 & \theta & \theta + 1\\
\theta & 0 & \theta & \theta + 1 & 1 \\
\theta + 1 & 0 & \theta + 1 & 1 & \theta \\
};

\draw[very thick] (m-1-1.north east) -- (m-5-1.south east);
\draw[very thick] (m-1-1.south west) -- (m-1-5.south east);
\foreach \x in {2,...,5}{
\draw (m-1-\x.north east) -- (m-5-\x.south east);
\draw (m-\x-1.south west) -- (m-\x-5.south east);
}
\end{tikzpicture}
[latexs]\begin{tikzpicture}
\usetikzlibrary{matrix}

\matrix (m) [nodes={minimum width=3em,minimum height=3ex},matrix of math nodes]
{
\times & 0 & 1 & \theta & \theta + 1 \\
0 & 0 & 0 & 0 & 0\\
1 & 0 & 1 & \theta & \theta + 1\\
\theta & 0 & \theta & \theta + 1 & 1 \\
\theta + 1 & 0 & \theta + 1 & 1 & \theta \\
};

\draw[very thick] (m-1-1.north east) -- (m-5-1.south east);
\draw[very thick] (m-1-1.south west) -- (m-1-5.south east);
\foreach \x in {2,...,5}{
\draw (m-1-\x.north east) -- (m-5-\x.south east);
\draw (m-\x-1.south west) -- (m-\x-5.south east);
}
\end{tikzpicture}[/latexs]
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 3 ·
Replies
3
Views
3K
  • · Replies 18 ·
Replies
18
Views
4K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 2 ·
Replies
2
Views
10K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
1K
  • · Replies 32 ·
2
Replies
32
Views
6K
  • · Replies 1 ·
Replies
1
Views
8K