1

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) 
mrbolichi
  • 260
  • A warm welcome to TeX.SE! I faced a similar problem, using an online service that I found slow to compile. I ended up effectively abandoning the online service and making my own workflow where I write in google docs. When I want to compile my work, I use wget to pull the text of the gdoc file into my own machine and compile there. That has the advantage of an online file store, but one that is copied locally and compiled locally. I also know some folks use git in much the same way. – A Feldman May 03 '16 at 08:18
  • I think perhaps the standalone package might help. https://www.ctan.org/pkg/standalone?lang=en – A Feldman May 03 '16 at 08:20
  • @AFeldman thanks for your answer. I would take a look on standalone package. 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
  • I didn't really understand why you need different configurations, but I would probably write \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
  • Hi @UlrikeFischer, thanks for answering. I need two different configurations because it seems that sharelatex and my texlive configurations are different. As I stated above, compiling the project with a given path is okay in sharelatex and wrong in my local pc or vice versa. Your solution would make me have a version in my pc and another one different in sharelatex, which is precisely what I'm trying to avoid. I want a solution that allows me to download the project, edit it locally without worrying about paths, uploading it again and editing up there, again, without worrying about paths – mrbolichi May 03 '16 at 21:28
  • As I wrote: Test for \jobname. Do something like "if jobname=output then sharelatex path else local path". http://tex.stackexchange.com/questions/117892/can-i-convert-a-string-to-catcode-11 – Ulrike Fischer May 03 '16 at 21:42
  • @UlrikeFischer that seems interesting. Can you tell me how to actually implement it? I'm not very informed about LaTeX's programmation capabilities. – mrbolichi May 04 '16 at 07:24
  • 1
    For everyone who answered here: I contacted sharelatex and they finally replied. There seems to be some king of bug in their system and they are aware of that. So, nothing to do until they solve it. – mrbolichi May 07 '16 at 09:03

0 Answers0