## LaTeX forum ⇒ TeXworks ⇒ How to edit this math formula?

Information and discussion about TeXworks, an integrated LaTeX environment for several platforms
yaozhao
Posts: 44
Joined: Sat Oct 27, 2018 10:38 pm

### How to edit this math formula?

$$max U(z) such that \Sigma p_i z_i \leq I$$

There should have 2 improvements.

1st: Between max U(z) and such that should have some whitespace, how to do that?

2nd: I want to add a letter 'z' below max U(z). How to do?

Ijon Tichy
Posts: 91
Joined: Mon Dec 24, 2018 10:12 am
Are you using plainTeX? In LaTeX you should never use the plainTeX displayed math $$…$$ but a LaTeX math environment, e.g., $…$ or align (amsmath/mathtools), e.g.,
\documentclass{article} \usepackage{mathtools} \begin{document}$\max_z{U(z)} \text{ such that } \Sigma p_i z_i \leq I$% Perhaps the \Sigma should be a \sum?\end{document}

See amsldoc.pdf or l2tabu for reasons why not to use $$…$$. See amsldoc.pdf also for handling of limits to \max or \sum or alternative math environments.

BTW: Math & Sience would be the better forum section for such a question, because it is independent from the editor. tI was more or less a accident, that I found this question in the section of an editor I do not use.

yaozhao
Posts: 44
Joined: Sat Oct 27, 2018 10:38 pm
Thank you so much. Instead, I am using TeXworks. So you suggest I should never use $$or$$ $$to edit math? Ijon Tichy Posts: 91 Joined: Mon Dec 24, 2018 10:12 am Once again: TeXworks is only the editor! Mostly it is used to edit LaTeX documents. And in LaTeX documents you should not use $$…. Please, see the links in my previous answer.