Math & Science ⇒ Chemistry Textbooks and LaTeX
-
- Posts: 402
- Joined: Fri May 20, 2011 9:41 am
Chemistry Textbooks and LaTeX
How can I find LaTeX code or templates such as this textbook or in general any general chemistry highschool/first year textbooks.
Learn LaTeX easily with newest books:
The LaTeX Beginner's Guide: 2nd edition and perfect for students writing a thesis
The LaTeX Cookbook: 2nd edition full of practical examples for mathematics, physics, chemistry, and more
LaTeX Graphics with TikZ: the first book about TikZ for perfect drawings in your LaTeX thesis
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Chemistry Textbooks and LaTeX
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Chemistry Textbooks and LaTeX
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.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.
Regards
-
- Posts: 402
- Joined: Fri May 20, 2011 9:41 am
Re: Chemistry Textbooks and LaTeX
- Attachments
-
- titration.png (17.51 KiB) Viewed 11274 times
Reason: Preferably no external links (see Board Rules). Attachments go onto the forum server where possible.
Chemistry Textbooks and LaTeX
Code: Select all
\documentclass{article}
\usepackage{chemfig}
\usepackage[a4paper]{geometry}
\begin{document}
\setatomsep{2.5em}\setandsign{1pt,1pt}\setarrowoffset{3pt}
\schemestart
5\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}
-
- Posts: 402
- Joined: Fri May 20, 2011 9:41 am
Re: Chemistry Textbooks and LaTeX
Re: Chemistry Textbooks and LaTeX
Could you explain what is wrong for you in my picture and what you expect?
Chemistry Textbooks and LaTeX
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.
Chemistry Textbooks and LaTeX
Please, do not criticize without even compiling and seing the result by yourself!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).
The "off" alignment is just an artefact of the capture. Proof on this zoom:
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?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.
There is no issue in what you said.niteshs wrote:I am hoping that chemfig will take care of these minor alignment issues in the future.
Chemistry Textbooks and LaTeX

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.