article-luaxelatex-different-fonts.tex 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. \documentclass{article}
  2. % Support for Agda code.
  3. \usepackage{agda}
  4. % Use fonts with a decent coverage of non-ASCII characters.
  5. \usepackage{fontspec}
  6. \setmainfont{DejaVu Serif}
  7. \setsansfont{DejaVu Sans}
  8. \setmonofont{DejaVu Sans Mono}
  9. % Use special font families without TeX ligatures for Agda code. (This
  10. % code is inspired by a comment by Enrico Gregorio/egreg:
  11. % https://tex.stackexchange.com/a/103078.)
  12. \newfontfamily{\AgdaSerifFont}{DejaVu Serif}
  13. \newfontfamily{\AgdaSansSerifFont}{DejaVu Sans}
  14. \newfontfamily{\AgdaTypewriterFont}{DejaVu Sans Mono}
  15. \renewcommand{\AgdaFontStyle}[1]{{\AgdaSansSerifFont{}#1}}
  16. \renewcommand{\AgdaKeywordFontStyle}[1]{{\AgdaSansSerifFont{}#1}}
  17. \renewcommand{\AgdaStringFontStyle}[1]{{\AgdaTypewriterFont{}#1}}
  18. \renewcommand{\AgdaCommentFontStyle}[1]{{\AgdaTypewriterFont{}#1}}
  19. \renewcommand{\AgdaBoundFontStyle}[1]{\textit{\AgdaSerifFont{}#1}}
  20. \begin{document}
  21. Some code:
  22. \begin{code}%
  23. \>[0]\AgdaSymbol{\{-\#}\AgdaSpace{}%
  24. \AgdaKeyword{OPTIONS}\AgdaSpace{}%
  25. \AgdaPragma{--without-K}\AgdaSpace{}%
  26. \AgdaPragma{--count-clusters}\AgdaSpace{}%
  27. \AgdaSymbol{\#-\}}\<%
  28. \\
  29. %
  30. \\[\AgdaEmptyExtraSkip]%
  31. \>[0]\AgdaKeyword{open}\AgdaSpace{}%
  32. \AgdaKeyword{import}\AgdaSpace{}%
  33. \AgdaModule{Agda.Builtin.String}\<%
  34. \\
  35. %
  36. \\[\AgdaEmptyExtraSkip]%
  37. \>[0]\AgdaComment{--\ A\ comment\ with\ some\ TeX\ ligatures:}\<%
  38. \\
  39. \>[0]\AgdaComment{--\ --,\ ---,\ ?`,\ !`,\ `,\ ``,\ ',\ '',\ <<,\ >>.}\<%
  40. \\
  41. %
  42. \\[\AgdaEmptyExtraSkip]%
  43. \>[0]\AgdaFunction{Θ₁}\AgdaSpace{}%
  44. \AgdaSymbol{:}\AgdaSpace{}%
  45. \AgdaPrimitive{Set}\AgdaSpace{}%
  46. \AgdaSymbol{→}\AgdaSpace{}%
  47. \AgdaPrimitive{Set}\<%
  48. \\
  49. \>[0]\AgdaFunction{Θ₁}\AgdaSpace{}%
  50. \AgdaSymbol{=}\AgdaSpace{}%
  51. \AgdaSymbol{λ}\AgdaSpace{}%
  52. \AgdaBound{A}\AgdaSpace{}%
  53. \AgdaSymbol{→}\AgdaSpace{}%
  54. \AgdaBound{A}\<%
  55. \\
  56. %
  57. \\[\AgdaEmptyExtraSkip]%
  58. \>[0]\AgdaFunction{a-name-with--hyphens}\AgdaSpace{}%
  59. \AgdaSymbol{:}\AgdaSpace{}%
  60. \AgdaSymbol{∀}\AgdaSpace{}%
  61. \AgdaSymbol{\{}\AgdaBound{A}\AgdaSpace{}%
  62. \AgdaSymbol{:}\AgdaSpace{}%
  63. \AgdaPrimitive{Set}\AgdaSymbol{\}}\AgdaSpace{}%
  64. \AgdaSymbol{→}\AgdaSpace{}%
  65. \AgdaBound{A}\AgdaSpace{}%
  66. \AgdaSymbol{→}\AgdaSpace{}%
  67. \AgdaBound{A}\<%
  68. \\
  69. \>[0]\AgdaFunction{a-name-with--hyphens}\AgdaSpace{}%
  70. \AgdaBound{ff--fl}\AgdaSpace{}%
  71. \AgdaSymbol{=}\AgdaSpace{}%
  72. \AgdaBound{ff--fl}\<%
  73. \\
  74. %
  75. \\[\AgdaEmptyExtraSkip]%
  76. \>[0]\AgdaFunction{ffi}\AgdaSpace{}%
  77. \AgdaSymbol{:}\AgdaSpace{}%
  78. \AgdaPostulate{String}\<%
  79. \\
  80. \>[0]\AgdaFunction{ffi}\AgdaSpace{}%
  81. \AgdaSymbol{=}\AgdaSpace{}%
  82. \AgdaString{"--"}\<%
  83. \end{code}
  84. Note that the code is indented.
  85. \end{document}