创建动态隐形字符、动态间距

创建动态隐形字符、动态间距

我使用来自主题的数组:全局变量数组

现在我想为数组中的项目设置动态间距/空白。

计算项目的空格字符并将这些空格插入到 pdf 中

示例:数组中的 3. 行(蓝色),长度= 10 个空格/10 个不可见字符,高度为 0.3 厘米。

或者我如何在 \def\ArrayNames 中添加例如:\hphantom \hspace

最少编码:

\documentclass[a4paper,twoside,12pt]{article}
\usepackage{pgffor}
\usepackage{xcolor}
\begin{document}
\def\ArrayNames{{"koala", %1
"........", %2
"         ", %3 blue % need insert 10 invisible character / dynamic space - invisible text 
"penguin", %4
"bear" %5
}}
\def\ArrayColors{{"gray","yellow","blue","red","brown"}}
\begin{enumerate}
\foreach \X in {0,...,4}
{
\pgfmathsetmacro{\myname}{\ArrayNames[\X]}
\pgfmathsetmacro{\mycolor}{\ArrayColors[\X]} 
\item \textcolor{\mycolor}{\myname} ABCDE
} 
\end{enumerate}
\end{document}

在此处输入图片描述

相关内容