Ask Your Question
1

Latex typesetting conditional

asked 2019-09-20 19:26:32 +0100

Cyrille gravatar image

updated 2019-11-25 14:14:18 +0100

How can I type set :

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

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
1

answered 2019-09-20 20:55:43 +0100

tmonteil gravatar image

updated 2019-09-20 20:55:54 +0100

The following works on my computer:

x = -1
if x > 0:
    show(LatexExpr('H>0'))
else:
    show(LatexExpr('H\leq 0'))
edit flag offensive delete link more
1

answered 2019-09-21 00:17:34 +0100

Emmanuel Charpentier gravatar image

Alternate solution:

LatexExpr("H>0" if H>0 else "H<=0")
edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

1 follower

Stats

Asked: 2019-09-20 19:26:32 +0100

Seen: 205 times

Last updated: Nov 25 '19