1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495 |
- \documentclass{article}
- % Support for Agda code.
- \usepackage{agda}
- % Use special font families without TeX ligatures for Agda code. (This
- % code is inspired by a comment by Enrico Gregorio/egreg:
- % https://tex.stackexchange.com/a/103078.)
- \usepackage{fontspec}
- \newfontfamily{\AgdaSerifFont}{Latin Modern Roman}
- \newfontfamily{\AgdaSansSerifFont}{Latin Modern Sans}
- \newfontfamily{\AgdaTypewriterFont}{Latin Modern Mono}
- \renewcommand{\AgdaFontStyle}[1]{{\AgdaSansSerifFont{}#1}}
- \renewcommand{\AgdaKeywordFontStyle}[1]{{\AgdaSansSerifFont{}#1}}
- \renewcommand{\AgdaStringFontStyle}[1]{{\AgdaTypewriterFont{}#1}}
- \renewcommand{\AgdaCommentFontStyle}[1]{{\AgdaTypewriterFont{}#1}}
- \renewcommand{\AgdaBoundFontStyle}[1]{\textit{\AgdaSerifFont{}#1}}
- % Workarounds for the fact that the Latin Modern Sans font does not
- % support certain characters. An alternative would be to use another
- % font.
- \usepackage{newunicodechar}
- \newunicodechar{λ}{\ensuremath{\mathnormal{\lambda}}}
- \newunicodechar{∀}{\ensuremath{\mathnormal{\forall}}}
- \newunicodechar{₁}{\ensuremath{{}_1}}
- \begin{document}
- Some code:
- \begin{code}%
- \>[0]\AgdaSymbol{\{-\#}\AgdaSpace{}%
- \AgdaKeyword{OPTIONS}\AgdaSpace{}%
- \AgdaPragma{--without-K}\AgdaSpace{}%
- \AgdaPragma{--count-clusters}\AgdaSpace{}%
- \AgdaSymbol{\#-\}}\<%
- \\
- %
- \\[\AgdaEmptyExtraSkip]%
- \>[0]\AgdaKeyword{open}\AgdaSpace{}%
- \AgdaKeyword{import}\AgdaSpace{}%
- \AgdaModule{Agda.Builtin.String}\<%
- \\
- %
- \\[\AgdaEmptyExtraSkip]%
- \>[0]\AgdaComment{--\ A\ comment\ with\ some\ TeX\ ligatures:}\<%
- \\
- \>[0]\AgdaComment{--\ --,\ ---,\ ?`,\ !`,\ `,\ ``,\ ',\ '',\ <<,\ >>.}\<%
- \\
- %
- \\[\AgdaEmptyExtraSkip]%
- \>[0]\AgdaFunction{Θ₁}\AgdaSpace{}%
- \AgdaSymbol{:}\AgdaSpace{}%
- \AgdaPrimitive{Set}\AgdaSpace{}%
- \AgdaSymbol{→}\AgdaSpace{}%
- \AgdaPrimitive{Set}\<%
- \\
- \>[0]\AgdaFunction{Θ₁}\AgdaSpace{}%
- \AgdaSymbol{=}\AgdaSpace{}%
- \AgdaSymbol{λ}\AgdaSpace{}%
- \AgdaBound{A}\AgdaSpace{}%
- \AgdaSymbol{→}\AgdaSpace{}%
- \AgdaBound{A}\<%
- \\
- %
- \\[\AgdaEmptyExtraSkip]%
- \>[0]\AgdaFunction{a-name-with--hyphens}\AgdaSpace{}%
- \AgdaSymbol{:}\AgdaSpace{}%
- \AgdaSymbol{∀}\AgdaSpace{}%
- \AgdaSymbol{\{}\AgdaBound{A}\AgdaSpace{}%
- \AgdaSymbol{:}\AgdaSpace{}%
- \AgdaPrimitive{Set}\AgdaSymbol{\}}\AgdaSpace{}%
- \AgdaSymbol{→}\AgdaSpace{}%
- \AgdaBound{A}\AgdaSpace{}%
- \AgdaSymbol{→}\AgdaSpace{}%
- \AgdaBound{A}\<%
- \\
- \>[0]\AgdaFunction{a-name-with--hyphens}\AgdaSpace{}%
- \AgdaBound{ff--fl}\AgdaSpace{}%
- \AgdaSymbol{=}\AgdaSpace{}%
- \AgdaBound{ff--fl}\<%
- \\
- %
- \\[\AgdaEmptyExtraSkip]%
- \>[0]\AgdaFunction{ffi}\AgdaSpace{}%
- \AgdaSymbol{:}\AgdaSpace{}%
- \AgdaPostulate{String}\<%
- \\
- \>[0]\AgdaFunction{ffi}\AgdaSpace{}%
- \AgdaSymbol{=}\AgdaSpace{}%
- \AgdaString{"--"}\<%
- \end{code}
- Note that the code is indented.
- \end{document}
|