2

This is a very strange question I encountered...so I am using the "NewDocumentCommand" from xparse. I have the following codes in my "test.sty" file (just a simple example):

\usepackage{xparse}
\usepackage{amssymb}
\NewDocumentCommand{\Test}{e{_}}{\mathbb{T}_{#1}}

I have the following codes in my .tex file:

\documentclass{article}
\usepackage{amssymb,test}
\begin{document}
\[\Test_{n}\]
\end{document}

Now, if I run this using TexShop on my Mac, it shows the error message

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
./test.sty:3: LaTeX error: "xparse/unknown-argument-type"
! 
! Unknown argument type '_' replaced by 'm'.
! 
! See the LaTeX3 documentation for further information.
! 
! For immediate help type H <return>.
!...............................................

l.3 ...cumentCommand{\Test}{e{}}{\mathbb{T}{#1}}

?

?

However, when I run it on overleaf, it goes through and produces the expected result. I also asked a friend to run this on his TexShop, and it also goes without error.

So, I guess the issue is not with my code, but with my TexShop. I updated it to the latest ver 4.68 but the problem persists. I tried to change some configurations/settings but I don't know what could be possibly related to this phenomenon. Does anyone have any ideas? Thanks!

  • 1
    Welcome to TeX.SX! It looks like (from the formatting of the error message) that your local TeX installation is too old (the e argument type was added around 2018, I think). You'll need to update – Phelype Oleinik Jan 13 '22 at 01:16
  • Please add \listfiles to your preamble and include the part of the .log that lists the package versions currently being used with your file. Also see Which package version am I using? – Werner Jan 13 '22 at 01:18
  • @Werner Oh yes...I did this and found that I had Texlive 2015 whose xparse package does not support argument type "e". I updated it to Texlive 2021 and solved the problem. Thanks a lot!! – Rachel H Jan 13 '22 at 02:46
  • @PhelypeOleinik Yes indeed...I updated to Texlive 2021 and solved the problem. Previously I didn't know that this was different from updating Texshop. Thanks!! – Rachel H Jan 13 '22 at 03:24
  • 4
    I’m voting to close this question because the issue was caused by outdated software; solved with an update. – egreg Jan 13 '22 at 07:01
  • 1
    note that in texlive 2021 you don't need to load xparse at all here NewDocumentCommand is built in to the latex format. – David Carlisle Jan 13 '22 at 08:06

0 Answers0