You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I haven't been able to use the snippets-latex backend with any frontend due to a failing assertion. For example, based on the line here, I think I should be able to successfully run the following command in the recipes directory.
Traceback (most recent call last):
File "/nix/store/dk1jycphjcdvignvfvrmhzp4lsgxv1ka-python3.10-alectryon-1.4.0/bin/.alectryon-wrapped", line 9, in <module>
sys.exit(main())
File "/nix/store/dk1jycphjcdvignvfvrmhzp4lsgxv1ka-python3.10-alectryon-1.4.0/lib/python3.10/site-packages/alectryon/cli.py", line 920, in main
sys.exit(max(process_pipelines(args), default=0))
File "/nix/store/dk1jycphjcdvignvfvrmhzp4lsgxv1ka-python3.10-alectryon-1.4.0/lib/python3.10/site-packages/alectryon/cli.py", line 914, in process_pipelines
state = call_pipeline_step(step, state, ctx)
File "/nix/store/dk1jycphjcdvignvfvrmhzp4lsgxv1ka-python3.10-alectryon-1.4.0/lib/python3.10/site-packages/alectryon/cli.py", line 856, in call_pipeline_step
return step(state, **{p: ctx[p] for p in params})
File "/nix/store/dk1jycphjcdvignvfvrmhzp4lsgxv1ka-python3.10-alectryon-1.4.0/lib/python3.10/site-packages/alectryon/cli.py", line 360, in dump_latex_snippets
for snippet in snippets:
File "/nix/store/dk1jycphjcdvignvfvrmhzp4lsgxv1ka-python3.10-alectryon-1.4.0/lib/python3.10/site-packages/alectryon/latex.py", line 323, in gen
yield self.gen_fragments(fragments)
File "/nix/store/dk1jycphjcdvignvfvrmhzp4lsgxv1ka-python3.10-alectryon-1.4.0/lib/python3.10/site-packages/alectryon/latex.py", line 318, in gen_fragments
self.gen_fragment(fr)
File "/nix/store/dk1jycphjcdvignvfvrmhzp4lsgxv1ka-python3.10-alectryon-1.4.0/lib/python3.10/site-packages/alectryon/latex.py", line 280, in gen_fragment
self.gen_sentence(fr)
File "/nix/store/dk1jycphjcdvignvfvrmhzp4lsgxv1ka-python3.10-alectryon-1.4.0/lib/python3.10/site-packages/alectryon/latex.py", line 270, in gen_sentence
self.gen_input(s)
File "/nix/store/dk1jycphjcdvignvfvrmhzp4lsgxv1ka-python3.10-alectryon-1.4.0/lib/python3.10/site-packages/alectryon/latex.py", line 239, in gen_input
self.gen_code(fr.input)
File "/nix/store/dk1jycphjcdvignvfvrmhzp4lsgxv1ka-python3.10-alectryon-1.4.0/lib/python3.10/site-packages/alectryon/latex.py", line 189, in gen_code
with Concat(*self.highlight_enriched(code)) as block:
File "/nix/store/dk1jycphjcdvignvfvrmhzp4lsgxv1ka-python3.10-alectryon-1.4.0/lib/python3.10/site-packages/alectryon/core.py", line 132, in highlight_enriched
return self.highlight(obj.contents)
File "/nix/store/dk1jycphjcdvignvfvrmhzp4lsgxv1ka-python3.10-alectryon-1.4.0/lib/python3.10/site-packages/alectryon/latex.py", line 186, in highlight
return [Raw(self.highlighter(s, prefix="", suffix=""), verbatim=True)]
File "/nix/store/dk1jycphjcdvignvfvrmhzp4lsgxv1ka-python3.10-alectryon-1.4.0/lib/python3.10/site-packages/alectryon/pygments.py", line 219, in __call__
return self.highlighter(code, **{**self.kwargs, **kwargs})
File "/nix/store/dk1jycphjcdvignvfvrmhzp4lsgxv1ka-python3.10-alectryon-1.4.0/lib/python3.10/site-packages/alectryon/pygments.py", line 198, in highlight_latex
assert tex.startswith(PYGMENTS_LATEX_PREFIX) and tex.endswith(PYGMENTS_LATEX_SUFFIX), tex
AssertionError: \PY{k+kn}{Goal} \PY{k+kt}{True}\PY{o}{.}
I don't understand the purpose of this assertion. Am I invoking the backend incorrectly? (In which case, how should I invoke it?) The documentation on snippets-latex is scant, but perhaps I could add some if I can get it working.
The text was updated successfully, but these errors were encountered:
Thanks for the report. The issue was fixed in 40ff2af , which hasn't been part of an actual release yet.
For context, it was due to the (somewhat) recent release of pygments 2.12.0, which (in commit 231366c7106f66f67f3f27c86ee51434419fcda2), started recognizing the nowrap option: previously, all latex generated by pygments was wrapped in {Verbatim} tags, which Alectryon had to remove.
I will try to make a new release soon. However, I'd also like to patch a few things for compatibility with more recent sphinx versions. Please ping me if nothing has happened within a week or so.
(In the meantime, pip can install from a git repository, or you can downgrade pygments using pip install 'pygments<2.12.0'
Hi @cpitclaudel, it seems there hasn't been a new release after all, so this is the requested ping. In the meantime I'm fine using an old pygments version.
I haven't been able to use the
snippets-latex
backend with any frontend due to a failing assertion. For example, based on the line here, I think I should be able to successfully run the following command in therecipes
directory.alectryon fragments.v.json --backend snippets-latex
But an assertion in the LaTeX syntax highlighter fails
alectryon/alectryon/pygments.py
Line 206 in 8a1f305
I don't understand the purpose of this assertion. Am I invoking the backend incorrectly? (In which case, how should I invoke it?) The documentation on
snippets-latex
is scant, but perhaps I could add some if I can get it working.The text was updated successfully, but these errors were encountered: