Math & Science ⇒ Chemfig doesn't work
Chemfig doesn't work
Hello everyone. First of all, sorry for my English. It's not my native language, but I guess there are many people like me so it is not a problem, I hope. I'm using Ubuntu 10.10 and LaTeX Version 3.1415926-1.40.10 (TeX Live 2009/Debian). Thus, I have an issue with Chemfig. I have downloaded it from here, unzipped the archieve to /usr/local/share/texmf/ and typed "sudo texhash" in Terminal. Then, I tried to run LaTeX on a file copied from Chemfig documentation (it's code to display a water molecule), but the output is just H instead of something like "H — O — H" as it's shown in documentation. However, no error appeared. I've been googling for all the weekend and now I'm struck. What's the worst thing, I must make some protein formules next week. Hope I chose the right place for my topic and some help will arrive. Otherwise, the overpopulation problem will make a little step to its solution.
P.S. If there is any Chemfig user, it would be awesome if he could post an instruction for adding Chemfig to TeX Live.
P.S. If there is any Chemfig user, it would be awesome if he could post an instruction for adding Chemfig to TeX Live.
Last edited by eXaM on Wed Apr 27, 2011 7:34 pm, edited 1 time in total.
NEW: TikZ book now 40% off at Amazon.com for a short time.

- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Chemfig doesn't work
Provide a minimal example and attach the corresponding log file to your next post by uploading it to the forum server.
Best regards and welcome to the board
Thorsten
Best regards and welcome to the board
Thorsten
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Chemfig doesn't work
I think a minimal example is not needed as my .div file is pretty small. Here is it entirely:
Code: Select all
\documentclass{article}
\usepackage{chemfig}
\begin{document}
\chemfig{H-O-H}
\end{document}
- Attachments
-
- untitled.log
- The log file
- (11.4 KiB) Downloaded 308 times
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Re: Chemfig doesn't work
Either convert the DVI file to PS (and then to PDF) or compile directly with PDFLaTeX. The DVI file format is not good for viewing the resulting output.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Chemfig doesn't work
It worked! Amazing, thank you so much! But what changed? Why does PDFLaTeX work fine when just LaTeX has an issue?
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Chemfig doesn't work
As I already said, the DVI file format is an intermediate format and not for viewing the intended output. Most DVI viewers can't display the code specials used by packages like pgf/tikZ (the graphical back-end of chemfig) correctly.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Chemfig doesn't work
Okay, thanks for the answer. But I have one more question. It's the last one for sure. When I want to make a math formule, I use dvipng with "-bg transparent -T tight" and the output is just formule, with the background cropped. Is it possible to do something like that using ImageMagick? May -fuzz be helpful?
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Re: Chemfig doesn't work
At which point of the process does ImageMagick come into play? Conversion of DVI to PNG? However, I think that this is primarily not a question for this forum.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Re: Chemfig doesn't work
PDF to PNG. All I got after some tries is a picture with transparent background. I agree with you, this question is really not for this forum, but it's not important enough to create a separate topic, so I asked right in this one.
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
Chemfig doesn't work
Appears to me as if this is a job for an image manipulation software like GIMP. It can import PDF and add an alpha channel to PNG for transparency.eXaM wrote:PDF to PNG. All I got after some tries is a picture with transparent background. […]
Actually it's not a topic for LaTeX Community in general, not only for this sub-forum.eXaM wrote:[…] I agree with you, this question is really not for this forum, but it's not important enough to create a separate topic, so I asked right in this one.
How to make a "Minimal Example"
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10