## LaTeX forum ⇒ Math & Science ⇒ Chemistry Textbooks and LaTeX

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

### Chemistry Textbooks and LaTeX

There is a textbook called "Exploring Chemical Analysis" from Daniel C. Harris 4th edition and as I was browsing through the textbook, I find it quite interesting how they made their chemical equations so extraordinarly organized. For example for anyone who has this textbook or any other textbook of the like, look at the acids and bases section. It's brilliant.

How can I find LaTeX code or templates such as this textbook or in general any general chemistry highschool/first year textbooks.

Tags:

localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm
I can't recognize any real question here. What are you after? If it's about typesetting chemical structures and reaction schemes, take a look at chemfig and chemmacros.

Thorsten
LaTeX Community Moderator

¹ System: openSUSE 42.2 (Linux 4.4.52), TeX Live 2016 (vanilla), TeXworks 0.6.1

cgnieder
Site Moderator
Posts: 1990
Joined: Sat Apr 16, 2011 7:27 pm
ghostanime2001 wrote:For example for anyone who has this textbook or any other textbook of the like, look at the acids and bases section. It's brilliant.

How can I find LaTeX code or templates such as this textbook or in general any general chemistry highschool/first year textbooks.

I very much doubt that there are ready made LaTeX templates. However, if you showed us a picture of a concrete example I'm sure someone'll be able to help you.

Regards
site moderator & package author

ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am
A sample picture is attached.
Attachments
titration.png (17.51 KiB) Viewed 7295 times
Last edited by localghost on Mon Aug 06, 2012 11:19 am, edited 1 time in total.
Reason: Preferably no external links (see Board Rules). Attachments go onto the forum server where possible.

unbonpetit
Easy to build:
\documentclass{article}\usepackage{chemfig}\usepackage[a4paper]{geometry}\begin{document}\setatomsep{2.5em}\setandsign{1pt,1pt}\setarrowoffset{3pt}\schemestart5\chemname{\chemfig{HO-C(=[2]O)-C(=[2]O)-OH}}{\textbf{Analyte}\\Oxalic acid\\(colorless)}\+\chemname{{\color{cyan}\chemfig{2MnO_4^{-}}}}{\textbf{Titrant}\\Permanganate\\{\color{cyan}Purple}}\+\chemfig{6H^+}\arrow(.mid east--.mid west)\chemname{\chemfig{10CO_2}}{\strut\\\strut\\(colorless)}\+\chemname{\chemfig{2Mn^{2+}}}{\strut\\\strut\\(colorless)}\+\chemfig{8H_2O}\schemestop\end{document}

And the result:
capture1.png

ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am
How can I the "cleanliness" as in the picture in post #4 ? for example, the little space between the double bond and the atom ?

unbonpetit
Sorry, I don't understand.
Could you explain what is wrong for you in my picture and what you expect?

niteshs
Posts: 45
Joined: Wed Jun 06, 2012 9:57 pm
Hello everyone,

My first thought on seeing ghostanime2001's post was "chemfig can do that!". I am not sure what the op means about the 'cleanliness' between the two examples, but I can see a few places where the chemfig output is different:
1. The alignment of the double bonds is somewhat 'off'. While the bonds are actually exactly centered on the atom, this alignment is visually unaesthetic (if I may say so). The double bonds in the textbook example seem slightly to the left but look better (This may be specific to the letter C).
2. The alignment of the positive sign on 6H is not consistent with the negative sign on 2MnO4 (+ appears lower). This not only jarrs with the - sign but also with the top of H.

No doubt these could be manually "improved" (see this post for example), but I am hoping that chemfig will take care of these minor alignment issues in the future.
Last edited by niteshs on Wed Aug 08, 2012 1:04 am, edited 1 time in total.

unbonpetit
niteshs wrote:The alignment of the double bonds is somewhat 'off'. While the bonds are actually exactly centered on the atom, this alignment is visually unaesthetic (if I may say so). The double bonds in the textbook example seem slightly to the left but look better (This may be specific to the letter C).

Please, do not criticize without even compiling and seing the result by yourself!
The "off" alignment is just an artefact of the capture. Proof on this zoom:
capture2.png

niteshs wrote:The alignment of the positive sign on 6H is not consistent with the negative sign on 2MnO4 (+ appears lower). This not only jarrs with the - sign but also with the top of H.

This has nothing to see with chemfig. What you thing "not consistent" is a TeX feature. Could you compare the the placement of the expononent "+" between $O^+$ and $O^+_4$ and see what happens by yourself?
capture3.png

niteshs wrote:I am hoping that chemfig will take care of these minor alignment issues in the future.

There is no issue in what you said.

niteshs
Posts: 45
Joined: Wed Jun 06, 2012 9:57 pm
Thanks for clarifying the situation with the double bonds, unbonpetit.

I am aware that the position of the positive sign is by design. However, I must maintain that it looks better in the "textbook example".

Once again, I understand that everything is as intended by chemfig (hence my quotes around the words: off and improved), and the preference is probably very much in the eye of the beholder as they say.