Bopytex/opytex/filter.py

32 lines
606 B
Python
Raw Normal View History

#!/usr/bin/env python
# encoding: utf-8
"""
Custom filter for Bopytex
"""
2017-04-16 08:36:27 +00:00
def do_calculus(steps, name="A", sep="=", end="", joining=" \\\\ \n"):
"""Display properly the calculus
2015-02-08 16:04:05 +00:00
Generate this form string:
"name & sep & a_step end joining"
:param steps: list of steps
:returns: latex string ready to be endbeded
2015-04-23 13:48:38 +00:00
"""
2017-04-16 08:36:27 +00:00
ans = joining.join([
name + " & "
+ sep + " & "
+ str(s) + end for s in steps
])
return ans
2017-04-16 08:36:27 +00:00
# -----------------------------
# Reglages pour 'vim'
# vim:set autoindent expandtab tabstop=4 shiftwidth=4:
2017-04-16 08:36:27 +00:00
# cursor: 16 del