# Latex typesetting conditional

How can I type set :

If x est positive write in Latex "H>0" else "H<=0"

add a comment

Latex typesetting conditional

How can I type set :

If x est positive write in Latex "H>0" else "H<=0"

add a comment

1

The following works on my computer:

```
x = -1
if x > 0:
show(LatexExpr('H>0'))
else:
show(LatexExpr('H\leq 0'))
```

1

Alternate solution:

```
LatexExpr("H>0" if H>0 else "H<=0")
```

Asked: **
2019-09-20 12:26:32 -0500
**

Seen: **75 times**

Last updated: **Nov 25 '19**

Copyright Sage, 2010. Some rights reserved under creative commons license. Content on this site is licensed under a Creative Commons Attribution Share Alike 3.0 license.