Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2016
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.00 KB | None | 0 0
  1. documentclass{article}
  2.  
  3. makeatletter
  4. newcommand@ifnextchars[3]{%
  5. expandafterifxexpandafter@empty#1@empty%
  6. def@ifnextchars@tmp{#3}%
  7. else%
  8. def@ifnextchars@tmp{%
  9. expandafterexpandafterexpandafter@ifnextchars@auxexpandafter%
  10. {@car#1@nil}{@cdr#1@nil}{#2}{#3}%
  11. }%
  12. fi%
  13. @ifnextchars@tmp%
  14. }
  15. newcommand@ifnextchars@aux[4]{%
  16. expandafter@ifnextchar#1{%
  17. #3%
  18. }{%
  19. @ifnextchars{#2}{#3}{#4}%
  20. }%
  21. }
  22.  
  23. newcommandwhereinsentence{%
  24. @ifnextchars{.!?}{%
  25. I am in the end of a sentence.
  26. }{%
  27. I am not in the end of a sentence.
  28. }
  29. }
  30. newcommandvowel{%
  31. @ifnextchars{aeiouy}{%
  32. Vowel:
  33. }{%
  34. Not vowel:
  35. }
  36. }
  37. makeatother
  38.  
  39. begin{document}
  40.  
  41. Here is whereinsentence a sentencewhereinsentence.
  42.  
  43. vowel a.
  44.  
  45. vowel b.
  46.  
  47. end{document}
  48.  
  49. Runaway argument?
  50. {I am in the end of a sentence. }{@ifnextchars {@cdr @cdr .!?@nil ETC.
  51. ! Paragraph ended before @cdr was complete.
  52. <to be read again>
  53. par
  54. l.44
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement