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 am using Eclipse 4.2 with TeXlipse 1.5 (the version bundled with StatET 3.2) and MixTeX 2.9. I have no problem using TeXlipse, bibtex, and natbib to produce bibliographies. But I often want to include multiple bibliographies (i.e., lists of references) in the same document. natbib isn't up to this task. In these cases, I turn to the bibunits package.

The problem is that Texlipse doesn't work well with bibunits. When latex (or pdflatex, etc.) is run on a document that includes \usepackage{bib units}, it generates an .aux file for each bibliography that is to be created: bu1.aux, bu2.aux, and so on. If the bibliographies are to be produced, bibtex needs to process each of these .aux files:

bibtex bu1.aux
bibtex bu2.aux

and so on. But Texlipse doesn't seem to know this. So it doesn't, by default, direct bibtex to process those .aux files. The result is that the bibliographies don't display as they should.

Here is a complete example of a document that the command-line tools (pdflatex, bibtex) handle fine but that gives Texlipse a lot of trouble. Although it uses bibunits, it has only one bibliography (to keep things simple):

\documentclass{article}
\usepackage{bibunits}
  \defaultbibliography{references}
  \defaultbibliographystyle{plainnat}
\usepackage{natbib}
\begin{document}
  \begin{bibunit}
    Lorem ipsum dolor \citep{Smith_Lorem_1980}.
    \putbib
  \end{bibunit}
\end{document}

where references.bib is

@BOOK{Smith_Lorem_1980,
  AUTHOR    = {John Smith},
  TITLE     = {Sit Amet},
  YEAR      = {1980},
  PUBLISHER = {Knopf},
}

(The example requires a separate .bib file: TeXlipse doesn't support \thebibliography commands.)

Is there a way to change the Texlipse configuration so that it can handle the .aux file that is generated when files like the example file are processed? Right now, I have rigged up a workaround (configuring BibTeX as an "external tool" to process the .aux files), but it is clunky.

share|improve this question
2  
You can setup your editor for arara to simplify the compilation. –  Marco Daniel May 26 '13 at 11:59

1 Answer 1

Depending on the number of external tools TeXlipse needs to be configured against, I have had great success in setting up the builder configurations and sequencing numerous tasks. I use bibunits, glossaries, lillypond, xelatex, and tex4ht and I have also automated the production of certain types of tex files with external programs, and this approach allows me to call these command line accessible programs prior to compiling my latex project ensuring I always have uptodate files. Creating compile sequences inside TeXlipse I find too arduous and cumbersome for all these external programs.

On windows computers running MikTex, I use a bat file with a custom sequence that contains either hardcoded defaults, or command line arguments (or both). I setup TeXlipse to run this batch file as and external program and can setup TeXlipse to pass workspace variables via the command line from user specified workspace configurations in TeXlipse.

To address the bibunits specific nature of the question I use bu*.aux in a for loop

FOR /R %%A IN (bu*.aux) DO ( ECHO Will try and compile %%~dpA%%~nA with bibtex & "%MikTexPath%bibtex.exe" --include-directory="%srcPath%\..\..\ReferencesDirectory"  "%%~dpA%%~nA")

This when in a batch file can be run with hardcoded locations or replaced with command line variables (as demonstrated in the more complicated example below) that TeXlipse can pass.

I don't profess to be an expert in batch file programming but this bibunits/glossaries/xelatex demo setup allows me to work on any computer with the base software that I can bring my project to.

@ECHO OFF

:Configure command line assignments:
IF %1.==. (GOTO No1) ELSE (GOTO Valid1) 
    :EndConsoleArgumentAssignments1

IF %2.==. (GOTO No2) ELSE (GOTO Valid2)         
    :EndConsoleArgumentAssignments2

IF %3.==. (GOTO No3) ELSE (GOTO Valid3)         
    :EndConsoleArgumentAssignments3

IF %4.==. (GOTO No4) ELSE (GOTO Valid4) 
    :EndConsoleArgumentAssignments4

IF %5.==. (GOTO No5) ELSE (GOTO Valid5)
    :EndConsoleArgumentAssignments5

    GOTO EndConsoleArgumentAssignments
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:Valid1
    SET projectName=%1
    ECHO Using command line argument to fill in %projectName%
    GOTO EndConsoleArgumentAssignments1

:Valid2
    SET projectPath=%2
    ECHO Using command lin argument to fill in %projectPath%
    GOTO EndConsoleArgumentAssignments2

:Valid3
    SET srcPath=%3
    ECHO Using command line argument to fill in %srcPath%
    GOTO EndConsoleArgumentAssignments3

:Valid4
    SET tmpPath=%4
    ECHO Using command line argument to fill in %tmpPath%
    GOTO EndConsoleArgumentAssignments4

:Valid5
    SET outPath=%5
    ECHO Using command line argument to fill in %outPath%
    GOTO EndConsoleArgumentAssignments5

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:No1
    SET projectName=INSERT_PROJECT_NAME_HERE
    ECHO Using default string for projectName - %projectName%
    GOTO EndConsoleArgumentAssignments1

:No2
    SET projectPath=INSERT_PROJECT_LOCATION_HERE
    ECHO Using default string for projectPath=- %projectPath=%
    GOTO EndConsoleArgumentAssignments2

:No3
    SET srcPath=%projectPath%\src
    ECHO Using default string for srcPath - %srcPath%
    GOTO EndConsoleArgumentAssignments3

:No4
    SET tmpPath=%projectPath%\tmp
    ECHO Using default string for tmpPath - %tmpPath%
    GOTO EndConsoleArgumentAssignments4

:No5
    SET outPath=%projectPath%\Output
    ECHO Using default string for outPath - %outPath%
    GOTO EndConsoleArgumentAssignments5

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

:EndConsoleArgumentAssignments

IF exist "%tmpPath%" (
    ECHO "tmp folder allready exists, it will be removed and recreated."
    rmdir "%tmpPath%" /s /q
    mkdir "%tmpPath%"
)
IF not exist "%tmpPath%" mkdir "%tmpPath%"
IF not exist "%outPath%" mkdir "%outPath%"

:CheckOS
IF "%PROCESSOR_ARCHITECTURE%"=="x86" (GOTO 32BIT) ELSE (GOTO 64BIT)

:64BIT
ECHO 64-bit compiling
SET MikTexPath=C:\Program Files\MiKTeX 2.9\miktex\bin\x64\
GOTO END

:32BIT
ECHO 32-bit compiling
SET MikTexPath=C:\Program Files\MiKTeX 2.9\miktex\bin\
GOTO END

:END

SET TeXCompilier=xelatex.exe

ECHO "Variables have been configured, and TMP folder is fresh for a build"

"%MikTexPath%%TeXCompilier%" "%srcPath%\%projectName%.tex" -aux-directory="%tmpPath%" --include-directory="%srcPath%" --output-directory="%outPath%"

FOR /R %%A IN (bu*.aux) DO ( ECHO Will try and compile %%~dpA%%~nA with bibtex & "%MikTexPath%bibtex.exe" --include-directory="%srcPath%\..\..\ReferencesDirectory"  "%%~dpA%%~nA")
:GOTO Terminate

@echo off
"%MikTexPath%makeindex.exe" -s "%tmpPath%\%projectName%.ist" -t "%projectName%.glg" -o "%projectName%.gls" "%tmpPath%\%projectName%.glo"
"%MikTexPath%makeindex.exe" -s "%tmpPath%\%projectName%.ist" -t "%projectName%.alg" -o "%projectName%.acr" "%tmpPath%\%projectName%.acn"

"%MikTexPath%%TeXCompilier%" "%srcPath%\%projectName%.tex" -aux-directory="%tmpPath%" --include-directory="%srcPath%" --output-directory="%outPath%"  
"%MikTexPath%%TeXCompilier%" "%srcPath%\%projectName%.tex" -aux-directory="%tmpPath%" --include-directory="%srcPath%" --output-directory="%outPath%"

echo compiling finished

echo Begin cleaning up tmp files

IF exist "%tmpPath%" (
    ECHO "tmp folder allready exists, it will be removed and recreated."
    rmdir "%tmpPath%" /s /q
    mkdir "%tmpPath%"
)
IF not exist "%tmpPath%" mkdir "%tmpPath%"


ECHO "Removing index and glossary files in an unrobust way"

Del "%projectPath%\%projectName%.acr"
Del "%projectPath%\%projectName%.acn"
Del "%projectPath%\%projectName%.alg"
Del "%projectPath%\%projectName%.glg"
Del "%projectPath%\%projectName%.gls"
Del "%projectPath%\%projectName%.glo"

Del "%projectPath%\%projectName%.toc"
Del "%projectPath%\%projectName%.wrt"

Del "%projectPath%\%projectName%.log"
Del "%projectPath%\%projectName%.idx"
Del "%projectPath%\%projectName%.ist"

:Terminate
share|improve this answer

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.