Bug Tracker

ID: 154 🔗 Closed (Not a Bug) datatool 2.32 Nicola Talbot 2020-03-15 18:59:36 \switchargs isn't taken into account when sorting

Report

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

% arara: pdflatex
\documentclass{article}

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

\newcommand*{\switchargs}[2]{#2#1}

\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.

Watch This Report

If you supply your name, it will be used in the email greeting, which provides a more personal message, otherwise you'll just get a generic greeting. If you have previously supplied your name when signing up for notifications, you don't need to resupply it unless you want to change it.

If you have previously subscribed to notifications for this report, you can unsubscribe by clicking on the "Stop Notification" button.

The "Confirm Bug ID" field helps to protect against spambots. Please enter the bug ID (which you can find at the top of this page).

Name: (Optional.)