<html><head><meta name="color-scheme" content="light dark"></head><body><pre style="word-wrap: break-word; white-space: pre-wrap;">\documentclass{article}

\usepackage[margin=3cm]{geometry}

\usepackage{tikz-bagua}
\usetikzlibrary{math}
\usepackage{ctex}%[fontset=kefonts]

\input{binhex}

\usepackage{makeidx}   %åˆ›å»ºç´¢å¼•

\makeindex  

\title{TikZ-Bagua å®åŒ…}
\author{WANG Xu \\ cwangx@hotmail.com}
\date{\zhtoday~v1.01}

\begin{document}

\maketitle

\section{ç®€ä»‹}

\verb+TikZ-Bagua+ å®åŒ…ä½¿ç”¨ \verb+TikZ+ å®åŒ…, å€ŸåŠ©äºŽ \verb+xparse+, \verb+xstring+, \verb+bitset+ ä»¥åŠ \verb+xintexpr+, å®šä¹‰äº† \verb+\taiji+, \verb+\liangyi+, \verb+\sixiang+, ä¸‰çˆ» \verb+\bagua+ å’Œå…­çˆ» \verb+\Bagua+,  ç”»å‡ºã€Šå‘¨æ˜“ã€‹ä¸­æ‰€ç”¨çš„çš„å¤ªæžé˜´é˜³, ä¸¤ä»ªå››è±¡å…«å¦å’Œå…­åå››å¦ç¬¦å·, å¯¹å­—ä½“æ²¡æœ‰è¦æ±‚.

\section{ä½¿ç”¨æ–¹æ³•}

æ‰€å®šä¹‰çš„ä¸Šè¿°äº”ä¸ªå‘½ä»¤ä¸­æœ€åŽä¸€ä¸ªå¯é€‰å‚æ•°å‡ä¸ºæ”¾ç¼©å‚æ•° \verb|scale|, ç¼ºçœå€¼å‡ä¸º $1$.

\subsection{å¤ªæžé˜´é˜³}

æ„Ÿè°¢çƒ­å¿ƒç½‘å‹çš„æŒ‡å‡º, é»˜è®¤æ˜¯å¤ç±ä¸­çš„å¤ªæžå›¾, ä¸”æ²¡æœ‰é±¼çœ¼, åŠ&nbsp;æ˜Ÿåˆ™æ˜¾ç¤ºé±¼çœ¼. é‰´äºŽçŽ°åœ¨å¸¸è§åˆ°çš„åŠåœ†æž„é€&nbsp;çš„ä¹Ÿä¸å°‘, æ•…æ–°å¢žå‘½ä»¤ä»¥æ˜¾ç¤ºä¹‹, æ˜¾ç¤ºé±¼çœ¼è§„åˆ™åŒä¸Š. 

\verb+\taiji [&lt;scale&gt;]+\index{taiji@\verb+\taiji+}, \verb+\taiji* [&lt;scale&gt;]+\index{xtaiji@\verb+\xtaiji+}.

\verb+\xtaiji [&lt;scale&gt;]+\index{taiji@\verb+\taiji+}, \verb+\xtaiji* [&lt;scale&gt;]+\index{xtaiji@\verb+\xtaiji+}.

å››ä¸ªå‘½ä»¤é»˜è®¤ç›´æŽ¥å¯¹åº”å¾—åˆ° ç¬¦å· \taiji \taiji* \xtaiji \xtaiji*.

\subsection{ä¸¤ä»ª}
\verb+\liangyi {&lt;bin&gt;} [&lt;scale&gt;]+\index{liangyi@\verb+\liangyi+}.

\verb+\liangyi{&lt;bin&gt;}+ é€šè¿‡æŽ¥å—å‚æ•° $1$ æˆ– $0$ å¾—åˆ°ä¸¤ä»ªç¬¦å· \liangyi{1} æˆ– \liangyi{0}.

\subsection{å››è±¡}
\verb+\sixiang {&lt;bin&gt;} [&lt;scale&gt;]+\index{sixiang@\verb+\sixiang+}, \verb+\sixiang* {&lt;dec&gt;} [&lt;scale&gt;]+\index{sixiang*@\verb+\sixiang*+}.

\verb+\sixiang{&lt;bin&gt;}+ é€šè¿‡æŽ¥å—å‚æ•° $3,2,1,0$ çš„äºŒè¿›åˆ¶æ•°å¾—åˆ°å››è±¡ç¬¦å·, è€Œ \verb+\sixiang*{&lt;dec&gt;}+ æŽ¥æ”¶åè¿›åˆ¶æ•°.

\begin{center}
	\begin{tikzpicture}
		\foreach \j in {3,2,1,0}
		{
			\node at (3-\j,-0.5) {$\j$};
			\node at (3-\j,0.5) {\nbinary{2}{\j}};
			\node at (3-\j,0) {\sixiang*{\j}};
		}
	\end{tikzpicture}
\end{center}

\subsection{ä¸‰çˆ»å…«å¦}
\verb+\bagua {&lt;bin&gt;} [&lt;scale&gt;]+\index{bagua@\verb+\bagua+}, \verb+\bagua* {&lt;dec&gt;} [&lt;scale&gt;]+\index{bagua*@\verb+\bagua*+}.

\verb+\bagua{&lt;bin&gt;}+ é€šè¿‡æŽ¥å—å‚æ•° $7,6,\dots,0$ çš„äºŒè¿›åˆ¶æ•°å¾—åˆ°ä¸‰çˆ»å…«å¦ç¬¦å·, è€Œ \verb+\bagua*{&lt;dec&gt;}+ æŽ¥æ”¶åè¿›åˆ¶æ•°.

\begin{center}
	\begin{tikzpicture}
		\foreach \j in {7,6,...,0}
		{
			\node at (7-\j,-0.5) {$\j$};
			\node at (7-\j,0.5) {\nbinary{3}{\j}};
			\node at (7-\j,0) {\bagua*{\j}};
		}
	\end{tikzpicture}
\end{center}

\subsection{å…­çˆ»å…«å¦}
\verb+\Bagua [&lt;2,8&gt;]{&lt;bin,oct&gt;} [&lt;scale&gt;]+\index{Bagua@\verb+\Bagua+}, \verb+\Bagua* {&lt;dec&gt;} [&lt;scale&gt;]+\index{Bagua*@\verb+\Bagua*+}.

\verb+\Bagua{&lt;bin&gt;}+ é€šè¿‡æŽ¥å—å‚æ•° $63,62,\dots,0$ çš„äºŒè¿›åˆ¶æ•°å¾—åˆ°å…­çˆ»å…«å¦ç¬¦å·, \verb+\Bagua[8]{&lt;oct&gt;}+ æŽ¥æ”¶çš„ä¸º$63,62,\dots,0$ çš„å…«è¿›åˆ¶æ•°, è€Œ \verb+\Bagua*{&lt;dec&gt;}+ æŽ¥æ”¶åè¿›åˆ¶æ•°.

åˆ—å‡ºæ‰€æœ‰çš„å…­åå››å¦, å…¶ä¸­æ¯å¦ä¸Šä¸€è¡Œå…­ä½æ•°ä¸ºå¯¹åº”çš„äºŒè¿›åˆ¶æ•°, ä¸‹ä¸€è¡Œå·¦å³ä¸¤è¾¹åˆ†åˆ«ä¸ºå¯¹åº”çš„åè¿›åˆ¶å’Œå…«è¿›åˆ¶æ•°.

\begin{center}
	\begin{tikzpicture}
		\foreach \j in {7,6,...,0}
		{
			\foreach \k in {7,6,...,0}
			{
				\node at (7*1.25-1.25*\k-0.3,1.5*\j-0.5) {\pgfmathparse{int(8*\j+\k)}\pgfmathresult};
				\node at (7*1.25-1.25*\k+0.3,1.5*\j-0.5) {\j\k};
				\node at (7*1.25-1.25*\k,1.5*\j+0.5) {\nbinary{3}{\j}\nbinary{3}{\k}};
				\node at (7*1.25-1.25*\k,1.5*\j) {\Bagua[8]{\j\k}[1.5]};
			}
%			\node at (7-\j,0) {$\j$};
%			\node at (7-\j,-0.5) {\nbinary{3}{\j}};
%			\node at (7-\j,-1) {\bagua*{\j}};
		}
	\end{tikzpicture}
\end{center}

\section{ç‰ˆæœ¬è®°å½•}
\subsection*{v1.01~2022.08.04}
ä¿®æ”¹é»˜è®¤ \verb+\taiji+ ä¸ºæ—&nbsp;é±¼çœ¼çš„å¤ç±ä¸Šçš„å¤ªæž, ä¸ºçŽ°åœ¨å¸¸è§çš„åŠåœ†æž„é€&nbsp;æ–°å¢ž \verb+\xtaiji+, ä¿®å¤äº†å·²å‘çŽ°çš„ bug.

\subsection*{v1.0~2021.10.17}
å‘å¸ƒ \verb+TikZ-Bugua+ å®åŒ….

\printindex

\end{document}</pre></body></html>