handcalcs 2.0 is a rewrite. The parser builds a tree of nodes, and pluggable renderers turn it into:
- Markdown (the Jupyter default)
- LaTeX
- HTML
- ASCII text
- Excel, with live formulas
- Word, with editable equations
pip install handcalcs now installs 2.0.
Notebooks written for 1.x need a few changes. See Coming from handcalcs v1, or convert them with hc-migrate. To stay on 1.x for now, pin "handcalcs<2".
Highlights for people coming from 1.x
- Comment commands replace the v1 cell override tags:
# hc: -f .2f,-m,-g,-i/-swith conditions,--check,--boxed,--pagebreak. - Headings, prose and light Markdown in comments, and Jinja templating.
- More of Python renders: nested
if/for, indexing, comprehensions, conditional expressions,withblocks, line continuations and bare expressions. - Units: forallpeople and pint quantities, and
# hc: -ufor unit inputs. - Other new tools:
- SymPy substitution with
# hc: -y(v1's%%render sympy) %%source latex(v1's%%tex)%renderfor one line@handcalc(display=True)- a command line:
handcalcs script.py -o calc.docx inputs=, to render one script with many input sets
- SymPy substitution with
@handcalc(jupyter_display=True) still works, with a deprecation warning. It will be removed in handcalcs 3.0.
Since 2.0.0rc5
- The
exportersextra is gone. Use nbconvert's own--no-inputinstead. - A
@handcalcfunction in a rendered script works. It used to raiseOSError: could not get source code. - Headings:
# ##is a heading, the same as###. # hc: -badds about one blank line in every renderer.- Long equations no longer run off the page in LaTeX or Word. Rows that are too wide are split one step per row, wide grids are set in fewer columns, and anything still too wide is scaled down.
- Line magics and
!commands inside a%%rendercell now run with the cell, and are left out of the render. - pint quantities of numpy arrays show their values (#384).
The full list, release candidate by release candidate, is in the changelog.
Full Changelog: v1.11.0...v2.0.0