I'm working on my thesis and I decided to do it in LaTeX. I was using an amazing online service, ShareLatex, that allowed me to compile and edit my projects wherever I go (I use several computers in a day and I'm not allowed to install anything in most of them). Eventually, my thesis grew big (the free service was struggling in compiling the whole project) and besides, the last weekend I lost my connection to internet so I couldn't work on it. I decided to install in my xubuntu 14.04 the texlive-full package.
Everything was working right, except that references file (.bib) were not found. I have a folder called "secciones" where I put the different sections, (.tex) and "refs", where all the references files (i.e .bib) go. So, I'm using the package subfiles to compile the whole project using several files. This is what my main.tex file looks like
\documentclass[a4paper,10pt]{book}
\usepackage{plantillaTFM}
\begin{document}
\subfile{preamb}
\newpage
\chapter{Introducción}
\subfile{intro}
\newpage
\chapter{Materiales y métodos}
\subfile{matmet}
\newpage
\chapter{Resultados}
\subfile{results}
\newpage
\chapter{Discusión}
\subfile{discusion}
\newpage
\chapter{Conclusiones y líneas futuras}
\subfile{conclusion}
\newpage
\subfile{secciones/refs}
\newpage
\chapter{Apéndice}
\subfile{apendice}
\end{document}
Files in "secciones" folder are those specified within \subfile commands. the problem is that, having this main the compilation is successfully in ShareLatex, given that refs.tex file's content is
\documentclass[./main.tex]{subfiles}
\begin{document}
\bibliographystyle{plain}
\bibliography{refs/biblio.bib}
\end{document}
and my bibliography file is biblio.bib. This, however, produces errors in my computer. First of all, I got the error ! LaTeX Error: File 'secciones/refs.tex' not found. The way of getting it right in my computer is using \subfile{refs} in main.tex and \bibliography{../refs/biblio} in refs.tex. This solution fails to get it right in shareLatex, giving the warning of undefined references. (Probably failing to get the right path to biblio.bib)
My question: how to solve my problem? I want a single project I can edit without changing paths everytime I change to online from offline or vice versa. Also, suggestions about setting up my workspace are welcome (I, however, prefer to maintain using sublime-text for compiling`
TeX compilators:
online: pdfTeX, Version 3.14159265-2.6-1.40.16 (TeX Live 2015) (preloaded format=pdflatex 2016.1.12)
offline: sublime-text with latextools, set to TraditionalBuilder: Engine: pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Debian)
standalonepackage might help. https://www.ctan.org/pkg/standalone?lang=en – A Feldman May 03 '16 at 08:20standalonepackage. However, I don't want to drop the online service because it satisfies most of my needs. I want to preserve it and I want to make my files consistent across different compilators – mrbolichi May 03 '16 at 09:27\bibliography{\bibpathprefix refs/biblio.bib}and then create two small configurations files -- one in sharelatex the other on your pc with\newcommand\bibpathprefix{}and\newcommand\bibpathprefix{../}respectivly. Addition: As \jobname is "output" in sharelatex you can also set the pathes through a test. – Ulrike Fischer May 03 '16 at 10:50