# Sharing: Drawing a 3D Order-3 Magic Cube with LaTeX+MathJax

Source: <https://kexue.fm/archives/6534>

Machine translated. Refer to the original post to verify accuracy.

---
author: Su Jianlin
date: March 28, 2019
lang: en
markdown_url: 06534-Sharing-Drawing-a-3D-Order-3-Magic-Cube-with-LaTeX-MathJax.md
next_url: 06508-Scientific-Space-Browsing-Guide-FAQ.html
post_id: 6534
prev_url: 06540-Sharing-an-Unsupervised-Mining-of-Domain-Specific-Vocabulary.html
site_title: English (unofficial) translations of posts at kexue.fm
source_url: "https://kexue.fm/archives/6534"
title: "Sharing: Drawing a 3D Order-3 Magic Cube with LaTeX+MathJax"
---

Yesterday, I saw a discussion on the Mathematical Research Forum regarding [3D order-3 magic cubes](https://bbs.emath.ac.cn/thread-16090-1-1.html). The experts on the forum had already discussed it quite thoroughly, so I didn’t have much to add. Then, a sudden idea struck me: could I draw such a 3D magic cube using pure LaTeX?

Yesterday afternoon, I tinkered with it for a while and only produced a semi-finished product. After further refinement by the forum expert *mathe*, it was finally successfully drawn:

``` math
\begin{array}{ccccccccccccccc}
& & & & 4 & - & - & - & - & 25 & - & - & - & - & 11 \\
\\
& & & \rotatebox[origin=c]{45}{$|$} & {\color{red!50}\vdots} & & & & \rotatebox[origin=c]{45}{$|$} & {\color{red!50}\vdots} & & & & \rotatebox[origin=c]{45}{$|$} & | \\
\\
& & 14 & - & - & - & - & 22 & - & - & - & - & 7 & & | \\
\\
& \rotatebox[origin=c]{45}{$|$} & {\color{red!50}\vdots} & & {\color{red!50}\vdots} & & \rotatebox[origin=c]{45}{$|$} & {\color{red!50}\vdots} & & {\color{red!50}\vdots} & & \rotatebox[origin=c]{45}{$|$} & | & & | \\
24 & - & - & - & - & 1 & - & - & - & - & 18 & & | & & | \\
| & & {\color{red!50}\vdots} & & \color{red}{13} & | & {\color{red!50}\cdots} & {\color{red!50}\vdots} & {\color{red!50}\cdots} & \color{red}{27} & | & {\color{red!50}\cdots} & | & {\color{red!50}\cdots} & 5 \\
| & & {\color{red!50}\vdots} & \rotatebox[origin=c]{45}{\color{red!50}$\vdots$} & {\color{red!50}\vdots} & | & & {\color{red!50}\vdots} & \rotatebox[origin=c]{45}{\color{red!50}$\vdots$} & {\color{red!50}\vdots} & | & & | & \rotatebox[origin=c]{45}{$|$} & | \\
| & & \color{red}{8} & {\color{red!50}\cdots} & {\color{red!50}\cdots} & | & {\color{red!50}\cdots} & \color{red}{12} & {\color{red!50}\cdots} & {\color{red!50}\cdots} & | & {\color{red!50}\cdots} & 22 & & | \\
| & \rotatebox[origin=c]{45}{\color{red!50}$\vdots$} & {\color{red!50}\vdots} & & {\color{red!50}\vdots} & | & \rotatebox[origin=c]{45}{\color{red!50}$\vdots$} & {\color{red!50}\vdots} & & {\color{red!50}\vdots} & | & \rotatebox[origin=c]{45}{$|$} & | & & | \\
15 & - & - & - & - & 3 & - & - & - & - & 21 & & | & & | \\
| & & {\color{red!50}\vdots} & & \color{red}{9} & | & {\color{red!50}\cdots} & {\color{red!50}\vdots} & {\color{red!50}\cdots} & \color{red}{26} & | & {\color{red!50}\cdots} & | & {\color{red!50}\cdots} & 6 \\
| & & {\color{red!50}\vdots} & \rotatebox[origin=c]{45}{\color{red!50}$\vdots$} & & | & & {\color{red!50}\vdots} & \rotatebox[origin=c]{45}{\color{red!50}$\vdots$} & & | & & | & \rotatebox[origin=c]{45}{$|$} \\
| & & \color{red}{16} & {\color{red!50}\cdots} & {\color{red!50}\cdots} & | & {\color{red!50}\cdots} & \color{red}{8} & {\color{red!50}\cdots} & {\color{red!50}\cdots} & | & {\color{red!50}\cdots} & 17 \\
| & \rotatebox[origin=c]{45}{\color{red!50}$\vdots$} & & & & | & \rotatebox[origin=c]{45}{\color{red!50}$\vdots$} & & & & | & \rotatebox[origin=c]{45}{$|$} \\
23 & - & - & - & - & 2 & - & - & - & - & 19 \\
\end{array}
```

In fact, the code contains some embedded HTML code (in the original MathJax version), so it is not strictly pure LaTeX code; rather, it is a combination of LaTeX and MathJax.

***Original address:*** [https://kexue.fm/archives/6534](./06534-Sharing-Drawing-a-3D-Order-3-Magic-Cube-with-LaTeX-MathJax.html)

***For more details on reposting, please refer to:*** [Scientific Space FAQ](./06508-Scientific-Space-Browsing-Guide-FAQ.html)
