LaTeX forum ⇒ TeXworksHow to edit this math formula?

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

How to edit this math formula?

Postby yaozhao » Sat Aug 03, 2019 6:36 am

Code: [Select all] [Expand/Collapse] [Download] ({untitled.tex})
  1. $$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?

Many thanks in advance!

User avatar
Ijon Tichy
Posts: 132
Joined: Mon Dec 24, 2018 10:12 am

Postby Ijon Tichy » Mon Aug 05, 2019 11:42 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.,
Code: [Select all] [Expand/Collapse] [Download] (example-amsmath.tex)
  1. \documentclass{article}
  2.  
  3. \usepackage{mathtools}
  4.  
  5. \begin{document}
  6. \[ \max_z{U(z)} \text{ such that } \Sigma p_i z_i \leq I\]% Perhaps the \Sigma should be a \sum?
  7. \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: 47
Joined: Sat Oct 27, 2018 10:38 pm

Postby yaozhao » Mon Aug 05, 2019 4:49 pm

Thank you so much. Instead, I am using TeXworks. So you suggest I should never use $$ or $$ $$ to edit math?

User avatar
Ijon Tichy
Posts: 132
Joined: Mon Dec 24, 2018 10:12 am

Postby Ijon Tichy » Tue Aug 06, 2019 3:23 pm

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.


Return to “TeXworks”

Who is online

Users browsing this forum: No registered users and 12 guests