Major fix in the code!
Major version update, Beampy is now compatible with python 3 (tested on 3.7)
Some minor fix:
Fix bug with dvisvgm output for tikz dvi (function latex2svg has now an option to write the svg produced by dvisvgm).
Add tableofcontents modules See documentation.
Add a BeamerFrankfurt theme See documentation.
Figure module accepts animated gif.
Extra latex packages could be added to text module with the “extra_packages” argument.
Compute svg rectangle and circle size which improve the rendering speed (no need to call Inkscape).
Improve box module (it is now a subclass of group) See documentation.
Correct some scale factors in the convert_unit function.
Width and height are now Length objects and accept complex operations like:
# 50% of the currentwidth
a = rectangle(width='50%', height=10)
# width/height relative to the a element
b = rectangle(width=a.width/2+'2cm', height=a.height/'10pt')
module position (x,y) operation now accept Length objects (width/height):
a = rectangle(width='50%', height=10)
b = rectangle(x=a.width+'2cm', y=a.height+5)
Change the core of beampy to render elements when needed for operation on position or length (i.e. when you make an operation on an element width or height that is unknown, the element will be rendered to get its size and allow the operation)
Add “zorder” operation for modules (above/below/last/first) to change their overlay order:
a = rectangle(x='center', y='center', width=50, height=50)
b = rectangle(x='center', y='center', width=a.height+100,
height=a.height+100, color='red')
# Make b appears below a
b.below(a)
# equivalent to a.above(b) or a.last() or b.first()
Add box function to decorate group
New experimental way to write text inside presentation using context manager
with text(width=400):
"""
Any comment inside the context manager will be passed to the
text function as input argument. This allows clearer source
when writing long texts.
No more need to add an *r* before to protect the text passed to
latex, it's now automatically added.
"""
Correct bug when only html object are present in one slide
Correct small typos in the install section of the documentation.
Introduce layer mechanism. Slide elements can be animated by layers allowing mechanism like beamer “only”. The layer are managed as python slicing on Beampy modules.
with slide('Test layers'):
text('First printed on layer 0')
text('Secondly printed on layer 1')[1]
text('Printed from layer 2 to 3')[2,3]
text('Printed on all layers')[:]
text('Printed on layer 4')[4]
with group(width=300)[2:]:
text('Printed inside group')
text('for layers 2 to end')
The core of Beampy slide processor has been rewritten and now allows recursive group of elements.
with group():
text('toto')
with group(width=300):
text('tata')
with group(width=200):
figure('./niceplot.pdf')
text('nice legend')
If a group width is given all elements in groups without specified width take the width of the group
with group(width=200):
figure('./niceplot.pdf')
text('nice legend')
# Figure and text width will be automatically set to 200 px
Relative placement now could be done on auto positioned elements
t0 = text('toto')
text('tata', x=t0.center + center(0), t0.bottom + 0.1)
Video now could use external links (with embedded=True) rather than be included in the html file. The video is loaded from disk (be careful with file path) when the slide is displayed on screen.
Improve cache: one file per element cached (don’t write the cache twice!)
Svg: Add line and rectangle commands to easily draw lines and rectangles
Relative placement: add shortcut center(shift), right(shift) and bottom(shift) to change the anchor of the current element.
e1 = text('Somthing', x=0.2, y=0.4)
e2 = text('An other thing',
x=e1.left + right(0.1),
y=e1.center + center(0))