コード例 #1
0
ファイル: divide.py プロジェクト: rmmilewi/Prove-It
 def latex(self, **kwargs):
     if self.getStyle('division')=='fraction':
         # only fence if forceFence=True (a fraction within an exponentiation is an example of when fencing should be forced)
         kwargs['fence'] = kwargs['forceFence'] if 'forceFence' in kwargs else False        
         return maybeFencedLatex(r'\frac{'+self.numerator.latex()+'}{'+self.denominator.latex()+'}', **kwargs)
     else:
         return Operation.latex(**kwargs) # normal division
コード例 #2
0
ファイル: qmult.py プロジェクト: PyProveIt/Prove-It
 def latex(self, **kwargs):
     # Turn sub-fence on since the operator is just a space that
     # doesn't serve as a good delimiter of the operands.
     if self.operands.is_single():
         # Single operand: wrap it in square braces to show
         # we are treating it as an operator (a function).
         return r'\left[' + self.operand.latex() + r'\right]'
     kwargs['sub_fence'] = True
     return Operation.latex(self, **kwargs)