Append filters
This commit is contained in:
parent
c3474d4f17
commit
a8a8a0864a
33
opytex/filters.py
Normal file
33
opytex/filters.py
Normal file
@ -0,0 +1,33 @@
|
||||
#!/usr/bin/env python
|
||||
# encoding: utf-8
|
||||
|
||||
"""
|
||||
Custom filter for Bopytex
|
||||
"""
|
||||
|
||||
__all__ = ["do_calculus"]
|
||||
|
||||
def do_calculus(steps, name="A", sep="=", end="", joining=" \\\\ \n"):
|
||||
"""Display properly the calculus
|
||||
|
||||
Generate this form string:
|
||||
"name & sep & a_step end joining"
|
||||
|
||||
:param steps: list of steps
|
||||
:returns: latex string ready to be endbeded
|
||||
|
||||
|
||||
"""
|
||||
|
||||
ans = joining.join([
|
||||
name + " & "
|
||||
+ sep + " & "
|
||||
+ str(s) + end for s in steps
|
||||
])
|
||||
return ans
|
||||
|
||||
|
||||
# -----------------------------
|
||||
# Reglages pour 'vim'
|
||||
# vim:set autoindent expandtab tabstop=4 shiftwidth=4:
|
||||
# cursor: 16 del
|
Loading…
Reference in New Issue
Block a user