Bug Tracker

ID:154 🔗
Status:Closed (Not a Bug)
Category:datatool
Version:2.32
Submitted by:Nicola Talbot
Date:2020-03-15 18:59:36
Summary:\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}
\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.

Add comment or return to search results.

Watch This Report

If you would like to be notified whenever updates are made to this report, please fill in your email address in the box below and click on "Notify Me of Changes" button. (Please ensure the address is valid.) Your details won't be passed on to third parties in line with this site's Privacy Policy.

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

(Optional.)
E mail:
Confirm E mail:
Confirm Bug ID:

To unsubscribe from all notifications use the notifications page.

Comment

You can append a comment to the report using the form below. Comments are checked first before being added. Any spam or offensive content will be removed first according to this site's Terms of Website Use. Please bear in mind that I develop and maintain free software in my spare time. If you want commerical level support then you can hire a TeX consultant.

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

(Optional. If provided, it will be shown with the comment.)
Confirm Bug ID:

You can use the following markup:

[pre]Displayed verbatim[/pre]
[tt]monospace text[/tt]
[em]emphasized text[/em]
[b]bold text[/b]
[url]web address[/url]

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

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

Click on the Preview button to preview the message.

Return to search results.