You are not logged in.
Pages: 1
Hi,
I'm writing a long document in latex, and I use Geany for that. The project consists of several files. My problem is that when hitting F9 (compile), the compiler tries to compile that specific tex file that I edit currently and not the main tex file in the project (and of course, it failes, beacause only the main file contains \begin{document}).
How can I fix it?
Offline
I do not know geany, but almost every editor should be suitable for that. Try emacs.
Or use a tool like latex-mk from the commandline.
Offline
Edit: Answer was wrong, didn't use brain, sorry.
Last edited by gridcol (2013-04-20 18:57:52)
I would only use the editor ... for editing. Make yourself two shell scripts inside of your document folder and chmod +x them. That's much more useful especially, when you are using BibTex aswell so you don't have to pdflatex -> bibtex -> pdflatex -> pdflatex everytime one after the other for a full compilation. I use a second script to clean up all non-tex files from time to time. Only one click on that file is needed and it compiles my document with working bibliography.
Last edited by blackout23 (2013-04-20 19:28:39)
Offline
Using shell script is probably the best approach. You have higher flexibility.
Here's how my script file looks like. (Here report1.tex is the main tex file)
file=report1
pdflatex --shell-escape $file.tex
bibtex $file.aux
pdflatex --shell-escape $file.tex
pdflatex --shell-escape $file.tex
rm $file.aux -v
rm $file.toc -v
rm $file.log -v
rm $file.bbl -v
rm $file.blg -v
rm $file.lof -v
rm plots//*.pdf -v
rm pics//*.pdf -vThis way you can generate pdf with bibs and postscript images, do cleanups etc at single command. Just run the script file.
Offline
These are my skripts.
#! /bin/bash
pdflatex thesis.tex && bibtex thesis && pdflatex thesis.tex && pdflatex thesis.tex#! /bin/bash
find \( -name "*.aux" -o -name "*.lot" -o -name "*.lof" -o -name "*.bbl" -o -name "*.blg" -o -name "*.pdf" -o -name "*.log" -o -name "*.toc" \) -deleteOffline
Using shell script is probably the best approach. You have higher flexibility..
Or, my preference, a make file.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
I use a makfile with LaTeX, and I suppose every editor targeted at development would provide a mechanism for integrating that. In particular, I use latex-mk as follows for pdfTeX with bibLaTeX+biber backend:
NAME=ws12-jpeu-techipr
TEXSRCS=$(NAME).tex
USE_PDFLATEX=1
BIBTEX=biber
BIBTEXSRCS=$(NAME).bib
include /usr/share/latex-mk/latex.gmkwhere the rest from latex-mk is included from the appropriate location. Targets may be configured with the full power of make, but latex-mk brings a selection of pre-configured targets that take automatically care of standard LaTeX toolchains. Just run `make` from within the editor.
Offline
What I do in such cases is to keep the main document open in a tab and use geany's (or latexila's, I like playing between the two) internal command to build them. Otherwise you can have a terminal open and feed the command there.
Intel(R) Celeron(R) CPU E3400 @ 2.60GHz, x86_64. AURs.
“No one without the knowledge of geometry may enter.“ Plato.
Offline
I'm really confused by these makefile. latexmk has it's own configuration file. Once configured to your liking, just run `latexmk main-input.tex`.
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
I'm really confused by these makefile. latexmk has it's own configuration file. Once configured to your liking, just run `latexmk main-input.tex`.
In my case, I have some Python scripts that parse non-tex files and generate dynamic tex files on-the-fly. latexmk does not quite handle them.
Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
The shortest way to ruin a country is to give power to demagogues.— Dionysius of Halicarnassus
---
How to Ask Questions the Smart Way
Offline
Pages: 1