Export issues (Python code and "wideblock")

Hi TeXmacs experts,

I’m trying to export my TeXmacs file to Latex, but my Latex compiler is getting tripped up on the command “\python” for Python code, and on the environment “wideblock”, which is says doesn’t exist. When I Googled both of these things I didn’t get any useful information, such as a possible package to import with these features.

How should I proceed in order to get my exported Latex to compile?


It could a bug in the export. Your description however does not allow me to be of much help. Can you isolate and post here the snippet which pose problems so that we can give it a look?

I guess the \python tag appears since the LaTeX converter doesn’t know how to handle it. You’ll have to find a LaTeX package that does code formatting and define the \python macro in your LaTeX document to get an equivalent formatting.

I don’t know where widebox comes from, I can’t find it anywhere in the source code.

which you are able to automate using a specific tag with a latex argument in the TeXmacs document.

1 Like

Sorry, when I said “widebox” I meant to write “wideblock”. I’ve edited my original message now.

Okay upgrading to the latest version of TeXmacs seems to have fixed the issue with “wideblock”. As for the Python code, I’ll probably just need to manually change those parts from the export output to use “minted” or something. Thanks for your help!

As I wrote answering to @jeroen, you can do it from the TeXmacs document, adding to the preamble the LaTeX code inside a specific tag—see http://www.texmacs.org/tmweb/manual/webman-convert.en.html. In this way you won’t have to edit the LaTeX file after each export.

Anyway if TeXmacs generates not valid LaTeX code this could be considered a bug. It should either produce lower-level macro or some equivalent markup. As @pireddag said you can locally use \specific to define a new \python macro which do the markup. But it would be useful to file a bug in savannah so that we can solve this (and maybe similar) issues.
What happens in the HTML export?