LaTeX Chemical LaTeX Typesetting - Physicsforums Tutorial

  • Thread starter Thread starter Monique
  • Start date Start date
  • Tags Tags
    Chemical Latex
AI Thread Summary
Physics Forums has introduced a new LaTeX feature that allows users to typeset complex formulas and equations clearly and accurately. This enhancement significantly improves the clarity of scientific communication, moving away from less precise text representations. Users can now create equations with subscripts, superscripts, and various symbols, which were previously cumbersome to format. The discussion includes examples of chemical equations and mathematical formulas, demonstrating the ease of use and flexibility of LaTeX. Participants share tips on formatting, including the use of specific commands for better readability and aesthetics. There are also inquiries about advanced symbols and formatting techniques, indicating a collaborative effort to master LaTeX for chemistry and physics applications. Overall, the new feature is well-received, with users encouraged to explore and practice their typesetting skills.
Monique
Staff Emeritus
Science Advisor
Gold Member
Messages
4,211
Reaction score
68
Physicsforums now has a very cool feature, which enables complex typesetting for formulas or equations!

A tutorial is on the following page:
https://www.physicsforums.com/misc/howtolatex.pdf
The topic is also explained in the following thread:
https://www.physicsforums.com/showthread.php?s=&threadid=8997


The feature is LaTeX and the following is possible::

^{33}_{17}Cl^{16}\xrightarrow{n,n}~^{31}_{15}P^{16}+~^4_2He^2

Not long ago we had to write::
33 (1) 31 4
17 Cl + 2(0)n -----> 15 P + 2 He

Causing much confusion as you can imagine
So play around with some formulas if you like, click on the LaTeX image to popup the code with which it was written.


To explain the basics:
_ is subscript
^ is superscript
{} are delimiters, to keep text together
~ is a space


So the code in the above formula is::
[ tex]^{33}_{17}Cl^{16}\xrightarrow{n,n}~^{31}_{15}P^{16}+~^4_2He^2[ /tex]
 
Last edited:
Physics news on Phys.org
Henderson-Hasselbalch equation:

pH=pK_a+log\frac{[A^-]}{[HA]}
 
Last edited:
Michaelis-Menten equation

V=\frac{k_2[E]_t<s>}{K_M+<s>}</s></s>


or


6CO_2+6H_2O\xrightarrow{Light~Energy}C_6H_{12}O_6+CO_2~~~\Delta G^\circ=+2870kJ/mol


If I can do it, anyone can! :wink:
 
Last edited:
Ambitwistor is not such a simple soul as me :wink:

I actually noticed that I am putting in too many spacers (~), those are not always necessary next to '+' or '\xrightarrow' or '='
 
Enthalpy of Vaporization
The amount of energy to change 1 g of liquid to gas at its boiling point. For water,

\Delta H_{vap} = 540~cal~g^{-1}
 
Last edited by a moderator:
OK, exams are over so I have no reason to not learn this stuff now... here I go.

Moniques version...
^{33}_{17}{Cl}^{16} \xrightarrow{n,n} ^{31}_{15}P^{16} +~^4_2He^2

Ambitwistors version...
<br /> \newcommand{\atom} [ 4 ] { ^{#1}_{#2} {#3}^{#4}}<br /> \atom {33}{17}{Cl}{16} \xrightarrow{n,n} \atom {31}{15}{P}{16}+\atom {4}{2}{He}{2}<br />
 
Last edited:
{pH} = {pK_a} + \log\frac{[A^-]}{[HA]} \\<br /> <br /> V = \frac{k_2{[E]}+{<s>}}{K_m + {<s>}} \\<br /> <br /> <br /> 6CO_2 + 6H_2O \xrightarrow{Light Energy} C_6H_{12}O_6 + CO_2 \ \delta G^{\circ} = +2870kJ/mol<br /> <br /> <br /> </s></s>
Oh, ok, so \\ can only be used as part of an equation to start a new line. To do different equations, you have to use diferent tex flags i guess...?

And why didn't my C6H12) finish...


{pH} = {pK_a} + \log\frac{[A^-]}{[HA]}

V = \frac{k_2{[E]}_t{<s>}}{K_M + {<s>}}</s></s>


Now, will this come up as I want it to? 6CO_2 + 6H_2O \xrightarrow{Light Energy} C_6 H_{12} O_6 + CO_2 \delta G^{\circ} = +2870kJ/mol Let's find out...
 
Last edited:
wow, capitals matter.

that should have been \Delta not \delta.

So

6CO_2 + 6H_2O \xrightarrow{Light Energy} C_6 H_{12} O_6 + CO_2 ~\Delta G^{\circ} = +2870kJ/mol
 
that \ thing never does what I want...6CO_2 + 6H_2O \xrightarrow{Light\Energy} C_6 H_{12} O_6 + CO_2 ~\Delta \ \ \ \G^{\circ} = +2870kJ/mol

Maybe I should use that comma? 6CO_2 + 6H_2O \xrightarrow{Light/,Energy} C_6 H_{12} O_6 + CO_2 ~\Delta /, /, /, G^{\circ} = +2870kJ/mol

6CO_2 + 6H_2O \xrightarrow{Light\,Energy} C_6 H_{12} O_6 + CO_2 ~\Delta \, \, \, G^{\circ} = +2870kJ/mol
I think i prefer the tilde (~) key...6CO_2 + 6H_2O \xrightarrow{Light~Energy} C_6 H_{12} O_6 + CO_2 ~\Delta~~~G^{\circ} = +2870kJ/mol
 
Last edited:
  • #10
You are using itex, that stands for inline?

tex
^{33}_{17}{Cl}^{16} \xrightarrow{n,n} ^{31}_{15}P^{16} +~^4_2He^2

inline
\inline{^{33}_{17}{Cl}^{16} \xrightarrow{n,n} ^{31}_{15}P^{16} +~^4_2He^2}

itex
^{33}_{17}{Cl}^{16} \xrightarrow{n,n} ^{31}_{15}P^{16} +~^4_2He^2

Apparently :) that's cool!
 
  • #11
It would be nice if it did fit inline a little better though. At the moment it sits a little low and disrupts the line below, so it doesn't look quite as neat.
 
  • #12
I stand~corrected. I guess it depends on the physical size of the formula and stuff. It does a good job of fitting it where it can.
 
  • #13
Could you give some information about how to use this typeset in another place?
 
  • #14
If you mean how to use it outside of PF, you need to download a program such as miktex (www.miktex.org).
 
  • #15
Thanks for the link,Sirus.Maybe i'll get read of the old Scientific Workplace that I'm using now.
 
  • #16
For small applications, you can preview a post on PF with the required code in it, then copy and paste the latex into MS Word or another word processing application. This is discouraged, however, to avoid excess traffic on the PF server (copy/pasting Latex is not, after all, the purpose of PF).
 
  • #17
Trying it out,

H^+ _{(aq)} + OH^- _{(aq)} \xrightarrow~H_2 O _{(l)}
 
Last edited:
  • #18
I should be studying,

1/p + 1/q = 1/f
 
  • #19
this is killing me

{\Delta G} = {\Delta G^_o} - RT\textit{lnQ}

from my current physics course
lens maker's equation
\frac{n_1}{p} + \frac{n_2}{q} = (n_1-1) \left[ \frac{1}{R_1} - \frac{1}{R_2} \right]

I'll just do my homework here
\int ( \textit{lnt} )^2 dt

u= ( \textit{lnt} )^2
du=2( \textit{lnt} )( \frac{1}{t} )
dv= dt
v= \int dt = t

\int ( \textit{lnt} )^2 dt = ( \textit{lnt} )^2t - \int 2t( \textit{lnt} )( \frac{1}{t} )
 
Last edited:
  • #20
Anyone (ambitwistor ?) know the symbol for the equilibrium (upper half of right arrow above lower half of left arrow) sign ?
 
  • #21
just trying things out
\xrightarrow{\leftarrow}

I noticed Monique's first post where she had the n,n over the arrow and figured one could go on from there.

\xrightarrow{\xleftarrow}
 
Last edited:
  • #22
Clever ! That'll have to do until I think it's important to hunt this down or someone comes up with a better answer.
 
  • #23
If you have already found this, forgive me, but the solution is \rightleftharpoons or \leftrightharpoons as in the following examples:

H_2O \rightleftharpoons H^+ + OH^-

H_2O \leftrightharpoons H^+ + OH^-
 
Last edited:
  • #24
Thanks chem_tr ! :approve:
 
  • #25
Another God said:
that \ thing never does what I want...6CO_2 + 6H_2O \xrightarrow{Light\Energy} C_6 H_{12} O_6 + CO_2 ~\Delta \ \ \ \G^{\circ} = +2870kJ/mol

Maybe I should use that comma? 6CO_2 + 6H_2O \xrightarrow{Light/,Energy} C_6 H_{12} O_6 + CO_2 ~\Delta /, /, /, G^{\circ} = +2870kJ/mol

6CO_2 + 6H_2O \xrightarrow{Light\,Energy} C_6 H_{12} O_6 + CO_2 ~\Delta \, \, \, G^{\circ} = +2870kJ/mol
I think i prefer the tilde (~) key...6CO_2 + 6H_2O \xrightarrow{Light~Energy} C_6 H_{12} O_6 + CO_2 ~\Delta~~~G^{\circ} = +2870kJ/mol
lol guys, the photosynthesis equation everyone's using is incorrect ;)
 
  • #26
F = \frac {1}{4\pi\epsilon_0}\frac{Q_1Q_2}{r^2}
E_p = \frac {Q_1Q_2}{4\pi\epsilon_0(r_1+r_2)}

E_p = \frac {e^2}{4\pi\epsilon_0(2r_0)}

Q = EV \\

Q = eV \\

E_p = \frac {e}{4\pi\epsilon_0(2r_0)} electron volts<br />

E_k = \frac{3}{2}kT
\gamma \equiv \frac{1}{\sqrt{1 - v^2/c^2}}
 
Last edited:
  • #27
Does anybody know the fancy "capital E" symbol denoting reduction potentials?

I mean, it doesn't seem to be in LaTex---or is it? Where can I get it?

Edit: Is it by any chance a lowercase "xi" ?
That is, a \xi ^\circ ??
 
Last edited:
  • #28
are you referring to emf?
 
  • #29
Yes! What is the symbol for it? (the fancy capital E thing)!??

Is it on LaTex??
 
Last edited:
  • #30
I've seen it here somewhere. You may want to somehow italicize the E within the latex.

just trying things out...

\varepsilon
 
Last edited:
  • #31
I think that should do it, it's \varepsilon, unless anyone else has a better method
 
  • #32
GCT said:
I think that should do it, it's \varepsilon, unless anyone else has a better method

Hmm--what about an \xi ^\circ ?
 
  • #33
I think that most people will undestand that as the standard reduction potential, nevertheless I think that there's a better way to represent it though.
 
  • #34
How could I go about using LaTeX on a word/pdf?
 
  • #35
Starch~\xrightarrow{amylase}~C_{12}H_{22}O_{11}
 
  • #36
Starch~\xrightarrow{amylase}~C_{12}H_{22}O_{11}
 
  • #37
The best fancy 'E' I can come up with is
\mathcal{E}
Also, let me try a few more things
\text{C}_6\text{H}_{12}\text{O}_6\, +\, 6\text{ O}_2\, \xrightarrow{\text{heat}}\, 6\text{ H}_2\text{O}\, + \,6\text{ CO}_2
Isn't it better without italicizing the letters?
 
  • #38
It is, but then - not everone is fluent in LaTeX enough :)

10\textrm{K}_{4}\textrm{Fe(CN)}_{6}+122\textrm{KMnO}_{4}+299\textrm{H}_{2}\textrm{SO}_{4}\rightarrow162\textrm{KHSO}_{4}+5\textrm{Fe}_{2}\textrm{(SO}_{4}\textrm{)}_{3}+122\textrm{MnSO}_{4}+60\textrm{HNO}_{3}+60\textrm{CO}_{2}+188\textrm{H}_{2}\textrm{O}

That was exported form one of my programs :)
 
Last edited by a moderator:
  • #39
^{14}N~+~^{1}n~\xrightarrow~~^{1}H~+~^{14}C
 
Last edited:
  • #40
V=\frac{k_2[E]_t<s>}{K_M+<s>}</s></s>
 
  • #41
bomba923 said:
Yes! What is the symbol for it? (the fancy capital E thing)!??

Is it on LaTex??
\in

Is this the one you mean?
 
  • #42
Fancy E

Try this guy:

$\mathcal{E}$
 
  • #44
Does anyone know how to do a left-right harpoon with labels above and below, I guess like

k1
/________
_________
...k2.../

You know what I mean. I have a reaction going in two directions with a different rate constant in each.
 
Last edited:
  • #45
You mean like this? \rightleftharpoons

edit: i just saw you want labels above and below.. sorry, don't know how to do that!

Well, i found something that may help you: ftp://ctan.tug.org/tex-archive/info/symbols/comprehensive/symbols-a4.pdf[/URL] page 41.. although it doesn't work on here since I imagine you need some package.
 
Last edited by a moderator:
  • #46
xerxes said:
Does anyone know how to do a left-right harpoon with labels above and below, I guess like

k1
/________
_________
...k2.../

You know what I mean. I have a reaction going in two directions with a different rate constant in each.
Try this;

\mathop{\leftrightharpoons}^{k_1}_{k_2}

Code:
\mathop{\leftrightharpoons}^{k_1}_{k_2}
 
  • #47
Bal^2=sqrt{C_{Gordon_10}}
 
  • #48
blah

dE = dQ-dW

C=\frac{dQ}{MdT}

dQ
dE
dW
M
dT

sorry for spam =(
 
Last edited:
  • #49
I have not used these symbols for ages, not to mention in LaTeX. How should I properly format statement "for each a and b belonging to set P if a<b then ab belongs to set P2"?

My idea was that it shoud be something like

\forall a, b \in P a &lt; b \Rightarrow ab \in P_2

but it looks like something run over by a truck.
 
  • #50
First post, and it's about LaTeX! I've been working with LaTeX for some time now, and recently started getting serious about typesetting spectroscopic notation. I actually started this post asking a question, but while developing the post, I came across an acceptable answer. As such, the tone of this post will change from question to tip.

I have been trying to typeset any general chemical equation or spectroscopic configuration notation without italics. I have known of the \text{} command, and recently found the \textrm{} command, but both of these complain when there are superscripts, subscripts, or Greek characters within the {} delimiters.

As is shown in this thread, you can easily get away with carefully placing the delimiters and \text{} commands. For example, I want to write the following configuration information:

<br /> \text{4f}^{14}\text{6s6p}~^3\text{P}_1<br />

As another example, as was previously posted,
Borek said:
10\textrm{K}_{4}\textrm{Fe(CN)}_{6}+122\textrm{KMnO}_{4}+299\textrm{H}_{2}\textrm{SO}_{4}\rightarrow162\textrm{KHSO}_{4}+5\textrm{Fe}_{2}\textrm{(SO}_{4}\textrm{)}_{3}+122\textrm{MnSO}_{4}+60\textrm{HNO}_{3}+60\textrm{CO}_{2}+188\textrm{H}_{2}\textrm{O}

My problem: Although this works, it is quite messy to read for arbitrarily complex expressions. Further, I have to manually ensure this content is in math mode, which can be a pain when applying it to an arbitrary location.

My solution: Use the \mathrm{} command! Here's the same examples, cleaned up a bit using this new command:

<br /> \mathrm{4f^{14} 6s 6p ~ ^3P_1}<br />

<br /> \mathrm{10 K_4 Fe (CN)_6 + 122 K MnO_4 + 299 H_2 SO_4 \rightarrow 162 K H SO_4 + 5 Fe_2 (SO_4)_3 + 122 Mn SO_4 + 60 H NO_3 + 60 CO_2 + 188 H_2 O}<br />

Even better, define a new command which enforces math mode, as well as this Roman font. something like

\newcommand{\chem}[1]{\ensuremath{\mathrm{#1}}}

and then you can just simply type \chem{H_2 SO_4} wherever you want, both inside or outside of math mode. With proper use of whitespace, the LaTeX markup looks more elegant and easy to read/diagnose in my opinion.

Hope this helps! It definitely helps me!
 

Similar threads

Replies
3
Views
2K
Replies
4
Views
4K
Replies
2
Views
6K
Replies
766
Views
737K
Replies
7
Views
3K
Replies
1
Views
4K
Replies
6
Views
4K
Back
Top