Advertisement
Guest User

Untitled

a guest
Jan 15th, 2019
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Latex 0.49 KB | None | 0 0
  1. \documentclass{article}
  2.  
  3. \usepackage{xstring}
  4.  
  5. \newcommand{\Client}[1]{\renewcommand{\Client}{#1}}
  6.  
  7. \makeatletter
  8. \newcommand\foo[1]{%
  9.   \ifnum\pdfstrcmp{#1}{Adam}=0 %
  10.      \expandafter\@firstoftwo
  11.   \else
  12.     \expandafter\@secondoftwo
  13.   \fi
  14.   {Adam}
  15.  {Eve}%
  16. }
  17. \makeatother
  18.  
  19. \begin{document}
  20.  
  21. \Client{Adam}
  22.  
  23. % Attempt using xstring
  24. My client should be Adam: \IfSubStr{Adam}{\Client}{Adam}{Eve}
  25.  
  26. % Attempt using \pdfstrcmp
  27. My client should be Adam: \foo{\Client}
  28.  
  29. \end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement