Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I have a complete framework for my PhD thesis based on classicthesis/arsclassica. Single chapters are located in Subfolders like this.

  • main.tex
  • Chapters/project1/project1.tex
  • Chapters/project2/project2.tex
  • ...

I am using chapterbib to have a references section after each chapter. The chapter files are included in the main document via \include, so that I get separate .aux files in each subfolder. I need to run bibtex on the .aux files in the subfolders so that the .bbl files necessary for the chapter references are created.

All my machines both at work and at home are running Linux, I am using Vim as an editor and have written a simple shell script to do this.

#!/bin/bash
pdflatex main.tex
for auxfile in $(find * -name "*.aux"); do bibtex $auxfile; done
pdflatex main.tex
pdflatex main.tex

Now, I have given the template to a friend, she is using both Windows and OS X. Her editor is Texmaker. The given compile profiles all do not work for this, since they do not run bibtex on the other files. Manually opening the subchapters and executing bibtex works on my machine, oddly enough even this was not really working for her either, but I need to check it again. Anyways, an automatic routine would be preferred.

If I add something like this

for auxfile in $(find * -name "*.aux"); do bibtex $auxfile; done 

as a user specified command in Texmaker on the Mac, I am getting the Message "Error: Could not start the command", even though it works when I execute it from the command line.

So, I am looking for a solution (or two) to add a profile that does the usual compilation routine plus also runs bibtex on the .aux files of the \included chapters. Needs to work in OS X and in Windows, so probably the solutions are going to be distinct. If necessary, I can upload a minimal working example which I have prepared.

share|improve this question
    
There is no "profile" in Texmaker but "user commands". And these commands are not bash commands (bash is not supported on windows - an "user command" is only a chain of executable commands on the system). But you can create a bash script on MacOsx and a .bat script on windows and then launch the script with an "user command" in Texmaker. –  user27168 Jan 7 at 17:34
    
Indeed, what I meant where the user commands. I am aware that bash does not work on Windows, but it should on MacOsx. But for some reason, this doesn't work. Even if I create a bash script like the one above and create a Texmaker user command to execute it, it doesn't work. In addition, I have no idea how to create a similar script that would work on windows. The "chain of executable commands" is exactly what I am looking for. –  ilprincipe Jan 7 at 22:02
    
No idea about Windows and essentially none about Macs, but are you sure your commands on the Mac are getting executed in the right bash 'environment' (think: env). Also why you're at it, why not make a real Makefile or (let your friend) use something like latexmk? –  jon Jan 7 at 22:31
    
1) The script must be really executable (it can't be launched by "sh myscript.sh" which is a bash command to launch a bash script) and the script must be really reachable by Texmaker (in the path, or with the full path to the script, or by using a parameter : in Texmaker, the ! parameter will be replaced by the current directory). 2) As said Jon : using a tool like latexmk will be more cross-platform compliant. –  user27168 Jan 7 at 22:42
1  
@ilprincipe At least one 'canned' solution has been mentioned here, hasn't it? –  cfr Jan 8 at 0:13

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.