Hello, Gene and I prepared this guide to share our experience setting up our PhD thesis writing with LaTeX + VSCode + Zotero. We hope it helps. But remember, the best way is always your way.
This implementation is based in VSCode as IDE. Information about VSCode can be seen at:
Compiling LaTeX files in VSCode is easier since version 1.74
. Make sure you have VSCode’s newest version and download the extension called LaTeX Workshop from James Yu.
His extension is maintained through the following repository. If you have issues, you can look at the issue tracker and/or open your own:
To compile the LaTeX files, you can go to the TeX
icon on the left bar and click on Build LaTeX Project and the document will be created, looking like the following:
-
LaTeX Utilities: Help to create shortcuts for copying and pasting stuff. For example, with this extension you can copy a table in excel and it becomes a table with LaTeX code. You can also copy a
.png
image and it becomes also a LaTeX code with the right syntax to add the figure in your document. It also helps on writing equations etc (read the docs). -
https://marketplace.visualstudio.com/items?itemName=tecosaur.latex-utilities
-
Grammarly extension: Grammar checking extension which works well, even in the middle of LaTeX code. If you have Grammarly Premium you can also connect to your account via VSCode and get better suggestions. Make sure you also configure the language, e.g. English American/British and writing style. There are other grammar checking extensions if you don’t like Grammarly. Make sure you have one!
-
https://marketplace.visualstudio.com/items?itemName=znck.grammarly
For managing citations, Zotero is a great option. It requires a good amount of commitment and it will not be perfect right away. Many citations come wrong and it is a time-consuming process to edit all of them, but it pays off at the end…
After you added some of your literature to it, a Zotero library should look like this:
You can adjust citations by directly clicking on them and editing any detail that might be wrong.
Make sure you install Zotero extensions to your browser, this way it is easier to import information about articles directly from the article page. For example, on the top left the icon Save to Zotero will import the information to your library (always double check!).
Keep your library clean as it will then help you to writing future articles, etc… Try to start early.
Now that you have a clean library of references in Zotero you want to set up a live export of this citations to a .bib
file. This means that every time you read a new paper, and add it to your Zotero library, this will update the .bib
file at your thesis/article.
To achieve that, first download and install Zotero’s extension Better BibTeX:
This extension eases the automatic export process. Once it is installed go ahead and export your library with
- Zotero > Export Library > Format: Better BibTeX > [x] Background Export | [x] Keep Updated > OK. As in the image below:
You can save the .bib
within your thesis folder and link your references to it in LaTeX. If you are unsure how to do the LaTeX part, make sure you read about it in the multiple LaTeX tutorials available online, such as the Overleaf tutorial, see here:
In the example example, the Zotero library is exported to a file called references.bib within the Thesis folder. The citations will be automatically updated in this file if you make any modification, e.g., a correction in a citation that you imported wrongly.
You can browse through some other cool Zotero extensions, I highly suggest that you use the Better BibTeX function to standardize all citation keys (see the docs). I standardized all my citations as [AUTHOR][PAPER FIRST WORD][YEAR]. If you do that, Better BibTeX will overwrite all the citation keys that you import to this format and it will help you to cite them at your document afterwards. For example.
\cite{livesley_computational_1992}
Also, the autocomplete functions of VSCode should work fairly well, so when you start typing the name of the author, you should get the options for citing the papers from that author.
To back up your document and keep track of your writing progress, it is useful to create a repository at GitHub to store your thesis and commit to it as you go.
You can use any Git manager to do that, from which wi suggest GitKraken:
A cleaned verison of the template can be downloaded in this repository, added by Gene.
It includes the thesis content divided in parts, chaptes, figures and extra pages. The main file of the thesis: phd.tex
will call out these files to compile your final document.
The uploaded template has been a cummulative work of many people from my research group including:
Have a fun writing.