Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. ! Missing } inserted.
  2. <inserted text>
  3. }
  4. l.47 Test $Id$
  5. , $Id{A}$ and $Id{A,B}$ inline.
  6.  
  7. documentclass{article}
  8. usepackage{amsmath}
  9. usepackage{xparse} % loads expl3
  10. %See interface3.pdf
  11.  
  12. ExplSyntaxOn
  13.  
  14. NewDocumentCommand Id {O{}}
  15. {
  16. Id:n #1
  17. }
  18.  
  19. cs_new:Npn Id:n #1
  20. {
  21. clist_set:Nn l_tmpa_clist {#1}
  22. int_case:nn
  23. {clist_count:N l_tmpa_clist}
  24. {
  25. {0}
  26. {
  27. mathop{Id}
  28. }
  29. {1}
  30. {
  31. mathop{Id}_{#1}
  32. }
  33. {2}
  34. {
  35. mathop{Id}
  36. ^{clist_item:Nn l_tmpa_clist 1}
  37. _{clist_item:Nn l_tmpa_clist 2}
  38. }
  39. }
  40. {
  41. msg_error:nn {shmuel} {More than one argument for {backslash}Id}
  42. }
  43. }
  44.  
  45. begin{document}
  46.  
  47. ExplSyntaxOn
  48.  
  49. Test $Id$, $Id{A}$ and $Id{A,B}$ inline.
  50. begin{equation}
  51. Test Id, \
  52. Id{A}, \
  53. Id{A,B}
  54. end{equation}
  55.  
  56. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement