beamer-luaxelatex.tex 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  1. \documentclass{beamer}
  2. % Support for Agda code.
  3. \usepackage{agda}
  4. % Decrease the indentation of code.
  5. \setlength{\mathindent}{1em}
  6. % Use special font families without TeX ligatures for Agda code. (This
  7. % code is inspired by a comment by Enrico Gregorio/egreg:
  8. % https://tex.stackexchange.com/a/103078.)
  9. \usepackage{fontspec}
  10. \newfontfamily{\AgdaSerifFont}{Latin Modern Roman}
  11. \newfontfamily{\AgdaSansSerifFont}{Latin Modern Sans}
  12. \newfontfamily{\AgdaTypewriterFont}{Latin Modern Mono}
  13. \renewcommand{\AgdaFontStyle}[1]{{\AgdaSansSerifFont{}#1}}
  14. \renewcommand{\AgdaKeywordFontStyle}[1]{{\AgdaSansSerifFont{}#1}}
  15. \renewcommand{\AgdaStringFontStyle}[1]{{\AgdaTypewriterFont{}#1}}
  16. \renewcommand{\AgdaCommentFontStyle}[1]{{\AgdaTypewriterFont{}#1}}
  17. \renewcommand{\AgdaBoundFontStyle}[1]{\textit{\AgdaSansSerifFont{}#1}}
  18. % Workarounds for the fact that the Latin Modern Sans font does not
  19. % support certain characters.
  20. \usepackage{newunicodechar}
  21. \newunicodechar{λ}{\ensuremath{\mathnormal{\lambda}}}
  22. \newunicodechar{∀}{\ensuremath{\mathnormal{\forall}}}
  23. \newunicodechar{₁}{\ensuremath{{}_1}}
  24. \begin{document}
  25. \begin{frame}
  26. Some code:
  27. \begin{code}%
  28. %
  29. \>[2]\AgdaSymbol{\{-\#}\AgdaSpace{}%
  30. \AgdaKeyword{OPTIONS}\AgdaSpace{}%
  31. \AgdaPragma{--without-K}\AgdaSpace{}%
  32. \AgdaPragma{--count-clusters}\AgdaSpace{}%
  33. \AgdaSymbol{\#-\}}\<%
  34. \\
  35. %
  36. \\[\AgdaEmptyExtraSkip]%
  37. %
  38. \>[2]\AgdaKeyword{open}\AgdaSpace{}%
  39. \AgdaKeyword{import}\AgdaSpace{}%
  40. \AgdaModule{Agda.Builtin.String}\<%
  41. \\
  42. %
  43. \\[\AgdaEmptyExtraSkip]%
  44. %
  45. \>[2]\AgdaComment{--\ A\ comment\ with\ some\ TeX\ ligatures:}\<%
  46. \\
  47. %
  48. \>[2]\AgdaComment{--\ --,\ ---,\ ?`,\ !`,\ `,\ ``,\ ',\ '',\ <<,\ >>.}\<%
  49. \\
  50. %
  51. \\[\AgdaEmptyExtraSkip]%
  52. %
  53. \>[2]\AgdaFunction{Θ₁}\AgdaSpace{}%
  54. \AgdaSymbol{:}\AgdaSpace{}%
  55. \AgdaPrimitive{Set}\AgdaSpace{}%
  56. \AgdaSymbol{→}\AgdaSpace{}%
  57. \AgdaPrimitive{Set}\<%
  58. \\
  59. %
  60. \>[2]\AgdaFunction{Θ₁}\AgdaSpace{}%
  61. \AgdaSymbol{=}\AgdaSpace{}%
  62. \AgdaSymbol{λ}\AgdaSpace{}%
  63. \AgdaBound{A}\AgdaSpace{}%
  64. \AgdaSymbol{→}\AgdaSpace{}%
  65. \AgdaBound{A}\<%
  66. \\
  67. %
  68. \\[\AgdaEmptyExtraSkip]%
  69. %
  70. \>[2]\AgdaFunction{a-name-with--hyphens}\AgdaSpace{}%
  71. \AgdaSymbol{:}\AgdaSpace{}%
  72. \AgdaSymbol{∀}\AgdaSpace{}%
  73. \AgdaSymbol{\{}\AgdaBound{A}\AgdaSpace{}%
  74. \AgdaSymbol{:}\AgdaSpace{}%
  75. \AgdaPrimitive{Set}\AgdaSymbol{\}}\AgdaSpace{}%
  76. \AgdaSymbol{→}\AgdaSpace{}%
  77. \AgdaBound{A}\AgdaSpace{}%
  78. \AgdaSymbol{→}\AgdaSpace{}%
  79. \AgdaBound{A}\<%
  80. \\
  81. %
  82. \>[2]\AgdaFunction{a-name-with--hyphens}\AgdaSpace{}%
  83. \AgdaBound{ff--fl}\AgdaSpace{}%
  84. \AgdaSymbol{=}\AgdaSpace{}%
  85. \AgdaBound{ff--fl}\<%
  86. \\
  87. %
  88. \\[\AgdaEmptyExtraSkip]%
  89. %
  90. \>[2]\AgdaFunction{ffi}\AgdaSpace{}%
  91. \AgdaSymbol{:}\AgdaSpace{}%
  92. \AgdaPostulate{String}\<%
  93. \\
  94. %
  95. \>[2]\AgdaFunction{ffi}\AgdaSpace{}%
  96. \AgdaSymbol{=}\AgdaSpace{}%
  97. \AgdaString{"--"}\<%
  98. \end{code}
  99. Note that the code is indented.
  100. \end{frame}
  101. \end{document}