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