| 8 Mar 2022 |
| finn joined the room. | 16:10:58 |
| 10 Mar 2022 |
| toonn changed their profile picture. | 11:23:16 |
| 15 Mar 2022 |
| jeonwh left the room. | 13:20:52 |
| 17 Mar 2022 |
| Pol joined the room. | 13:41:32 |
Pol | Hey hi, I'm going to copy paste a message I wrote in another room. | 13:43:22 |
Pol | I'm writing a paper using LaTeX. In this paper, I'm including a lot of snippets written in Nix. Do you have an already made lstlisting configuration specifically made for Nix so it can highlight the snippets in a better way? I currently made one, here is how it looks like: | 13:44:24 |
Pol |  Download image.png | 13:45:15 |
Pol | I wish I could customize the colors of the assignations, but I cannot find a proper way. Feel free to suggest anything ! | 13:45:35 |
Pol | Sadly, I cannot share the whole paper right now, it's not meant to be open-source yet. But I can share the lstlisting configuration if needed. | 13:47:25 |
Jan Tojnar | Pol: I would try searching GitHub for the keywords | 15:36:19 |
Jan Tojnar | or I would just use the pygments based highlighter | 15:36:51 |
Jan Tojnar | * or I would just use the pygments based highlighter (minted) | 15:37:06 |
Pol | I did, there are not a lot of results for it. I inspired my stuff from what I found on Github already. | 15:37:29 |
Jan Tojnar | searching for usepackage lstlisting nix, I found https://github.com/yannham/lambdajam-2021/blob/1d6b5f6c65f8a0600370a6c6518eef9df0af47c8/presentation.tex#L31 | 15:39:51 |
Pol | In reply to @jtojnar:matrix.org searching for usepackage lstlisting nix, I found https://github.com/yannham/lambdajam-2021/blob/1d6b5f6c65f8a0600370a6c6518eef9df0af47c8/presentation.tex#L31 Yeah this is basically what I'm using and I tweaked it. I wish I could customize the colors of the variables in let ... in ... bindings. But it seems that it's not something easy to do. | 15:42:23 |
Jan Tojnar | yeah, the only other I found is https://github.com/jmbaur/talks/blob/badad5450bb5bf67a3abda9683edafa71c83b044/2022/nix/nix.sty, which does not seem much better | 15:43:51 |
Pol | This is what I have: | 15:44:43 |
Pol | https://gist.github.com/drupol/1ab0f25fea4f050f40e87d4ab75080ed | 15:45:34 |
Jan Tojnar | have you tried minted yet? it tends to have better syntax highlighting and there seems to be a syntax for Nix out of the box | 15:46:50 |
Pol | ah bon ?! | 15:47:06 |
Pol | Going to check this out. | 15:47:13 |
Pol | ./src/lrs/index.tex:3: Package minted Error: You must have `pygmentize' install
ed to use this package | 15:48:34 |
Pol | Looks like I will have to tweak my flake :) | 15:48:45 |
Pol | job done. | 15:51:34 |
Pol | amazing, thanks Jan Tojnar !!!! | 15:57:03 |
Jan Tojnar | the downside is that it depends on shell-exec and is kinda slow (maybe it is possible to disable it in preview mode?) | 15:59:03 |
Pol | It's fast enough for what I have to do... so it's all good :) | 16:01:13 |
Pol | I will now learn how to customize the colors. | 16:01:21 |
Pol | I would like to use university colors. | 16:01:27 |
Pol | https://pygments.org/demo/?lexer=nixos&style=vim&formatter=html&code=fibonacci+%3D+let%0A++++f+%3D+n%3A%0A++++++++if+%28n+%3D%3D+0%29+then+0+else%0A++++++++if+%28n+%3D%3D+1%29+then+1+else%0A++++++++f+%28n+-+1%29+%2B+f+%28n+-+2%29%3B%0Ain%0A++++f | 16:06:59 |