I am writing my Master thesis in Latex (Texstudio). I need to draw a lot of molecules and want to number them throughout the whole thesis. For some strange reason, the package chemnum isn't working. The commands are highlighted in red when I compile the file and the output isn't the right one.

enter image description here

I really need that package. I have even checked the chemnum.cwl in the autocompletion list in the settings to get recognized in every document but that doesn't help either.

\documentclass[12 pt,a4 paper,oneside,openright,titlepage]{book}
%\usepackage{mathptmx} se vuoi usare times new roman

The first-line therapy for drug-susceptible TB consists in two months of isoniazid \refcmpd{isoniazid}, rifampicin \refcmpd{rifampicin}, pyrazinamide \refcmpd{pyrazinamide} , and ethambutol \refcmpd{ethambutol} following with four months of rifampicin and isoniazid (2HRZE/4HR).(figure \ref{first-line})
    \caption{First-line drugs}

Link to the eps file https://www.dropbox.com/s/ordl0cjj2z004h4/first-line-treatment.eps?dl=0

Output of the figure 1.1 enter image description here

  • Welcome to TeX.SE! Have you installed chemnum correctly (i.e. you can use it in other document)? Does it throw an error when you load it without using it? Have you loaded chemnum in your preamble? – user156344 Mar 24 at 16:41
  • 1
    Does it throw errors like "chemnum.sty not found"? – user156344 Mar 24 at 16:43
  • 2
    it is impossible to debug a screenshot, please show a small test file and show the exact error message that you get in the log file. – David Carlisle Mar 24 at 17:20
  • 1
    @Sebastiano crepi – Vittoria Nanna Mar 25 at 10:36
  • 1
    Vittoria Thanks for file & update that allows us to do a test run as if on your setup. I confirm that having placed eps in the same folder as the mwe & removing the folder/name It runs well. That is on first pass there are ?? but change on second pass to read as 1 2 3 4 the unresolved item is the last one \cite but thats understandable with just a snippet So If you have that part working the remaining issue is 1st Are you getting TWO successful runs so as to resolve cross-refs. Subfolders can interfere with processing refs (that is why to avoid). Try with eps bib & tex in fresh folder (NO aux) – user170109 Mar 25 at 12:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.