Typeset source code with SATySFi.
You can install code-printer package with Satyrographos.
opam pin add "git+https://github.com/puripuri2100/satysfi-code-printer.git"
opam install satysfi-code-printer
satyrographos installOR
opam update
opam install satysfi-code-printer
satyrographos installAfter installation, you can import this package by writing the code in preamble.
@require: code-printer/code-printer
@require: code-printer/code-syntax
@require: code-printer/code-theme
Write the code like this:
+p{\inline-code (`inline_code`);}
+code-printer (```let-rec factorial n =
match n with
| 0 -> 1
| _ -> n * (factorial (n - 1))```);
When typesetting code with syntax-highlight, write the code like this:
+p{\inline-code ?:(CodePrinter.make-config CodeSyntax.rust CodeTheme.basic-light) (`inline_code`);}
+code-printer ?:(
CodePrinter.make-config CodeSyntax.satysfi CodeTheme.basic-dark
)(```let-rec factorial n =
match n with
| 0 -> 1
| _ -> n * (factorial (n - 1))```);
CodePrinter.make-config function sets config of syntax and color.
List of syntax config constant:
CodeSyntax.rustCodeSyntax.ocamlCodeSyntax.satysfiCodeSyntax.cobolCodeSyntax.cCodeSyntax.cppCodeSyntax.csharpCodeSyntax.dCodeSyntax.erlangCodeSyntax.fsharpCodeSyntax.fortranCodeSyntax.goCodeSyntax.haskellCodeSyntax.htmlCodeSyntax.javaCodeSyntax.javascriptCodeSyntax.jsonCodeSyntax.json5CodeSyntax.juliaCodeSyntax.kotlinCodeSyntax.luaCodeSyntax.lispCodeSyntax.nimCodeSyntax.makefileCodeSyntax.shellCodeSyntax.perlCodeSyntax.prologCodeSyntax.phpCodeSyntax.pythonCodeSyntax.rCodeSyntax.rubyCodeSyntax.scalaCodeSyntax.swiftCodeSyntax.texCodeSyntax.tomlCodeSyntax.typescriptCodeSyntax.visualbasicCodeSyntax.xml
List of color theme config constant:
CodeTheme.basic-lightCodeTheme.basic-darkCodeTheme.gruvbox-lightCodeTheme.gruvbox-darkCodeTheme.draculaCodeTheme.iceberg-darkCodeTheme.iceberg-lightCodeTheme.tyokyo-nightCodeTheme.tyokyo-night-stromCodeTheme.tyokyo-night-lightCodeTheme.ayu-darkCodeTheme.ayu-mirageCodeTheme.ayu-lightCodeTheme.spacegray-eightiesCodeTheme.spacegray-mochaCodeTheme.spacegray-ocean-darkCodeTheme.spacegray-ocean-lightCodeTheme.night-owlCodeTheme.light-owlCodeTheme.winteriscoming-dark-blueCodeTheme.winteriscoming-dark-blackCodeTheme.winteriscoming-lightCodeTheme.one-light
This package released under the MIT license.
(c) 2021 Naoki Kaneko (a.k.a. "puripuri2100")