Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using listings instead of verbatim to enable code wrap #202

Closed
Carreau opened this issue Dec 7, 2015 · 5 comments
Closed

Using listings instead of verbatim to enable code wrap #202

Carreau opened this issue Dec 7, 2015 · 5 comments
Labels
format:LaTeX pertains to exporting to the LaTeX format

Comments

@Carreau
Copy link
Member

Carreau commented Dec 7, 2015

@redraven984 opened ipython/ipython#9068

Hi All,

I'm trying to export a notebook with nbconvert to latex. How can I convert the code cells so that long code lines are wrapped?

My understanding is that if verbatim is switched to listings this can be done. However, I dont know what to do with commandchars if I switch.

Thanks for your help! and Im sorry about this basic question.

@Carreau
Copy link
Member Author

Carreau commented Dec 11, 2015

@Carreau commented

That'a likely a jupyter/nbconvert issue, that can be done with custom templates.
There is not easy option.

#141 should help.

@Carreau
Copy link
Member Author

Carreau commented Dec 11, 2015

@redraven984 commented

Thanks for getting back to me. Do you know what the 'commandchars' line does in verbatim?

@Carreau
Copy link
Member Author

Carreau commented Dec 11, 2015

@Carreau commented

commandchars

No, I havent touched verbatim in years, sorry.

@takluyver takluyver added the format:LaTeX pertains to exporting to the LaTeX format label Feb 3, 2016
@ketch
Copy link

ketch commented Jun 6, 2017

Has anybody gotten further with this? It looks like there is an escapechar option for the listings package, but it is used in a slightly different way than commandchars in fancyvrb.

@t-makaro
Copy link
Contributor

t-makaro commented Jun 10, 2019

commandchars in fancyvrb is used to allow pygments syntax highlighting, and so it is not needed in listings. I built a package that uses listings for pdf conversion over at nb_pdf_template in version 2.somthing.

However that is irrelevant now as #992 adds line wrapping without using listings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
format:LaTeX pertains to exporting to the LaTeX format
Projects
None yet
Development

No branches or pull requests

4 participants