Generalhow to make texcentre works with jabref?

LaTeX specific issues not fitting into one of the other forums of this category.
spiegboy
Posts: 120
Joined: Thu Dec 06, 2007 9:58 am

how to make texcentre works with jabref?

Post by spiegboy »

i use jabref to manage my references ,but there is a problem that everytime i write a paper, i have to copy the bib file including the references i cite to the directory of the tex file. i wonder if it's possible to let the texcentre to locate the database itself?

thank you very much

Recommended reading 2024:

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

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

Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Re: how to make texcentre works with jabref?

Post by Juanjo »

In general, when the name of a file appears in an argument of a macro (like \input, \includegraphics, \bibliography...), LaTeX assumes that the file is in the same directory of the main tex file if nothing else is specified. To refer to files in a different directory, one should add an absolute path or a relative path to the main tex file. For example:

\includegraphics{Users/Smith/Documents/Images/myproject/foo.jpg} (absolute path)

\bibliography{./complements/bibfiles/foo} (relative path)
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
spiegboy
Posts: 120
Joined: Thu Dec 06, 2007 9:58 am

how to make texcentre works with jabref?

Post by spiegboy »

THANK YOU ,BUT PLEASE SEE MY CODE, IT DOESNT WORK.

Code: Select all

\documentclass[a4paper]{article}
\usepackage[english]{babel}
\usepackage[latin1]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{blindtext,cite}
\begin{document}

safdsaf\cite{Atalay2005}


\bibliography{D:/My Documents/BIB DATABASE/GMI08}
\bibliographystyle{unsrt}


\end{document}
User avatar
Juanjo
Posts: 657
Joined: Sat Jan 27, 2007 12:46 am

Re: how to make texcentre works with jabref?

Post by Juanjo »

The problem may be the white space in the path (folders My Documents and BIB DATABASE). In general, spaces (and surely non-standard characters) should be avoided in file or directory names in one wants TeX to accept them. I don't know any workaround.
The CTAN lion is an artwork by Duane Bibby. Courtesy of www.ctan.org.
spiegboy
Posts: 120
Joined: Thu Dec 06, 2007 9:58 am

Re: how to make texcentre works with jabref?

Post by spiegboy »

you are right, it works after i change the database to another directory without space

thanks a lot
User avatar
T3.
Posts: 208
Joined: Fri Mar 14, 2008 12:58 pm

how to make texcentre works with jabref?

Post by T3. »

Juanjo wrote:The problem may be the white space in the path (folders My Documents and BIB DATABASE). In general, spaces (and surely non-standard characters) should be avoided in file or directory names in one wants TeX to accept them. I don't know any workaround.
I agree that white space and weird characters should be avoided in file names for maximum portability, however, file names with spaces are very common on Windows. There are two workarounds for that problem:
  • use short name format (DOS era 8.3 format - run 'dir /x' command to see it)
  • quote the troublesome file name with double quotes, like this "D:/My Documents/BIB DATABASE/GMI08"; works on MiKTeX but I'm not sure about other distributions
Cheers,

Tomek
spiegboy
Posts: 120
Joined: Thu Dec 06, 2007 9:58 am

Re: how to make texcentre works with jabref?

Post by spiegboy »

sorry, man, i use miktex2.6 and texinCentre, neither tricks work for me when i try them.

still the same problem.
User avatar
T3.
Posts: 208
Joined: Fri Mar 14, 2008 12:58 pm

how to make texcentre works with jabref?

Post by T3. »

spiegboy wrote:sorry, man, i use miktex2.6 and texinCentre, neither tricks work for me when i try them.

still the same problem.
It does work for (pdf)latex but unfortunately not for bibtex. Bibtex always complains about white space (short names contain '~' which is also treated as white space). Sorry, I should be more precise.

Cheers,

Tomek
spiegboy
Posts: 120
Joined: Thu Dec 06, 2007 9:58 am

Re: how to make texcentre works with jabref?

Post by spiegboy »

i trid pdflatex, but still it doesnt work. do i need to put any command to the preamble?
confused, can you paste a mini example that works?
thanks
User avatar
T3.
Posts: 208
Joined: Fri Mar 14, 2008 12:58 pm

how to make texcentre works with jabref?

Post by T3. »

Code: Select all

\documentclass{minimal}
\begin{document}
Test input with white space:
\input{"foo bar.tex"} %this works

Test input with short name:
%\input{foobar~1.tex} %this fails

Test input with short name:
\begingroup\catcode`~=12\input{foobar~1.tex}\endgroup %this works

Test include with white space:
\include{"foo bar.tex"} %this fails but the compilation proceeds

Test include with short name:
%\include{foobar~1.tex} %this fails

Test input with short name:
\begingroup\catcode`~=12\include{foobar~1.tex}\endgroup %this behaves strangely
\end{document}
So, actually only input of quoted file name works entirely properly. Anyway, it's a really bad idea to rely on this behaviour. And I'm not sure if the same holds for TeXLive. Perhaps someone else can test it.

Cheers,

Tomek

Edit: Tested on MiKTeX 2.7
Post Reply