# 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")
```

Please start posting anonymously - your entry will be published after you log in or create a new account.

Asked: ** 2019-09-20 19:26:32 +0200 **

Seen: **174 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.