如何指定空字符串?

时间:2014-12-25 14:40:14

标签: latex

对于脚本,我需要在默认情况下将命令/变量(此处不确定正确的术语)设置为空字符串。我假设\def\theemptystring{}就足够了,但\theemptystring不算空。

% Generate description list of numbered lists of procedural mechanics by category from CSV
    % Parameters: [label] file
\newcommand{\csvpmech}[2][]{%
    \begin{description}\ifstrempty{#1}{}{\label{#1}}%
        \def \prevcat {}%
        \csvreader{#2}{}{%
            \ifstrempty{\prevcat}{%
                % first item
                \item[\csvcoli]\begin{enumerate}\item\ifthenelse{\equal{#1}{}\or\equal{\csvcolii}{}}{}{\label{#1_\csvcolii}}\pmech[\csvcoliii][\csvcoliv]{\csvcolv}{\csvcolvi}%
                \def \prevcat \csvcoli%
            }{%
                \ifthenelse{\equal{\csvcoli}{}\or\equal{\csvcoli}{\prevcat}}{%
                    % same category
                    \item\ifthenelse{\equal{#1}{}\or\equal{\csvcolii}{}}{}{\label{#1_\csvcolii}}\pmech[\csvcoliii][\csvcoliv]{\csvcolv}{\csvcolvi}%
                }{%
                    % new category
                    \end{enumerate}\item[\csvcoli]\begin{enumerate}\item\ifthenelse{\equal{#1}{}\or\equal{\csvcolii}{}}{}{\label{#1_\csvcolii}}\pmech[\csvcoliii][\csvcoliv]{\csvcolv}{\csvcolvi}%
                    \def \prevcat \csvcoli%
                }
            }%
        }%
        \ifstrempty{\prevcat}{}{\end{enumerate}}%
    \end{description}%
}

我们的想法是获取一个CSV文件并显示按类别组织的内容。 pmech格式化单个项目。输入可能如下所示:

Category,Identifier,Context,Input,Parameter,Effect
Meat Boy movement,Move,,Left stick horizontal,Analog position,Meat Boy moves left/right at a speed increasing with absolute difference between position and default
,Sprint,,RT + left stick left/right,Analog position,Meat Boy moves faster
Meat Boy jumping,Jump,Meat Boy on ground,A,Duration,Apply upwards velocity increasing with duration
,Wall jump,Meat boy on wall,A,Duration,Apply upwards and sideways velocity opposite side of wall increasing with duration

0 个答案:

没有答案