Advertisement
Guest User

Untitled

a guest
Jul 23rd, 2017
49
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. documentclass{article}
  2.  
  3. usepackage{fontspec}
  4. setmainfont{FreeSerif.otf}
  5.  
  6. % turn on xetex character class feature
  7. XeTeXinterchartokenstate=1
  8.  
  9. % character class for beta
  10. newXeTeXintercharclassmyc
  11.  
  12. % assign beta to the class
  13. XeTeXcharclass`β=myc
  14.  
  15. % specify that swapbeta should be inserted between any
  16. % normal character (class zero) and a beta (class mych)
  17. XeTeXinterchartoks 0 myc{swapbeta}
  18.  
  19. % define swapbeta to swallow a β and expand to ϐ
  20. defswapbeta β{ϐ}
  21.  
  22. % To do the same for phi just define a new class and a new swapphi
  23. % command and set up a substitution for that.
  24.  
  25. % testing...
  26. begin{document}
  27.  
  28. abc βέβα
  29.  
  30. end{document}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement