When using \printpythontex and the output verbatim, I'd like to set a default styling. For example:




A=[i+j for i=1:3,j=1:3]


where I'm using julia as the language, but that shouldn't be relevant.

I'd like to have all (or nearly all) verbatim output have this style.


The \printpythontex command with the verbatim option internally calls \VerbatimInput from the fancyvrb package. You can set default options for \VerbatimInput using \RecustomVerbatimCommand, as mentioned in the manual for fancyvrb on page 18 in a footnote.

MWE (converted to Python because I don't have Julia installed):




%A=[i+j for i=1:3,j=1:3]

for i in range(1,4):
   for j in range(1,4):
      print(i+j, end=" ")



enter image description here

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.