LaTeX forum ⇒ Math & ScienceSentence in Equation

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
hafizur
Posts: 14
Joined: Sun Nov 22, 2015 11:45 pm

Sentence in Equation

Postby hafizur » Mon Feb 08, 2016 9:25 am

Eq(1)=> Daily average load =No. of units (kWh) generated in a day/24 hours

Eq(2)=> E=mC^2

where E=Energy
m=mass
C= velocity of light

How can I write this above two equations in this template and if length of a sentence is long then what to do?
Last edited by hafizur on Mon Feb 08, 2016 11:23 am, edited 1 time in total.

User avatar
Johannes_B
Site Moderator
Posts: 4104
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Mon Feb 08, 2016 9:35 am

One proposal since i don't understand the question:
  1. \documentclass{article}
  2. \usepackage{mathtools}
  3. \usepackage{array}
  4. \begin{document}
  5. \begin{align}
  6. \mathrm{Daily~average~load~}&=\mathrm{No.~of~units~(kWh)~
  7. generated~in~a~day/24~hours}\\
  8. E&=mC^2
  9. \end{align}
  10. where \begin{tabular}[t]{>{$}l<{$}@{~=~}l}
  11. E&Energy\\
  12. m&mass\\
  13. C& velocity of light
  14. \end{tabular}
  15. \end{document}
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

User avatar
Stefan Kottwitz
Site Admin
Posts: 9522
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Mon Feb 08, 2016 9:38 am

Here is another example showing the use of siunitx. It may look strange here, but in bigger documents it's very useful for consistent scientific units and constants.

  1. \documentclass{article}
  2. \usepackage{mathtools}
  3. \usepackage{siunitx}
  4. \DeclareSIUnit\E{E}
  5. \DeclareSIUnit\c{c}
  6. \begin{document}
  7. \begin{equation}
  8. \text{Daily average load} =
  9. \text{No. of units (\si{\kWh}) generated in a day / 24 hours}
  10. \end{equation}
  11. \begin{equation}
  12. \si{\E} = \si{\m\c\squared}
  13. \end{equation}
  14. \end{document}


For the rest, see Johannes' post.

Stefan
Site admin

hafizur
Posts: 14
Joined: Sun Nov 22, 2015 11:45 pm

Postby hafizur » Mon Feb 08, 2016 9:46 am

Thank you very much... :)

User avatar
Johannes_B
Site Moderator
Posts: 4104
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Mon Feb 08, 2016 9:53 am

Stefan,
i would argue that Energy, mass and speed of light have units to measure them, but are not units themselve. Einsteins formula looks really queer written as SI units.

Another thing i came around a while ago was that using \text isn't always a good idea. If that equation is used in a theorem with italic text, the text in the formula will also be written in italics, which would be inconsistent.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

User avatar
Stefan Kottwitz
Site Admin
Posts: 9522
Joined: Mon Mar 10, 2008 9:44 pm

Postby Stefan Kottwitz » Mon Feb 08, 2016 9:59 am

By the way, you may notice that I wrote constants and units upright. That's what siunitx does, furthermore it takes care of spacing between numbers and units, and more.

Johannes is right, that E and m are variables, but c is a constant, to be written upright, and a mix would look even more strange... so I took the freedom to define them kind of symbolic upshape because we don't really calculate with those variables, or do we ...

640px-Relativity3_Walk_of_Ideas_Berlin.JPG
640px-Relativity3_Walk_of_Ideas_Berlin.JPG (52.71 KiB) Viewed 4961 times


The photo is by Lienhard Schulz - Own work, CC BY 2.5, https://commons.wikimedia.org/w/index.php?curid=795152.

Stefan
Site admin

hafizur
Posts: 14
Joined: Sun Nov 22, 2015 11:45 pm

Postby hafizur » Mon Feb 08, 2016 3:58 pm

  1. where \begin{tabular}[t]{>{$}l<{$}@{~=~}l}
  2. x&Measurement interval (1 hour).
  3. The value of x can be up to 8760 in a year, if the plant operates throughout.
  4. In case the plant has been shut down for some period
  5. in year y, in that year, use the number of measurement
  6. for x for the operational hour only\\
  7. \end{tabular}


Here the description length of x is very long, this text cross the right side border in pdf and no starting in new line after first line. This sentence always in one line. How can I solve this?
Last edited by hafizur on Mon Feb 08, 2016 4:11 pm, edited 1 time in total.

User avatar
Johannes_B
Site Moderator
Posts: 4104
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Mon Feb 08, 2016 4:06 pm

Substitute the final l (ell) when defining the columns with p{.8\linewidth}.

I recommend to read LaTeX for complete novices.

On the other hand, i think that in a sserious paper, the description of what a variable or constant is, belongs into the text. In text, the meaning can be written in clear sentences. A proper list of symbols at the begin or end of a paper with a short description for a quick look-up is the usal way to go.
Having the description glued to the equation is one of the most hideous things i see in academic papers and technical reports.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

hafizur
Posts: 14
Joined: Sun Nov 22, 2015 11:45 pm

Postby hafizur » Mon Feb 08, 2016 4:18 pm

Thank you. :)


Return to “Math & Science”

Who is online

Users browsing this forum: No registered users and 2 guests