Web Analytics

beampy

⭐ 60 stars Japanese by hchauvet

Beampy Build Status codecov pypi python version pypi licence pypi download pypi beampy version

master ブランチの開発は現在凍結されています(緊急のバグ修正のみがプッシュされます)。beampy の新しいバージョンは現在 dev ブランチで開発中ですが、まだ十分に安定していません…

Beampy は HTML5 で表示可能な svg スライドショーを作成するための Python ツールです (Firefox と Chromium でテスト済み) スライドのサイズは固定されており、Latex Beamer ドキュメントのようになっています。

Beampy のプレゼンテーションは、すべてのコンテンツを埋め込んだ単一の html ファイルを出力します。

Beampy テストプレゼンテーションを見る(ソースは examples/beampy_tests_modules.py* にあります)

インストール:

Python パッケージインデックスから:

pip install beampy-slideshow

See full installation documentation

A quick example :

from beampy import *

doc = document()

with slide(): maketitle('Beampy a tool to make simple presentation', ['H. Chauvet'])

with slide('Beampy test'): text(r'\href{#0}{Go to Title}') text(r'Use LaTeX to render text and $$\sqrt{10}$$', align='center')

with slide('Beampy test with animated layers'): text(r'\href{#0}{Go to Title}')[:] text(r'Use LaTeX to render text and $$\sqrt{10}$$', align='center')[1]

save('./simple_one.html')

#To save in pdf just change the above command to the following #save('./simple_one.pdf')

beampy_presentation.html

変更履歴:

0.5.5

(詳細は #18 を参照)、latex の一部が svg に欠落する問題の原因となっていた。

0.5.4

0.5.3

いくつかの小さな修正:

0.5.2

dvisvgm が生成した svg を書き出すオプションを追加)。 ``python

# 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') `

`python

a = rectangle(width='50%', height=10)

b = rectangle(x=a.width+'2cm', y=a.height+5) `

`python

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() `

0.5.1

0.5.0

  • グループを装飾するbox関数を追加
  • コンテキストマネージャを使ってプレゼンテーション内にテキストを書く新しい実験的な方法を追加
`python 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. """ `

0.4.9

0.4.8

0.4.7

レイヤーはBeampyモジュールに対するPythonのスライス操作として管理される。

`python 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') `

0.4.6

`python with group(): text('toto') with group(width=300): text('tata')

with group(width=200): figure('./niceplot.pdf') text('nice legend') `

`python with group(width=200): figure('./niceplot.pdf') text('nice legend') # Figure and text width will be automatically set to 200 px `
  • 相対配置は現在、自動配置された要素にも適用可能です
`python t0 = text('toto') text('tata', x=t0.center + center(0), t0.bottom + 0.1) `

ビデオは現在、htmlファイルに含めるのではなく、外部リンク(embedded=True*付き)を使用できます。 スライドが画面に表示されるときにディスクからビデオが読み込まれます(ファイルパスに注意してください)。

0.4.5

  • すべてのテキストは単一のlatexファイルで前処理されます(Latexは一度だけ呼び出されます:コンパイル時間の改善)
  • キャッシュのバグ修正:ビデオとsvgは正しくキャッシュされるようになりました

0.4.4

  • キャッシュの改善:要素ごとに1ファイルをキャッシュ(キャッシュを二重に書き込まない!)
  • Svg:線と長方形のコマンドを追加し、線や長方形を簡単に描画可能に
  • 相対配置:現在の要素のアンカーを変更するためのショートカット center(shift)、right(shift)、bottom(shift) を追加
`python 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)) ``

0.4.3

Matplotlibの図を直接figure()に渡せるようになり、複数のmatplotlib図をanimatesvg()*でアニメーション化可能に

0.4.2

スライドに生のsvgを含めるためのsvg*コマンドを追加

0.4.1

インストール

Beampyドキュメントのインストールページを参照

--- Tranlated By Open Ai Tx | Last indexed: 2026-06-05 ---