0

my distribution updated diffcoeff to version 5.3 and now a lot of stuff is broken:

  1. Powers of \dl, e.g. \dl^2 x don't work anymore (See Powers of \dl with diffcoeff)
  2. Symbols with a tilde on them don't work anymore:
\documentclass[11pt,parskip]{scrartcl}
    
\usepackage{lmodern}
\usepackage[ngerman]{babel} 
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}  \usepackage{amsmath}
    
% use option ISO or version >=5 (not tested) to get upright d
\usepackage{diffcoeff}
    
\begin{document}
  $\dl A$
  $\dl \tilde{A}$
  %$\dl^2 A$    
\end{document}

does not compile with the error

! You can't use math shift character $ after \the.
<argument> $
            
l.14 $\dl \tilde{
                 A}$

The obvious fix for both problems is using \usepackage[ISO]{diffcoeff}[=v4] but in my opinion that's not a long term solution. Considering the first problem, a fix is available, does anyone know how to fix the second problem?

Also, I switched from the physics package because the overall opinion seems to be that it is badly programmed, but when old documents break with newer version of the diffcoeff package I might switch back. Is there any advice for avoiding such problems in the future?

Thanks in advance.

0

1 Answer 1

2

As of version 5, you need to put a multi-token variable in braces after \dl, such as $\dl{\tilde{A}}$.

This is explained in section 4.1 "Differentials" (on page 48) of the current manual (version 5.3).

MWE:

\documentclass{article}
\usepackage{diffcoeff}
    
\begin{document}
  $\dl A$
  $\dl{\tilde{A}}$
  $\difc[2]A{}$    
  $\difc[2]{\tilde{A}}{}$    
\end{document}

enter image description here


Your second question about "hardening" documents against future package changes cannot be answered easily. In general, package maintainers are advised to take care for backwards compatibility, so that such problems don't occur at all. But at some point in time, best practices may change, new packages offering better basic functionality may emerge and new standards may be established, which would eventually make it necessary to alter the syntax of certain commands in a package. At least, such big changes should typically be documented in the package manuals (and this is the case here).

There is no sensible way to protect against this, apart from freezing a project including all the packages in the current working version for future reference. A better advice might be to always use up-to-date packages and also update your documents from time to time (but I know that this can be tedious).

2
  • 1
    Thank you @Jasper Habicht for the clarity of this answer. Version 5 of diffcoeff was conceived as a new package (diffcoefx) and only at the end, after discussion with CTAN maintainers, changed to diffcoeff, with the knowledge that there would be consequences for existing documents. The [=v4] mechanism was for those cases. May 18 at 20:13
  • Thanks for the insightful answer, it works! Concerning the syntactic change, I haven't used diffcoeff a lot yet so updating everything might be the correct call
    – damendred
    May 19 at 17:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .