Mailing List Archive

Jupyter notebooks to A4 (again)
Hello all,

Some years ago I asked about exporting notebooks to pdf in
A4 rather than US Letter. I got help, rather detailed
instructions from you in general and Piet von Oostrum in
particular. Following the advice helped and I was happy.

Now it does not work any longer:

nbconvert failed: A4article

I am stumped. I have not changed anything and all
looks OK.

Today I tried up-dating all things Python and Jupyter
but that did not help.

I have also tried removing the A4 stuff and after
restarting Jupyter I can export to PDF and get US Letter
paper format.

A quick and (obviously) not very clever internet search
yielded nothing helpful.

Any ideas?

/Martin
--
https://mail.python.org/mailman/listinfo/python-list
Re: Jupyter notebooks to A4 (again) [ In reply to ]
Hi Martin,

I noticed that i did use the same ,
formats are mentioned in git already.

https://github.com/jupyter/nbconvert

On Mon, Jan 25, 2021 at 6:47 AM Martin Schöön <martin.schoon@gmail.com>
wrote:

> Hello all,
>
> Some years ago I asked about exporting notebooks to pdf in
> A4 rather than US Letter. I got help, rather detailed
> instructions from you in general and Piet von Oostrum in
> particular. Following the advice helped and I was happy.
>
> Now it does not work any longer:
>
> nbconvert failed: A4article
>
> I am stumped. I have not changed anything and all
> looks OK.
>
> Today I tried up-dating all things Python and Jupyter
> but that did not help.
>
> I have also tried removing the A4 stuff and after
> restarting Jupyter I can export to PDF and get US Letter
> paper format.
>
> A quick and (obviously) not very clever internet search
> yielded nothing helpful.
>
> Any ideas?
>
> /Martin
> --
> https://mail.python.org/mailman/listinfo/python-list
>
--
https://mail.python.org/mailman/listinfo/python-list
Re: Jupyter notebooks to A4 (again) [ In reply to ]
Martin Schöön <martin.schoon@gmail.com> writes:

> Hello all,
>
> Some years ago I asked about exporting notebooks to pdf in
> A4 rather than US Letter. I got help, rather detailed
> instructions from you in general and Piet von Oostrum in

Who now calls himself Pieter van Oostrum, just like his passport says :)
--
Pieter van Oostrum
www: http://pieter.vanoostrum.org/
PGP key: [8DAE142BE17999C4]
--
https://mail.python.org/mailman/listinfo/python-list
Re: Jupyter notebooks to A4 (again) [ In reply to ]
Den 2021-01-28 skrev Pieter van Oostrum <pieter-l@vanoostrum.org>:
> Martin Schöön <martin.schoon@gmail.com> writes:
>
>> Hello all,
>>
>> Some years ago I asked about exporting notebooks to pdf in
>> A4 rather than US Letter. I got help, rather detailed
>> instructions from you in general and Piet von Oostrum in
>
> Who now calls himself Pieter van Oostrum, just like his passport says :)

Sorry, my bad.

Any ideas regarding my question?

/Martin
--
https://mail.python.org/mailman/listinfo/python-list
Re: Jupyter notebooks to A4 (again) [ In reply to ]
Den 2021-01-25 skrev tommy yama <bluebox03@gmail.com>:
> Hi Martin,
>
> I noticed that i did use the same ,
> formats are mentioned in git already.
>
> https://github.com/jupyter/nbconvert
>
Are you telling me there are instruction for how to get A4paper
format there? I have looked around but...

/Martin
--
https://mail.python.org/mailman/listinfo/python-list
Re: Jupyter notebooks to A4 (again) [ In reply to ]
Hi,

A4article is not indicated in git as you had a look. :(
Maybe that format (A4article) was depreciated already?

On Fri, Jan 29, 2021 at 6:52 AM Martin Schöön <martin.schoon@gmail.com>
wrote:

> Den 2021-01-25 skrev tommy yama <bluebox03@gmail.com>:
> > Hi Martin,
> >
> > I noticed that i did use the same ,
> > formats are mentioned in git already.
> >
> > https://github.com/jupyter/nbconvert
> >
> Are you telling me there are instruction for how to get A4paper
> format there? I have looked around but...
>
> /Martin
> --
> https://mail.python.org/mailman/listinfo/python-list
>
--
https://mail.python.org/mailman/listinfo/python-list
Re: Jupyter notebooks to A4 (again) [ In reply to ]
Martin Schöön <martin.schoon@gmail.com> writes:

> Hello all,
>
> Some years ago I asked about exporting notebooks to pdf in
> A4 rather than US Letter. I got help, rather detailed
> instructions from you in general and Piet von Oostrum in
> particular. Following the advice helped and I was happy.
>
> Now it does not work any longer:
>
> nbconvert failed: A4article
>
> I am stumped. I have not changed anything and all
> looks OK.
>
> Today I tried up-dating all things Python and Jupyter
> but that did not help.
>
> I have also tried removing the A4 stuff and after
> restarting Jupyter I can export to PDF and get US Letter
> paper format.
>
> A quick and (obviously) not very clever internet search
> yielded nothing helpful.

The template system has changed in nbconvert version 6, so the original templates don't work anymore.
And they still haven't supplied standard provisions for A4 paper (like an option or so). Probably a mild case of cultural blindness.

I found out how to do it in the new template system, however, there is a bug that gives some troubles.

To get all your latex (and therefore also PDF) output in A4 format:

Find out where nbconvert expects user templates.

Issue the shell command:
bash-3.2$ jupyter --paths
Look up the data part:
...
data:
/Users/pieter/Library/Jupyter
...
The first one is your personal directory in my case ~/Library/Jupyter.

In this directory create the directory nbconvert/templates/latex
In this directory create these two files:
conf.json