| 1 |
\documentclass{article} |
| 2 |
|
| 3 |
\usepackage[margin=3cm]{geometry} |
| 4 |
|
| 5 |
\usepackage{tikz-bagua} |
| 6 |
\usetikzlibrary{math} |
| 7 |
|
| 8 |
\input{binhex} |
| 9 |
|
| 10 |
\usepackage{makeidx} |
| 11 |
|
| 12 |
\makeindex |
| 13 |
|
| 14 |
\title{TikZ-Bagua Package} |
| 15 |
\author{WANG Xu \\ [email protected]} |
| 16 |
\date{\today~v1.01} |
| 17 |
|
| 18 |
\begin{document} |
| 19 |
|
| 20 |
\maketitle |
| 21 |
|
| 22 |
\section{Introduction} |
| 23 |
|
| 24 |
The \verb+TikZ-Bagua+ package mainly using \verb+TikZ+, by \verb+xparse+, \verb+xstring+, \verb+bitset+ and \verb+xintexpr+, defines the Grand Terminus \cite{Legge} \verb+\taiji+ and \verb+\xtaiji+ for newer method, \verb+\liangyi+ for the Two Elementary Forms, \verb+\sixiang+ for the Four Emblematic Symbols, \verb+\bagua+ for the Eight Trigrams and \verb+\Bagua+ for Sixty-four Hexagrams, in \emph{The I Ching}, without require special fonts. |
| 25 |
|
| 26 |
\section{Usage methods} |
| 27 |
|
| 28 |
The last argument of all defined macros is optional \verb|scale|, and default $1$. |
| 29 |
|
| 30 |
\subsection{The Grand Terminus (the \emph{Taiji})} |
| 31 |
|
| 32 |
Thanks to netizens, the default is same as in ancient books without \emph{the Fish Eyes}, show its by macro with star. |
| 33 |
For reason that there are some formed by semi-circles, so add \verb+\xtaiji+ for it, with (or without) star. |
| 34 |
|
| 35 |
\verb+\taiji [<scale>]+\index{taiji@\verb+\taiji+}, \verb+\taiji* [<scale>]+\index{xtaiji@\verb+\xtaiji+}. |
| 36 |
|
| 37 |
\verb+\xtaiji [<scale>]+\index{taiji@\verb+\taiji+}, \verb+\xtaiji* [<scale>]+\index{xtaiji@\verb+\xtaiji+}. |
| 38 |
|
| 39 |
The four above macros show \taiji \taiji* \xtaiji \xtaiji*. |
| 40 |
|
| 41 |
\subsection{The Two Elementary Forms (the \emph{Liangyi})} |
| 42 |
\verb+\liangyi {<bin>} [<scale>]+\index{liangyi@\verb+\liangyi+}. |
| 43 |
|
| 44 |
We can obtain \liangyi{1} and \liangyi{0} by \verb+\liangyi{<bin>}+ getting $1$ and $0$, respectively. |
| 45 |
|
| 46 |
|
| 47 |
\subsection{The Four Emblematic Symbols (the \emph{Sixiang})} |
| 48 |
\verb+\sixiang {<bin>} [<scale>]+\index{sixiang@\verb+\sixiang+}, \verb+\sixiang* {<dec>} [<scale>]+\index{sixiang*@\verb+\sixiang*+}. |
| 49 |
|
| 50 |
The Four Emblematic Symbols obtained from \verb+\sixiang{<bin>}+ by getting the binary number of $3,2,1,0$, and \verb+\sixiang*{<dec>}+ for decimal. |
| 51 |
|
| 52 |
\begin{center} |
| 53 |
\begin{tikzpicture} |
| 54 |
\foreach \j in {3,2,1,0} |
| 55 |
{ |
| 56 |
\node at (3-\j,-0.5) {$\j$}; |
| 57 |
\node at (3-\j,0.5) {\nbinary{2}{\j}}; |
| 58 |
\node at (3-\j,0) {\sixiang*{\j}}; |
| 59 |
} |
| 60 |
\end{tikzpicture} |
| 61 |
\end{center} |
| 62 |
|
| 63 |
\subsection{The Eight Trigrams (the \emph{Bagua} with three lines)} |
| 64 |
\verb+\bagua {<bin>} [<scale>]+\index{bagua@\verb+\bagua+}, \verb+\bagua* {<dec>} [<scale>]+\index{bagua*@\verb+\bagua*+}. |
| 65 |
|
| 66 |
The Eight Trigrams obtained from \verb+\bagua{<bin>}+ by getting the binary number of $7,6,\dots,0$, and \verb+\bagua*{<dec>}+ for decimal. |
| 67 |
|
| 68 |
\begin{center} |
| 69 |
\begin{tikzpicture} |
| 70 |
\foreach \j in {7,6,...,0} |
| 71 |
{ |
| 72 |
\node at (7-\j,-0.5) {$\j$}; |
| 73 |
\node at (7-\j,0.5) {\nbinary{3}{\j}}; |
| 74 |
\node at (7-\j,0) {\bagua*{\j}}; |
| 75 |
} |
| 76 |
\end{tikzpicture} |
| 77 |
\end{center} |
| 78 |
|
| 79 |
\subsection{The Sixty-four Hexagrams (the \emph{Bagua} with six lines)} |
| 80 |
\verb+\Bagua [<2,8>]{<bin,oct>} [<scale>]+\index{Bagua@\verb+\Bagua+}, \verb+\Bagua* {<dec>} [<scale>]+\index{Bagua*@\verb+\Bagua*+}. |
| 81 |
|
| 82 |
The Sixty-four Hexagrams obtained from \verb+\Bagua{<bin>}+ by getting the binary number of $63,62,\dots,0$, \verb+\Bagua[8]{<oct>}+ for octal number $77,76,\dots,0$, and \verb+\bagua*{<dec>}+ for decimal. |
| 83 |
|
| 84 |
We list all the Sixty-four Hexagrams here, in which the above number is binary, the below is decimal and octal. |
| 85 |
|
| 86 |
\begin{center} |
| 87 |
\begin{tikzpicture} |
| 88 |
\foreach \j in {7,6,...,0} |
| 89 |
{ |
| 90 |
\foreach \k in {7,6,...,0} |
| 91 |
{ |
| 92 |
\node at (7*1.25-1.25*\k-0.3,1.5*\j-0.5) {\pgfmathparse{int(8*\j+\k)}\pgfmathresult}; |
| 93 |
\node at (7*1.25-1.25*\k+0.3,1.5*\j-0.5) {\j\k}; |
| 94 |
\node at (7*1.25-1.25*\k,1.5*\j+0.5) {\nbinary{3}{\j}\nbinary{3}{\k}}; |
| 95 |
\node at (7*1.25-1.25*\k,1.5*\j) {\Bagua[8]{\j\k}[1.5]}; |
| 96 |
} |
| 97 |
% \node at (7-\j,0) {$\j$}; |
| 98 |
% \node at (7-\j,-0.5) {\nbinary{3}{\j}}; |
| 99 |
% \node at (7-\j,-1) {\bagua*{\j}}; |
| 100 |
} |
| 101 |
\end{tikzpicture} |
| 102 |
\end{center} |
| 103 |
|
| 104 |
\section{Versions} |
| 105 |
\subsection*{v1.01~2022.08.04} |
| 106 |
Revise \verb+\taiji+ to show the Grand Terminus in ancient books, add \verb+\xtaiji+ for later, fix some bugs. |
| 107 |
|
| 108 |
\subsection*{v1.0~2021.10.17} |
| 109 |
Release \verb+TikZ-Bugua+ v1.0. |
| 110 |
|
| 111 |
\begin{thebibliography}{9} |
| 112 |
\bibitem {Legge} James Legge (Trans.). The I Ching, Second Edition. Dover Publications, Inc. |
| 113 |
\end{thebibliography} |
| 114 |
|
| 115 |
\printindex |
| 116 |
|
| 117 |
\end{document} |