Math & Science ⇒ Formula Conditional
Formula Conditional
Sorry everyone, but I tried to search many sites but no result. I want to write equation like the attached one.
Thanks so much
Thanks so much
- Attachments
-
- formula-conditional-01.jpg (9.64 KiB) Viewed 29148 times
-
- formula-conditional-02.jpg (14.75 KiB) Viewed 29148 times
Last edited by localghost on Tue Jan 22, 2013 9:05 pm, edited 1 time in total.
Reason: Preferably no external links (see Board Rules). Attachments go onto the forum server where possible.
Reason: Preferably no external links (see Board Rules). Attachments go onto the forum server where possible.
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Formula Conditional
The first equation is nothing special and can be typeset as usual in an
Best regards and welcome to the board
Thorsten
{equation}
environment. The second one would need the empheq package for the brace on the left side.Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Formula Conditional
Many thanks for your help, you are very kind to me. But I still can't solve my problem.
I used {equation} environment like this:
And the result is displayed as formula (3.1)
The second one need the empheq package but I dont know how to install additional package in LateX, I searched in wiki, but I dont understand.
Moreover, I'm using LateX in windows7, when I want to extract file to .pdf, I must write text in .txt document, then I type "platex filename.txt", then "dvipdfmx filename.dvi" in C command. This is so difficult to check .pdf file before they become finished.
Please help me, thank you!
I used {equation} environment like this:
Code: Select all
\begin{equation}
Th(flow1) = Th(flow2) = G, if G < \frac{B}{3}
\end{equation}
The second one need the empheq package but I dont know how to install additional package in LateX, I searched in wiki, but I dont understand.
Moreover, I'm using LateX in windows7, when I want to extract file to .pdf, I must write text in .txt document, then I type "platex filename.txt", then "dvipdfmx filename.dvi" in C command. This is so difficult to check .pdf file before they become finished.
Please help me, thank you!
- Attachments
-
- formula1.jpg (9.46 KiB) Viewed 29123 times
Last edited by Stefan Kottwitz on Mon Jan 28, 2013 1:53 pm, edited 1 time in total.
Formula Conditional
If you have pieces of text in an equation you should use amsmath's
(I don't actually know if »flow1« and »flow2« should be text here. They looked like it...)
Regards
\text{}
macro to mark them correspondingly:Code: Select all
% preamble:
% \usepackage{amsmath}
\begin{equation}
Th(\text{flow1}) = Th(\text{flow2}) = G, \text{ if } G < \frac{B}{3}
\end{equation}
Regards
site moderator & package author
- Stefan Kottwitz
- Site Admin
- Posts: 10345
- Joined: Mon Mar 10, 2008 9:44 pm
Formula Conditional
I guess at least the
A personal opinion first, I would write Th and flow1 in upright letters, since italic letters are used for variables, operators and text commonly upright. Definign a macro or an operator would be convenient. So my text would be
The brace before the equation could be done without
Stefan
amsmath
package is installed on your computer, since this is standard for good math typesetting.A personal opinion first, I would write Th and flow1 in upright letters, since italic letters are used for variables, operators and text commonly upright. Definign a macro or an operator would be convenient. So my text would be
Code: Select all
\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator{\Th}{Th}
\DeclareMathOperator{\flow}{flow}
\begin{document}
\begin{equation}
\Th(\flow_1) = \Th(\flow_2) = G, \text{ if } G < \frac{B}{3}
\end{equation}
\end{document}
empheq
, with \left\{
and \right.
and an aligned
environment (of amsmath
):Code: Select all
\documentclass{article}
\usepackage{amsmath}
\DeclareMathOperator{\Th}{Th}
\DeclareMathOperator{\flow}{flow}
\begin{document}
\begin{equation}
\left\{
\begin{aligned}
\Th(\flow_1) &= G \\
\Th(\flow_2) &= \ldots
\end{aligned}
\right.
\end{equation}
\end{document}
LaTeX.org admin
Formula Conditional
Thank you very much for your help, I solved my problem.
First opinion, I know the
The result is shown as attached formula (3.1)
Second opinion, special thanks to Stefan_K for teaching me
The result is shown as the attached formula (3.2)
Moreover, my PC can't run this command
First opinion, I know the
{equation}
environment but the most thing I want here is the space between , and if. This is my code:
Code: Select all
\begin{equation}
Th(\text{flow1}) = Th(\text{flow2}) = G, \:\:\:\:\:\:\:\text{if} \:\:\:G < \frac{B}{3}
\end{equation}
Second opinion, special thanks to Stefan_K for teaching me
aligned
environment. Here is my code:
Code: Select all
\begin{equation}
\left\{
\begin{aligned}
Th(\text{flow1}) &= G \\
Th(\text{flow2}) &= \dfrac{B-G}{2}
\end{aligned}
\right.
\:\:\:\:\:\text{if} \:\:\:\dfrac{B}{3} \leq G < B_1 - B_2
\end{equation}
Moreover, my PC can't run this command
\DeclareMathOperator
but it's ok 
- Attachments
-
- formula2.jpg (13.34 KiB) Viewed 29111 times
-
- formula1.jpg (9.21 KiB) Viewed 29111 times
Last edited by localghost on Tue Jan 29, 2013 10:48 am, edited 1 time in total.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Formula Conditional
This is a bit fuzzy. Therefore some questions.ArataFan wrote:[…] The second one need the empheq package but I dont know how to install additional package in LateX, I searched in wiki, but I dont understand. […]
- What did you try to install the package? Package installation is usually by the package manager of your TeX distribution. What exactly does not work?
- Which wiki do you mean? A TeX distribution usually has a manual where its handling is explained. What exactly did you not understand?
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Formula Conditional
First, I downloaded full .dtx file in this site: http://ctan.org/tex-archive/macros/latex/contrib/mh
Then, I read how to install .dtx package in this site: http://en.wikibooks.org/wiki/LaTeX/Inst ... a_Packages
I couldn't install, so when I type
Last, I type "platex fiename.txt" in C command, and this is the result:
Then, I read how to install .dtx package in this site: http://en.wikibooks.org/wiki/LaTeX/Inst ... a_Packages
I couldn't install, so when I type
Code: Select all
\documentclass{article}
\usepackage{empheq}
\begin{document}
\begin{equation}
Th(flow1) = Th(flow2) = G, \text{ if } G < \frac{B}{3}
\end{equation}
\end{document}
LaTeX Error: File 'empheq.sty' not found.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Formula Conditional
So I ask once again: Why don't you just use the package manager of your TeX distribution to install packages?ArataFan wrote:First, I downloaded full .dtx file in this site: http://ctan.org/tex-archive/macros/latex/contrib/mh
Then, I read how to install .dtx package in this site: http://en.wikibooks.org/wiki/LaTeX/Inst ... a_Packages
I couldn't install […]
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Formula Conditional
Sorry, I don't know how to use the package manager of TeX, this is the most important thing I want to tell. Can you teach me how to use this one?localghost wrote: So I ask once again: Why don't you just use the package manager of your TeX distribution to install packages?