Esempio n. 1
0
 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
Esempio n. 2
0
 def latex(self, **kwargs):
     # 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)
Esempio n. 3
0
 def latex(self, **kwargs):
     return maybeFencedLatex('-' + self.operand.latex(fence=True), **kwargs)