# How does one use pdf@strcmp in the pdftexcmds package? [duplicate]

This question already has an answer here:

I am trying to compare two strings with pdf@strcmp but I get the error:

! Undefined control sequence.
<argument> \pdf
@strcmp{abc}{abc}
l.6     \section{\pdf@strcmp{abc}{abc}}


Here is what I am trying to run:

\documentclass{report}
\usepackage{pdftexcmds}

\begin{document}
\section{\pdf@strcmp{abc}{abc}}
\end{document}


I was expecting to see something like 0 being output. From what I understand the strcmp returns 0 if the strings are equal, -1 if A < B and 1 otherwise. I've installed the oberdiek package so I believe I have the dependencies I need.

This seems simple but I must be missing something obvious so, how do I make this comparison?

## marked as duplicate by egreg conditionals StackExchange.ready(function() { if (StackExchange.options.isMobile) return; $('.dupe-hammer-message-hover:not(.hover-bound)').each(function() { var$hover = $(this).addClass('hover-bound'),$msg = $hover.siblings('.dupe-hammer-message');$hover.hover( function() { $hover.showInfoMessage('', { messageElement:$msg.clone().show(), transient: false, position: { my: 'bottom left', at: 'top center', offsetTop: -7 }, dismissable: false, relativeToBody: true }); }, function() { StackExchange.helpers.removeMessages(); } ); }); }); Oct 27 '17 at 17:46

for using a macro with @ in its name you've to use \makeatletter before that to change the at sign cat code.

The following code will work:

\documentclass{report}
\usepackage{pdftexcmds}

\begin{document}
\makeatletter
\section{\pdf@strcmp{abc}{abc}}
\makeatother
\end{document}


P.S. You also forgot to put \ before the command.

• Ah, so simple, I believe the  disappeared when I simplified the code. I've edited to make it reflect what was actually the problem (the missing \makeatletter). – Christian Eriksson Oct 27 '17 at 15:09