Math & ScienceChemfig doesn't work

Information and discussion about LaTeX's math and science related features (e.g. formulas, graphs).
Post Reply
eXaM
Posts: 5
Joined: Sun Apr 24, 2011 7:48 pm

Chemfig doesn't work

Post by eXaM »

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.
Last edited by eXaM on Wed Apr 27, 2011 7:34 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

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

Post by localghost »

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
eXaM
Posts: 5
Joined: Sun Apr 24, 2011 7:48 pm

Chemfig doesn't work

Post by eXaM »

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
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: Chemfig doesn't work

Post by localghost »

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.
eXaM
Posts: 5
Joined: Sun Apr 24, 2011 7:48 pm

Re: Chemfig doesn't work

Post by eXaM »

It worked! Amazing, thank you so much! But what changed? Why does PDFLaTeX work fine when just LaTeX has an issue?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Chemfig doesn't work

Post by localghost »

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.
eXaM
Posts: 5
Joined: Sun Apr 24, 2011 7:48 pm

Re: Chemfig doesn't work

Post by eXaM »

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?
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Re: Chemfig doesn't work

Post by localghost »

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.
eXaM
Posts: 5
Joined: Sun Apr 24, 2011 7:48 pm

Re: Chemfig doesn't work

Post by eXaM »

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.
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

Chemfig doesn't work

Post by localghost »

eXaM wrote:PDF to PNG. All I got after some tries is a picture with transparent background. […]
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:[…] 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.
Actually it's not a topic for LaTeX Community in general, not only for this sub-forum.
Post Reply