Chemical LaTeX Typesetting - Physicsforums Tutorial
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
60 replies · 193K views
Physics news on Phys.org
bomba923
- 759
- 0
GCT said:I think that should do it, it's \varepsilon, unless anyone else has a better method
Hmm--what about an [tex]\xi ^\circ[/tex] ?
Mad_About_Science
- 4
- 0
How could I go about using LaTeX on a word/pdf?
Mad_About_Science
- 4
- 0
[tex]Starch~\xrightarrow{amylase}~C_{12}H_{22}O_{11}[/tex]
Mad_About_Science
- 4
- 0
[tex]Starch~\xrightarrow{amylase}~C_{12}H_{22}O_{11}[/tex]
TriTertButoxy
- 190
- 0
The best fancy 'E' I can come up with is
[tex]\mathcal{E}[/tex]
Also, let me try a few more things
[tex]\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[/tex]
Isn't it better without italicizing the letters?
[tex]\mathcal{E}[/tex]
Also, let me try a few more things
[tex]\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[/tex]
Isn't it better without italicizing the letters?
Mentor
- 29,211
- 4,636
It is, but then - not everone is fluent in LaTeX enough :)
[tex]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}[/tex]
That was exported form one of my programs :)
[tex]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}[/tex]
That was exported form one of my programs :)
Last edited by a moderator:
Mattara
- 347
- 1
[tex]^{14}N~+~^{1}n~\xrightarrow~~^{1}H~+~^{14}C[/tex]
Last edited:
asrafally
- 6
- 0
[tex]V=\frac{k_2[E]_t<s>}{K_M+<s>}</s></s>[/tex]
geoffjb
- 165
- 1
[tex]\in[/tex]bomba923 said:Yes! What is the symbol for it? (the fancy capital E thing)!??
Is it on LaTex??
Is this the one you mean?
freakmagnet19
- 1
- 0
Fancy E
Try this guy:
$\mathcal{E}$
Try this guy:
$\mathcal{E}$
Staff Emeritus
Science Advisor
Gold Member
- 7,213
- 25
Please use this thread ONLY to raise and answer queries related to typsetting tex for chemistry. This thread should not be used as a backdoor to test LaTeX.
https://www.physicsforums.com/showthread.php?p=1165946#post1165946
https://www.physicsforums.com/showthread.php?p=1165946#post1165946
Last edited:
xerxes
- 1
- 0
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.
k1
/________
_________
...k2.../
You know what I mean. I have a reaction going in two directions with a different rate constant in each.
Last edited:
Staff Emeritus
Science Advisor
- 8,145
- 75
You mean like this? [tex]\rightleftharpoons[/tex]
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.
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:
Staff Emeritus
Science Advisor
Gold Member
- 9,621
- 9
Try this;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.
[tex]\mathop{\leftrightharpoons}^{k_1}_{k_2}[/tex]
Code:
\mathop{\leftrightharpoons}^{k_1}_{k_2}
IITian
- 27
- 0
[tex]Bal^2=sqrt{C_{Gordon_10}}[/tex]
Crazy Tosser
- 182
- 0
blah
[tex]dE = dQ-dW[/tex]
[tex]C=\frac{dQ}{MdT}[/tex]
[tex]dQ[/tex]
[tex]dE[/tex]
[tex]dW[/tex]
[tex]M[/tex]
[tex]dT[/tex]
sorry for spam =(
[tex]dE = dQ-dW[/tex]
[tex]C=\frac{dQ}{MdT}[/tex]
[tex]dQ[/tex]
[tex]dE[/tex]
[tex]dW[/tex]
[tex]M[/tex]
[tex]dT[/tex]
sorry for spam =(
Last edited:
Mentor
- 29,211
- 4,636
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
[tex]\forall a, b \in P a < b \Rightarrow ab \in P_2[/tex]
but it looks like something run over by a truck.
My idea was that it shoud be something like
[tex]\forall a, b \in P a < b \Rightarrow ab \in P_2[/tex]
but it looks like something run over by a truck.
Fenn
- 76
- 0
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:
[tex] \text{4f}^{14}\text{6s6p}~^3\text{P}_1[/tex]
As another example, as was previously posted,
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:
[tex] \mathrm{4f^{14} 6s 6p ~ ^3P_1}[/tex]
[tex] \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}[/tex]
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!
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:
[tex] \text{4f}^{14}\text{6s6p}~^3\text{P}_1[/tex]
As another example, as was previously posted,
Borek said:[tex]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}[/tex]
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:
[tex] \mathrm{4f^{14} 6s 6p ~ ^3P_1}[/tex]
[tex] \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}[/tex]
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!
Science Advisor
Homework Helper
Gold Member
- 3,954
- 777
Hmmmm. I'm not quite sure what you are getting at...
Fenn
- 76
- 0
Well, take a look at the actual TeX code for the two examples. To compare, here's the original:
and here's the one I propose
Another advantage is that, should you ever decide that you like italic letters in your formulas, or if you want them bolded or whatever, you can just go edit the \chem definition, and then all instances of that command in your document will take advantage of the global edit.
Code:
10\textrm{K}_{4}\textrm{Fe(CN)}_{6}+122\textrm{KMn O}_{4}+299\textrm{H}_{2}\textrm{SO}_{4}\rightarrow 162\textrm{KHSO}_{4}+5\textrm{Fe}_{2}\textrm{(SO}_ {4}\textrm{)}_{3}+122\textrm{MnSO}_{4}+60\textrm{H NO}_{3}+60\textrm{CO}_{2}+188\textrm{H}_{2}\textrm {O}
and here's the one I propose
Code:
%this should go in your preamble somewhere
\newcommand{\chem}[1]{\ensuremath{\mathrm{#1}}}
%and then later, in your document...
\chem{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}
Another advantage is that, should you ever decide that you like italic letters in your formulas, or if you want them bolded or whatever, you can just go edit the \chem definition, and then all instances of that command in your document will take advantage of the global edit.
Science Advisor
Homework Helper
Gold Member
- 3,954
- 777
OK, I'll bite. Placing "\newcommand{\chem}[1]{\ensuremath{\mathrm{#1}}}" within the tex delimiters...
[tex]\newcommand{\chem}[1]{\ensuremath{\mathrm{#1}}}[/tex]
and entering the string you recommended "\chem{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}"
yields,
[tex]\chem{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}[/tex]
versus just entering the string between tex delimiters...
[tex]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[/tex]
Aside from the spacing between the '+' signs, I see no advantage.
[tex]\newcommand{\chem}[1]{\ensuremath{\mathrm{#1}}}[/tex]
and entering the string you recommended "\chem{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}"
yields,
[tex]\chem{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}[/tex]
versus just entering the string between tex delimiters...
[tex]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[/tex]
Aside from the spacing between the '+' signs, I see no advantage.
Last edited:
Fenn
- 76
- 0
For the scope of this forum, try this:
which should work out to look like
[tex] \newcommand{\chem}[1]{\ensuremath{\mathrm{#1}}}<br /> \chem{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} [/tex]
When you put things in the [tex][/ tex] delimiters here, it looks like it's an isolated environment, and thus any commands you define must be used within that same [tex][/ tex] delimiter. My point here, although it may be a minor one in retrospect, is that I introduce an italic-free typesetting environment for stuff like chemical formulas or spectroscopic notation, which can work independent of an equation block.<br /> <br /> I had assumed this forum was discussing the general application of LaTeX for typesetting chemistry-related stuff. My earlier suggestion of placing the \newcommand{} within the preamble is referring to a LaTeX document, in my case, prepared by MikTeX 2.7.[/tex][/tex]
Code:
(tex)%NOTE: replace ( with [ to use!
\newcommand{\chem}[1]{\ensuremath{\mathrm{#1}}}
\chem{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}
(/tex)
which should work out to look like
[tex] \newcommand{\chem}[1]{\ensuremath{\mathrm{#1}}}<br /> \chem{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} [/tex]
When you put things in the [tex][/ tex] delimiters here, it looks like it's an isolated environment, and thus any commands you define must be used within that same [tex][/ tex] delimiter. My point here, although it may be a minor one in retrospect, is that I introduce an italic-free typesetting environment for stuff like chemical formulas or spectroscopic notation, which can work independent of an equation block.<br /> <br /> I had assumed this forum was discussing the general application of LaTeX for typesetting chemistry-related stuff. My earlier suggestion of placing the \newcommand{} within the preamble is referring to a LaTeX document, in my case, prepared by MikTeX 2.7.[/tex][/tex]
hakimrie
- 1
- 0
lemme try
[tex]6CO_2 + 6H_2O \xrightarrow{\mathit{Light Energy}} C_6 H_{12} O_6 + CO_2, \Delta G^{\circ} = +2870~\mathrm{kJ/mol}[/tex]
[tex]\chem{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}[/tex]
awsome
[tex]6CO_2 + 6H_2O \xrightarrow{\mathit{Light Energy}} C_6 H_{12} O_6 + CO_2, \Delta G^{\circ} = +2870~\mathrm{kJ/mol}[/tex]
[tex]\chem{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}[/tex]
awsome
Last edited:
GorHub
- 1
- 0
Hello,
I was wondering if someone could help me with some latex typeset. I can't find how to do the L- and D- used in chemistry to distinguish the chirality of a compound.
Thanks for your help!
I was wondering if someone could help me with some latex typeset. I can't find how to do the L- and D- used in chemistry to distinguish the chirality of a compound.
Thanks for your help!
icosane
- 48
- 0
Thanks so much for this thread! I just have one question.
How do I get the equilibrium arrows to stay centered when listed on a page?
[tex]NO_2 + CO~ \xrightarrow{k_1}~ NO + NO_3[/tex][tex]NO_3 + CO~ \xrightarrow{k_2}~ NO_2 + CO_2 +XXXX +YYYYYY +ZZZZZZ[/tex]
Can you see how if this was centered on a page the arrows wouldn't be aligned?
How do I get the equilibrium arrows to stay centered when listed on a page?
[tex]NO_2 + CO~ \xrightarrow{k_1}~ NO + NO_3[/tex][tex]NO_3 + CO~ \xrightarrow{k_2}~ NO_2 + CO_2 +XXXX +YYYYYY +ZZZZZZ[/tex]
Can you see how if this was centered on a page the arrows wouldn't be aligned?
Fenn
- 76
- 0
Hi icosane,
Some time ago, I participated in a thread that talked about multi-line equations in LaTeX. You can find it at https://www.physicsforums.com/showthread.php?t=325387.
For your example, try something like:
[tex] \begin{align}\begin{split}<br /> NO_2 + CO~ &\xrightarrow{k_1}~ NO + NO_3\\<br /> NO_3 + CO~ &\xrightarrow{k_2}~ NO_2 + CO_2 +XXXX +YYYYYY +ZZZZZZ<br /> \end{split}\end{align}[/tex]
To show you that the alignment is behaving:
[tex] \begin{align}\begin{split}<br /> NO_2 + CO~ &\xrightarrow{k_1}~ NO + NO_3\\<br /> NO_3 + CO + XXXX + YYYYY + ZZZZZZ~ &\xrightarrow{k_2}~ NO_2 + CO_2 +XXXX +YYYYYY +ZZZZZZ<br /> \end{split}\end{align}[/tex]
Some time ago, I participated in a thread that talked about multi-line equations in LaTeX. You can find it at https://www.physicsforums.com/showthread.php?t=325387.
For your example, try something like:
[tex] \begin{align}\begin{split}<br /> NO_2 + CO~ &\xrightarrow{k_1}~ NO + NO_3\\<br /> NO_3 + CO~ &\xrightarrow{k_2}~ NO_2 + CO_2 +XXXX +YYYYYY +ZZZZZZ<br /> \end{split}\end{align}[/tex]
To show you that the alignment is behaving:
[tex] \begin{align}\begin{split}<br /> NO_2 + CO~ &\xrightarrow{k_1}~ NO + NO_3\\<br /> NO_3 + CO + XXXX + YYYYY + ZZZZZZ~ &\xrightarrow{k_2}~ NO_2 + CO_2 +XXXX +YYYYYY +ZZZZZZ<br /> \end{split}\end{align}[/tex]
jackmell
- 1,806
- 54
I am shocked to see there appears to be no means of illustrating ringed structures since I see none in this thread. I guess I'm just really shocked of this. How can you discuss chemistry with ringed compounds and not have a means of displaying them nicely?
Mentor
- 29,211
- 4,636
jackmell said:I am shocked to see there appears to be no means of illustrating ringed structures since I see none in this thread. I guess I'm just really shocked of this. How can you discuss chemistry with ringed compounds and not have a means of displaying them nicely?
Let's face it - it is not chemical forums, it is PHYSICS forums.
Similar threads
LaTeX Is LaTeX typesetting built into Physics Forums or do I need to download it?
- BenVitale
- · Replies 2 ·
- MATLAB, Maple, Mathematica, LaTeX
- Replies
- 2
LaTeX Introducing LaTeX Math Typesetting
- chroot
- · Replies 766 ·
- MATLAB, Maple, Mathematica, LaTeX
- Replies
- 766