MHB Tweaking a Multiplication Table

AI Thread Summary
The discussion focuses on improving a multiplication table created in LaTeX, specifically addressing issues with bold lines and formatting. Suggestions include using MathJAX and TikZ for better visual representation. A proposed solution involves creating a matrix of math nodes to eliminate the need for dollar signs around math symbols. The conversation emphasizes the importance of distinguishing certain lines in the table for clarity. Overall, the thread provides practical advice for enhancing the visual appeal of mathematical tables in LaTeX.
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
3
Views
3K
Replies
18
Views
4K
Replies
3
Views
2K
Replies
2
Views
3K
Replies
2
Views
10K
Replies
3
Views
2K
Replies
32
Views
6K
Back
Top