article-luaxelatex.lagda.tex 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. \documentclass{article}
  2. % Support for Agda code.
  3. \usepackage{agda}
  4. % Use special font families without TeX ligatures for Agda code. (This
  5. % code is inspired by a comment by Enrico Gregorio/egreg:
  6. % https://tex.stackexchange.com/a/103078.)
  7. \usepackage{fontspec}
  8. \newfontfamily{\AgdaSerifFont}{Latin Modern Roman}
  9. \newfontfamily{\AgdaSansSerifFont}{Latin Modern Sans}
  10. \newfontfamily{\AgdaTypewriterFont}{Latin Modern Mono}
  11. \renewcommand{\AgdaFontStyle}[1]{{\AgdaSansSerifFont{}#1}}
  12. \renewcommand{\AgdaKeywordFontStyle}[1]{{\AgdaSansSerifFont{}#1}}
  13. \renewcommand{\AgdaStringFontStyle}[1]{{\AgdaTypewriterFont{}#1}}
  14. \renewcommand{\AgdaCommentFontStyle}[1]{{\AgdaTypewriterFont{}#1}}
  15. \renewcommand{\AgdaBoundFontStyle}[1]{\textit{\AgdaSerifFont{}#1}}
  16. % Workarounds for the fact that the Latin Modern Sans font does not
  17. % support certain characters. An alternative would be to use another
  18. % font.
  19. \usepackage{newunicodechar}
  20. \newunicodechar{λ}{\ensuremath{\mathnormal{\lambda}}}
  21. \newunicodechar{∀}{\ensuremath{\mathnormal{\forall}}}
  22. \newunicodechar{₁}{\ensuremath{{}_1}}
  23. \begin{document}
  24. Some code:
  25. \begin{code}
  26. {-# OPTIONS --without-K --count-clusters #-}
  27. open import Agda.Builtin.String
  28. -- A comment with some TeX ligatures:
  29. -- --, ---, ?`, !`, `, ``, ', '', <<, >>.
  30. Θ₁ : Set → Set
  31. Θ₁ = λ A → A
  32. a-name-with--hyphens : ∀ {A : Set} → A → A
  33. a-name-with--hyphens ff--fl = ff--fl
  34. ffi : String
  35. ffi = "--"
  36. \end{code}
  37. Note that the code is indented.
  38. \end{document}