Re: Jupyter Notebook -> PDF with A4 pages?

2019-10-13 Thread Piet van Oostrum
Martin Schöön  writes:

> Is there a way to do "Download as PDF" and get A4 pages instead
> of Letter? Yes, I know I can do "Download as LaTeX" and edit the
> result to get A4 but if there is a setting I have missed I save
> work and time.
>
> Yes, I have looked through the documentation and searched the
> Internet but so far to no avail.
>

Make a directory ~/.jupyter/templates and put a file A4article.tplx inside it:

#
((=- Default to the notebook output style -=))
((* if not cell_style is defined *))
((* set cell_style = 'style_jupyter.tplx' *))
((* endif *))

((=- Inherit from the specified cell style. -=))
((* extends cell_style *))

%===
% Latex Article
%===

((* block docclass *))
\documentclass[a4paper,11pt]{article}
((* endblock docclass *))
#

Make a file ~/.jupyter/jupyter_notebook_config.py

##
import os
custom_path = os.path.expanduser("~/.jupyter/templates")

c = get_config()
c.TemplateExporter.template_path.append(custom_path)
c.LatexExporter.template_file = 'A4article'
c.PDFExporter.latex_count = 3
c.PDFExporter.template_file = 'A4article'
c.PDFExporter.latex_command = ['pdflatex', '{filename}']
#
Replace 'pdflatex' with 'xelatex' if you prefer that.
You can leave out the c.LatexExporter.template_file line if you don't want the 
LaTeX exporter to generate A4.

-- 
Piet van Oostrum 
WWW: http://piet.vanoostrum.org/
PGP key: [8DAE142BE17999C4]
-- 
https://mail.python.org/mailman/listinfo/python-list


Jupyter Notebook -> PDF with A4 pages?

2019-10-13 Thread Martin Schöön
Is there a way to do "Download as PDF" and get A4 pages instead
of Letter? Yes, I know I can do "Download as LaTeX" and edit the
result to get A4 but if there is a setting I have missed I save
work and time.

Yes, I have looked through the documentation and searched the
Internet but so far to no avail.

/Martin
-- 
https://mail.python.org/mailman/listinfo/python-list


upgrading python on raspbian

2019-10-13 Thread Gene Heskett
I'm not a python expert by a long ways.

I have built the linuxcnc-master, which is the development branch of 
linuxcnc, a machine control program to run most metal carving machines.
Lathes, milling machines, anything you can motorize, LinuxCNC can run.
 
This requires a preempt-rt kernel which I've managed to build and 
install, all on a pi-4b running raspbian buster, the armfh-v7l version 
of debian 10.1.

But linuxcnc is quite elderly code, some of it going back to before there
was a linux, so despite being actively developed right now for x86 type
hardware but has quite a list of missing dependencies I cannot satisfy 
from the raspbian repos.

They are:

The following packages have unmet dependencies:
 linuxcnc-uspace : Depends: python2.7-glade2 but it is not installable or
python-glade2 but it is not going to be installed
   Depends: python-gtksourceview2 but it is not going to be 
installed
   Depends: python-vte but it is not installable
   Depends: python-gst0.10 but it is not installable
   Depends: python-xlib but it is not going to be installed
   Depends: python-gtkglext1 but it is not going to be installed
   Depends: python-configobj but it is not going to be installed
   Recommends: hostmot2-firmware-all but it is not installable

Can anyone supply a list of python3 packages that will cover the 
functions contained in the above list?, and I will attempt to edit the 
linuxcnc srcs to use the more modern code base?

Ignore the hostmot2-firmware-all package as its available, and may not 
be actually required with the interface card in actual use. It has its 
own fpga firmware already installed.

Thank you all.

Cheers, Gene Heskett
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
If we desire respect for the law, we must first make the law respectable.
 - Louis D. Brandeis
Genes Web page 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: upgrading python on raspbian

2019-10-13 Thread Chris Angelico
On Mon, Oct 14, 2019 at 6:38 AM Gene Heskett  wrote:
>
> I'm not a python expert by a long ways.
>
> I have built the linuxcnc-master, which is the development branch of
> linuxcnc, a machine control program to run most metal carving machines.
> Lathes, milling machines, anything you can motorize, LinuxCNC can run.
>
> This requires a preempt-rt kernel which I've managed to build and
> install, all on a pi-4b running raspbian buster, the armfh-v7l version
> of debian 10.1.
>
> But linuxcnc is quite elderly code, some of it going back to before there
> was a linux, so despite being actively developed right now for x86 type
> hardware but has quite a list of missing dependencies I cannot satisfy
> from the raspbian repos.
>
> They are:
>
> The following packages have unmet dependencies:
>  linuxcnc-uspace : Depends: python2.7-glade2 but it is not installable or
>
> Can anyone supply a list of python3 packages that will cover the
> functions contained in the above list?, and I will attempt to edit the
> linuxcnc srcs to use the more modern code base?

So if I understand you correctly, you're not worried about actually
supplying these apt packages, but you want equivalents so you can port
the code itself to Py3?

My recommendation would be to start with "sudo apt build-dep
linuxcnc-uspace" and see if it can get any, but otherwise, just
replace "python-" with "python3-" and see if that works. You may need
to dig up dev packages of them though.

Another option may be to just use pip to install your dependencies.
That might work out easier.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list