LaTeX forum ⇒ TeXworksTeXworks, bibtex, and how to do it? Topic is solved

Information and discussion about TeXworks, an integrated LaTeX environment for several platforms
ija
Posts: 3
Joined: Fri Aug 06, 2010 4:42 pm

TeXworks, bibtex, and how to do it?

Postby ija » Fri Aug 06, 2010 4:49 pm

I have a worktext.tex document that refers to a filename.bib file.

  1. \bibliography{filename}


How should I compile to get the references done? I have selected pdfLaTeX+MakeIndex+BibTeX as the typesetting tool, but no bibliography is created. I have several \cite commands within the worktext.tex.

The problem is that, probably, I do not understand how TeXworks is supposed to work. I have used LaTeX and BibTeX a lot, but with Emacs as an editor and with a makefile of my own, but on a Linux computer. Now I have a Windows 7 computer with MikTeX and TeXworks.

So, should I compile the .tex and .bib files separately by some means, or how is TeXworks supposed to be used? I have tried to find this information from a variety of sources, including the very incomplete manual of TeXworks.

I would be really happy to see the answer to this question.
Last edited by cgnieder on Mon Jan 14, 2013 8:22 pm, edited 1 time in total.
Reason: added code markup

Tags:

torbjorn t.
Posts: 162
Joined: Wed Jun 17, 2009 10:18 pm
Location: Norway
Contact:

Postby torbjorn t. » Fri Aug 06, 2010 4:59 pm

Is pdfLaTeX run again, after MakeIndex and BibLaTeX? pdfLaTeX has to be run twice after BibLaTeX, if I'm not mistaken, to get all references and such correct.

ija
Posts: 3
Joined: Fri Aug 06, 2010 4:42 pm

Postby ija » Tue Aug 31, 2010 3:03 pm

I am really puzzled by this. If I was working with Unix/Linux and a normal tex distribution, I would use a command sequence of "bibtex file.bib; latex file.tex; latex file.tex" or sorts.

Now I have deparate tex and bib documents as I had then. How am I supposed to use the compiler command in TeXworks? What I have selected is "pdfLaTeX+MakeIndex+BibTeX", which I run for the file.tex file. Should I separately compile the file.bib? The style of the compiling command makes me think that it should do both the compilations, but it seems not to do it.

This kind of things could well be explained in some help, faq or wiki, but I have not found any which would contain information on this. The only source I have found is a mailing list log that stops short of telling what to do:

http://tug.org/mailman/htdig/texworks/2 ... 01585.html

I'd be very happy to get advice on this.

User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am
Location: Amherst, MA

Postby frabjous » Tue Aug 31, 2010 5:46 pm

It should work just to call the named tools in order. E.g., choose pdflatex from the dropdown list. Click the go button. Then choose makeindex, click go, then choose bibtex, click go, then pdflatex again, etc.

Too much work? Of course it is, but it's worth starting out that way just to be sure the problem isn't with your files.

You can customize the compiler tools with edit > preferences > typesetting. You could, for example, have it call a batch file that called these tools in order (just be sure to include -synctex=1 to make use of texworks forward/reverse search capabilities). Or if you have latexmk installed, you can tell it to use that. (Again, make sure latexmk is configured to call the synctex option.) I'd give details, but I don't use Windows.

However, I'm not quite sure though what would drive a person to switch from linux with emacs to Windows with TeXworks. Isn't that sort of like switching from a swiss army knife to a plastic butterknife? You know, you can run emacs on Windows too (if you must!)

ija
Posts: 3
Joined: Fri Aug 06, 2010 4:42 pm

Postby ija » Wed Sep 01, 2010 9:04 am

About moving from Linux to Windows, I agree. I just happen to have the computer of my employer with all the windows stuff, and I do not have the time to arrange for installation of Linux there myself (make room, arrange for backups, etc.). I would prefer using Linux, however.

Still, back to TeXworks: one more question: should the Bibtex command be selected with the file2.bib or file1.tex as the active window?

josephwright
Site Moderator
Posts: 814
Joined: Tue Jul 01, 2008 2:19 pm
Contact:

Postby josephwright » Wed Sep 01, 2010 9:11 am

The .tex file. BibTeX runs on the .aux file, and TeXworks find the name by taking 'file1.tex', and altering the extension to 'file1.aux'. You'd do the same at the command line:
  1. pdflatex file1.tex
  2. bibtex file1.aux
  3. pdflatex file1.tex
  4. pdflatex file1.tex
Joseph Wright

isci1
Posts: 1
Joined: Sun Oct 02, 2011 8:07 pm

Postby isci1 » Sun Oct 02, 2011 8:15 pm

isci1: I have just resolved the problem after many trials. You have to run DVI->PDF as well.

rapidadverbssuck
Posts: 1
Joined: Thu Nov 10, 2011 1:29 am

Postby rapidadverbssuck » Thu Nov 10, 2011 1:31 am

isci1 wrote:isci1: I have just resolved the problem after many trials. You have to run DVI->PDF as well.


I am having the same problem, wherein running pdfLaTex+MakeIndex+BibTex is failing to produce a bibliography. How is the above "run DVI->PDF" done, and is there a way to automate it so that it happens every time I compile?

Thanks in advance.

olec
Posts: 1
Joined: Sun Dec 18, 2011 2:41 pm

Postby olec » Sun Dec 18, 2011 3:57 pm

Couldn't really tell you whats wrong, because it works for me. Using MiKTeX 2.9 on Win XP. But I did some faults before it worked right:

First fault was that I had errors in my .bib file, but this hard to notice with all the console messages from pdfLaTeX. And BibTeX didnt produce anything as long as there were errors present. I ran BibTeX separately and corrected the errors.

Second fault is that I had used \ref{} instead of \cite{} for some references.

After correcting for these two faults, I ran the pdfLaTeX + MakeIndex + BibTeX twice and the references showed up. Maybe this helps?
Last edited by cgnieder on Mon Jan 14, 2013 8:23 pm, edited 1 time in total.
Reason: added code markup

skumar
Posts: 2
Joined: Mon Jan 14, 2013 5:09 pm

Postby skumar » Mon Jan 14, 2013 5:20 pm

Has anyone found a solution to this problem? I have similar issue. Bibtex on Texworks not working with \bibliography{XX.bib}. It works only if I add bibitems in the main tex file. It creates a .bbl file, but no references on the pdf file. Previous post mentioned the need of doing DVI->PDF. Not sure how to do this. I am using windows 7. Please help.
Last edited by cgnieder on Mon Jan 14, 2013 8:24 pm, edited 1 time in total.
Reason: added code markup


Return to “TeXworks”

Who is online

Users browsing this forum: No registered users and 1 guest