LaTeX forum ⇒ Math & ScienceChemistry 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

Postby ghostanime2001 » Wed Jun 27, 2012 8:06 am

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:

User avatar
localghost
Site Moderator
Posts: 9204
Joined: Fri Feb 02, 2007 12:06 pm

Postby localghost » Wed Jun 27, 2012 9:04 am

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
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes


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

User avatar
cgnieder
Site Moderator
Posts: 1988
Joined: Sat Apr 16, 2011 7:27 pm

Postby cgnieder » Wed Jun 27, 2012 9:41 am

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
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim

ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

Postby ghostanime2001 » Mon Aug 06, 2012 7:01 am

A sample picture is attached.
Attachments
titration.png
titration.png (17.51 KiB) Viewed 6994 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

Postby unbonpetit » Tue Aug 07, 2012 12:01 am

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

And the result:
capture1.png

ghostanime2001
Posts: 402
Joined: Fri May 20, 2011 9:41 am

Postby ghostanime2001 » Tue Aug 07, 2012 12:32 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

Postby unbonpetit » Tue Aug 07, 2012 7:38 pm

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

Postby niteshs » Tue Aug 07, 2012 8:22 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

Postby unbonpetit » Tue Aug 07, 2012 9:00 pm

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

Postby niteshs » Tue Aug 07, 2012 10:33 pm

Thanks for clarifying the situation with the double bonds, unbonpetit. :oops:

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.


Return to “Math & Science”

Who is online

Users browsing this forum: No registered users and 3 guests