1

Consider this minimal working example:

    \documentclass{beamer}
    \usepackage{csvsimple,filecontents}

    \begin{document}

    \begin{filecontents*}{data.csv}
    id,type
    1,a
    2,b
    \end{filecontents*}

    \begin{frame}    
    \csvreader{data.csv}{1=\id,2=\type}{
        \ifcsvstrcmp{\type}{a}{
        %do something
        }{
        %do something else
        }       
    }
    \end{frame}

    \end{document}

The above code does not compile unless the \ifcsvstrcmp{}{}{}{} is commented out.

Here's the error message:

pdflatex> ! Undefined control sequence.
pdflatex> \csv@@body -> \ifcsvstrcmp
pdflatex> --------------------------------------{\type }{a}{}{}
pdflatex> l.14 }

Appreciating any hints on what I might be doing wrong here...

Thx!

4
  • 1
    I do not get an error message.. Commented May 22, 2019 at 9:53
  • @steven Thanks for the info. What is your TeX version? I am using pdfTeX, Version 3.14159265-2.6-1.40.17 (TeX Live 2016/W32TeX).
    – ddotsdot
    Commented May 22, 2019 at 10:20
  • 1
    I have 3.14159265-2.6-1.40.19, though I more strongly suspect it may be a package date that is the issue. Commented May 22, 2019 at 10:24
  • @steven Bullseye! The above code compiles after I did a tlmgr update --all. So, cause was presumably an outdated csvsimple package. Feel free to copy your comment into an answer, and I'll accept it. Thanks a bunch!
    – ddotsdot
    Commented May 22, 2019 at 12:02

1 Answer 1

2

Debugging can be difficult. Often, the problem isn't a bug, but the user misunderstanding the macro's syntax or limitations. Often, it is just a simple typo on your input, misspelling a macro name or mismatching your braces. As KJO noted, a really annoying problem is when non-printing characters slip into your input. These can be maddening to find and eliminate.

When all those avenues come up dry, another avenue to check is whether your packages are out of date or mismatched with each other. This is what I suggested to the OP by way of comment.

Upon updating all of his packages, the problem went away, therefore confirming that an outdated package was the source of the issue.

You must log in to answer this question.

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