我们知道,有一个命令1000 sep={...}
。
是否有可能创建类似的命令10^11 sep={\\}
?
\documentclass{article}
\usepackage{tikz}
\begin{document}
\pgfmathprintnumber[fixed, 1000 sep={\,}]{1233123312331233123312}
\pgfmathprintnumber[fixed, 1000 sep={\,}]{123312331233123312331233123312331233123312331233123312331233123312331233123312331233123312331233123312331233123312331233}
\end{document}
答案1
不要在家尝试这个——你已经被警告了
\def\mysepfinish#1{#1\ifnum\count0>\count1
\let\next\mysepfinish
\advance\count0by-1\relax
\count2=\count0
\divide\count2by\count1
\multiply\count2by\count1\relax
\ifnum\count2=\count0\relax\mydelim\fi
\else\let\next\relax\fi\next}
\def\mysepcount#1{\ifx\end#1\let\next\relax
\else\advance\count0by1\let\next\mysepcount\fi
\next}
\def\mysep#1#2#3{{\def\mydelim{#2}\count0=0\relax
\count1=#1\relax
\mysepcount#3\end
\mysepfinish#3\relax}}
\mysep{11}{\\}{1234567890123456789012345678901234567890}