Latest news 2024-10-15: New blog post: Tales for Our Times Book Launch.

Bug Tracker RSS feed

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 154🔗
Submitted by: Nicola Talbot 🦜
Date: 2020-03-15 18:59:36
Status Closed (Not a Bug)
Category datatool
Version 2.32
Summary \switchargs isn't taken into account when sorting

Sign in to subscribe to notifications about this report.

Description

The datatool user manual provides an example that uses a custom command called \switchargs to alter the sorting. This no longer produces the desire order.

MWE

Download (566B)

% arara: pdflatex
\documentclass{article}

\usepackage[T1]{fontenc}
\usepackage{datatool}

\newcommand*{\switchargs}[2]{#2#1}
\DTLloaddb{scores2}{scores2.csv}

\begin{document}
\begin{table}[htbp]
\caption{Student Scores (sorting ignores \texttt{\textbackslash switchargs})}\centering
\DTLsort*{Surname,FirstName}{scores2}%
\begin{tabular}{llr}
\bfseries Surname &
\bfseries First Name &
\bfseries Score (\%)%
\DTLforeach*{scores2}{%
\firstname=FirstName,\surname=Surname,\score=Score}{%
\\
\surname & \firstname & \score}
\end{tabular}
\end{table}


\end{document}

Evaluation

This change in behaviour was caused by the bug fix strange behavior of \dtlcompare. It's now necessary to use \dtlcompareskipcstrue for this example to work. The user manual will be corrected in the next version.

Comments

0 comments.


Add Comment

Name (optional):

Are you human? Please confirm the bug report ID (which can be found at the top of this page) or login if you have an account.

Comment:


You can use the following markup:

Block:

[pre]Displayed verbatim[/pre]
[quote]block quote[/quote]

In line:

[tt]code[/tt]
[file]file/package/class name[/file]
[em]emphasized text[/em]
[b]bold text[/b]
[url]web address[/url] [sup]superscript[/sup]
[sub]subscript[/sub]

Ordered list:
[ol]
[li]first item[/li]
[li]second item[/li]
[/ol]

Unordered list:
[ul]
[li]first item[/li]
[li]second item[/li]
[/ul]

You can use the Preview button to review your message formatting before submitting.

Page permalink: https://www.dickimaw-books.com/bugtracker.php?key=154