jneug / typst-codelst

A typst package to render sourcecode
MIT License
79 stars 4 forks source link

Document how to adjust the font #8

Closed Nerixyz closed 4 months ago

Nerixyz commented 7 months ago

I was trying to adjust the font, which you can, for #raw, do by using #show raw: it => ..., but here you'll need to use raw.line.

To save the next person some work, I've added an example to the manual.


Btw, I noticed that typst-mantys doesn't work with the main/nightly version of typst right now, I had to change the following:

diff --git a/api.typ b/api.typ
index 4684b32..b214854 100644
--- a/api.typ
+++ b/api.typ
@@ -17,8 +17,8 @@

 #let dtype( t, fnote:false, parse-type:false ) = {
   if mty.not-is-func(t) and mty.not-is-lambda(t) {
-    if parse-type or type(t) != "string" {
-      t = type(t)
+    if parse-type or type(t) != str {
+      t = str(type(t))
     }
   }

Furthermore, as you can see on the rendered example, it might be nice to have some kind of line-height/line-gutter option to adjust spacing of the lines (I'm pretty sure passing the value to row-gutter in the table should be enough [for now?]).

jneug commented 4 months ago

Thanks for your input. Somehow I completely missed your contribution. Since the code changed since November I will close this request, but add your contribution to the manual.

Mantys should work with the current version of Typst and hopefully will be available in the package repository in the next few days.

I'm working on the line height adjustments, but simply using row-gutter adds ugly gaps when combined with line highlights. Maybe there is a better solution.

Thanks for your contribution. Its much appreciated.