LyXpdf conversion advice for multiple .tex files

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
boardtc
Posts: 4
Joined: Wed Mar 03, 2010 5:48 pm

pdf conversion advice for multiple .tex files

Post by boardtc »

I have source code do output using doxygen as 94 .tex files, a latex .sty file and a makefile. I want to convert these into a pdf. I was hoping I could sue Lyx, After installation it seems I can only import 1 .tex file ata time. I there an easy way I can convert all these .text files into a pdf using Lyx?

thanks, tom.

Recommended reading 2024:

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

NEW: TikZ book now 40% off at Amazon.com for a short time.

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

Re: pdf conversion advice for multiple .tex files

Post by frabjous »

Don't sue LyX -- they didn't do anything wrong!

Seriously, though, I doubt LyX is the right tool for this job. This could be done fairly easily with a batch file or shell script -- though the exact syntax would depend on the operating system and LaTeX distribution you're using.

It would also depend on the exact syntax of these .tex files -- are they complete, compiliable documents, or just snippets to include in something else? What does the makefile do?

To be clear, you want just one big PDF as output, rather than 94 little ones?
boardtc
Posts: 4
Joined: Wed Mar 03, 2010 5:48 pm

pdf conversion advice for multiple .tex files

Post by boardtc »

frabjous wrote:Don't sue LyX -- they didn't do anything wrong!
Hehe :D

The latex was generated from Doxygen
http://www.stack.nl/~dimitri/doxygen/output.html
frabjous wrote: Seriously, though, I doubt LyX is the right tool for this job. This could be done fairly easily with a batch file or shell script -- though the exact syntax would depend on the operating system and LaTeX distribution you're using.
Lyx asked if I wanted to install MiKTeX 2.8, which I did. I'm on Windows. Would there be a batch file script that would do this from MiKTeX as standard or something?
frabjous wrote: It would also depend on the exact syntax of these .tex files -- are they complete, compiliable documents, or just snippets to include in something else? What does the makefile do?
I'm not sure how I tell with the .text files but I assume they are all compilable. It's not huge, no file is over 30k, some empty at 1k. Here's the makefile:

Code: Select all

all: clean refman.pdf
pdf: refman.pdf
refman.pdf: refman.tex
	pdflatex refman.tex
	makeindex refman.idx
	pdflatex refman.tex
	latex_count=5 ; \
	while egrep -s 'Rerun (LaTeX|to get cross-references right)' refman.log && [ $$latex_count -gt 0 ] ;\
	    do \
	      echo "Rerunning latex...." ;\
	      pdflatex refman.tex ;\
	      latex_count=`expr $$latex_count - 1` ;\
	    done
clean:
	rm -f *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out refman.pdf

frabjous wrote: To be clear, you want just one big PDF as output, rather than 94 little ones?
Yes, just one big linked pdf (dozygen preps the .tex to be linked).

thanks a lot.
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

pdf conversion advice for multiple .tex files

Post by frabjous »

I don't know anything about doxygen, sorry, but it looks to me like that makefile IS a script designed to create the PDF you have in mind. Problem is, it's for UNIX/Linux, and I'm not sure it'll run on Windows. (Perhaps with this, but I don't know enough about makefiles on Windows to know whether this will work.)

Anyway, it involves a file called refman.tex -- do you have that file? Does it look different from the others? My guess is that actually it is the only compiliable .tex file, and it is just a wrapper for calling and indexing the others. (You might even post it here and we can check--at least if it doesn't contain anything private in it. You could open it in Notepad and look -- it might even open in LyX, in which case exporting it to PDF from LyX may do the trick.)

If I understand the makefile right, it is just running pdflatex once then makeindex once then pdflatex several more times (up to five more times) on the file refman.tex.

Do you know if the MiKTeX binaries are you in your "path"?

I guess you could test by opening a "DOS" or Command prompt and typing.

pdflatex -v

if it shows what version of LaTeX you have installed, you're basically all set.

Just type in:

cd "C:\Path To\The Directory\With These Files\"

(with that changed to the right drive letter/directory with these files.)

And then (one by one):

pdflatex refman.tex
makeindex refman.idx
pdflatex refman.tex
pdflatex refman.tex

...and keep doing "pdflatex refman.tex" that until it stops saying something like "Rerun to get cross-references right" or "Rerun latex".

The output will be refman.pdf.

The last line of the makefile deletes the auxiliary files -- those ending in *.ps *.dvi *.aux *.toc *.idx *.ind *.ilg *.log *.out -- which you can do at this point, but don't need to.
boardtc
Posts: 4
Joined: Wed Mar 03, 2010 5:48 pm

Re: pdf conversion advice for multiple .tex files

Post by boardtc »

Fantastic mate!

From the field directory I referenced the MiKTeX bin and ran pdflatex refman.tex. This created a 181 pdf document - output written in refman.pdf.

Do I need to run the other steps?

Thanks, Tom.
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

Re: pdf conversion advice for multiple .tex files

Post by frabjous »

The other steps are probably necessary for the index and internal links to work/appear properly.

You can open the PDF and check though.
boardtc
Posts: 4
Joined: Wed Mar 03, 2010 5:48 pm

Re: pdf conversion advice for multiple .tex files

Post by boardtc »

All the links worked first time. Thanks again. Tom.
Post Reply