Bug Tracker
I’m currently working on a major new version of the datatool package. This may take a while. Please be patient. (Experimental version available for testing.)
ID | 126🔗 |
---|---|
Date: | 2019-01-31 07:46:08 |
Status | Open Sign in if you want to bump this report. |
Category | datatool |
Version | 2.29 |
Summary | Problems with \DTLsubstituteall |
Sign in to subscribe to notifications about this report.
Description
seems the command\DTLsubstituteall
of the package datatool does remove braces/pairs of matching catcode1/2-character-tokens where you wish to keep them.
The replacement text of a macro definition is formed by the sequence
{InsideBracesA},OutsideBracesA,{InsideBracesB},OutsideBracesB,{InsideBracesC},OutsideBracesCWhen using
\DTLsubstituteall
for replacing each comma by a slash, you don't get
{InsideBracesA}/OutsideBracesA/{InsideBracesB}/OutsideBracesB/{InsideBracesC}/OutsideBracesCbut you get:
InsideBracesA/OutsideBracesA/InsideBracesB/OutsideBracesB/InsideBracesC/OutsideBracesCThe braces that surround all the phrases "InsideBraces..." get removed.
When replacing commas by slashes with the sequence
{InsideBracesA},OutsideBracesA//{InsideBracesB},OutsideBracesB//{InsideBracesC},OutsideBracesCyou don't get
{InsideBracesA}/OutsideBracesA//{InsideBracesB}/OutsideBracesB//{InsideBracesC}/OutsideBracesCbut you get:
InsideBracesA/OutsideBracesA//{InsideBracesB}/OutsideBracesB//{InsideBracesC}/OutsideBracesCOnly the braces that surround the single phrase "InsideBracesA" get removed.
Seems the behaviour of \DTLsubstituteall
regarding the removal of braces cannot be predicted by just reading the datatool-documentation.
MWE
Download (0.99K)
\documentclass[landscape]{article} \pdfpagewidth=\paperwidth \pdfpageheight=\paperheight \parskip=\baselineskip \textwidth=\paperwidth \addtolength\textwidth{-4cm}% \evensidemargin=2cm \addtolength\evensidemargin{-1in} \addtolength\evensidemargin{-\hoffset} \oddsidemargin=\evensidemargin \usepackage{datatool} \begin{document} \def\tempa{% {InsideBracesA},OutsideBracesA,{InsideBracesB},OutsideBracesB,{InsideBracesC},OutsideBracesC% } All the braces are there there before the replacement: \texttt{\meaning\tempa}% \DTLsubstituteall{\tempa}{,}{/} All the braces are gone after the replacement: \texttt{\meaning\tempa}% \null\hrulefill\null \def\tempa{% {InsideBracesA},OutsideBracesA//{InsideBracesB},OutsideBracesB//{InsideBracesC},OutsideBracesC% } All the braces are there there before the replacement: \texttt{\meaning\tempa} %Let's replace all commas: \DTLsubstituteall{\tempa}{,}{/} Only the first pair of braces is gone after the replacement: \texttt{\meaning\tempa} \end{document}
Evaluation
Comments
0 comments.
Add Comment
Page permalink: https://www.dickimaw-books.com/bugtracker.php?key=126