#AcWri workflow: My #LaTeX paper directory

Keeping project and paper files organized in an efficient, consistent paper directory —system of files and folders—makes writing a lot easier. You don’t have to search for papers, sections, notes, graphics, tables, references, and all the other minutiae. In this first post on my LaTeX workflow, I introduce how I organize the files I use to write individual papers in a way that lets me copy-and-paste with just a couple clicks to start a whole new paper that already has all the section headers and labels.

The first thing I do to keep my papers organized is create a template folder containing all the generic parts I’ll need for any typical paper. I title this folder “Temp_Art,” and it goes in a top-level folder called “#Templates” in my Google Drive. Computers alphabetize by symbols first, then numbers, then letters, so I use the hashtag to force the template folder toward the top of the list of folders in my Google Drive. It’s always right there at the top when I need it.

Screen Shot 2016-04-24 at 11.01.26

Within that template folder, I create three more folders: “Main,” “Parts,” and “Submission.” Let’s start with the “Parts” folder:

Parts for sections

Here I include a list of .tex files, each named for a section of a typical research paper: “Introduction.tex,” “Review.tex,” and so on. I also have a file called “Abstract.tex.” Breaking the files up into the sections of the paper helps me focus on writing a section at a time. If I need to work on the Review, I just open that section, and I don’t need to see the other sections, the header content, the references, or any other code that does not apply to that section.

If I have a complex section, I put another folder in “Parts” titled the same as the section, and include the subsections within that folder. Here I’m dividing the research design section into three subsections: “DV.tex,” where I’ll describe the dependent variable, “IVs.tex,” where I’ll describe the independent and control variables, and “Model.tex,” where I’ll describe the estimation.

These files won’t be compiled, so do not include any header information, declare a document class, or use any packages.

The Main file

In the “Main” folder, I include a single .tex file, which I title the same as the paper folder, usually my first initial, last name, and shortened versions of the dependent and main independent variables, like “JWellsWarTrade.tex” for example. This is the file that will actually get compiled, so you should include the document class and header information here. (You should also use any packages you need here if you don’t use a separate style sheet. I use a separate style sheet, which I’ll post about later.)

This file inputs all the sections using the input{} command after each section{} command:

SS 2016-01-27 at 13.34.06

On line 20, I use the first section{} command to indicate the introduction and the label{} command to give it a hyperref label for later on in the document. On the next line, I use the input{} command to include what I’ve written in “Introduction.tex.” Notice the relative path for the file location: the “../” tells the compiler to look back to the previous directory. The current directory for the “JWellsMain.tex” is “Main,” so the previous directory is “Temp_Art.” Then, the file path goes into “Parts,” and then gets the file “Introduction.”

Repeat this for the other sections, and then compile the main file. You’ll have everything you wrote or input into those files—text, tables, figures, whatever—input into the main document.

If you do this an additional level, like I did with “Design.tex,” then use the same process in that file to input the “DV.tex,” “IVs.tex,” and “Model.tex” files into “Design.tex,” and then compiling the main file will input all of it.

Notice only the main file will compile, meaning it will produce the .aux, .log, and all the other behind-the-scenes files. You won’t get any of those process files with the other .tex files. All the process files are kept in the “Main” folder, which is why the main file goes in the “Main” folder by itself.

New paper directory for a new paper

Any time you start a new paper, copy and paste the “Temp_Art” folder into your working directory. All you’ll need to change is “Temp_Art,” and everything else—in terms of inputting sections—will work. You’ll already have all your section headers and labels ready to go.

  • If you need to change a section header, just change the section title in the main file.
  • If you need to add a section, copy and paste a blank section, rename the file, and input it into the main file.
  • If you need to delete a section, comment out or delete the section{} and input{} commands in the main file.

That’s how I organize my paper files in LaTeX. I hope this helps you better organize your LaTeX projects. Let me know if you have questions, suggestions, or a different system. I love to hear about other workflows.

I offer one-on-training and editing in using LaTeX. Whether you’re new to academic writing and presenting or you’re just fed up with expensive, proprietary word processors that produce generic, limited-access documents, I strongly recommend learning LaTeX.

Jeremy L. Wells

Leave a Reply

Your email address will not be published. Required fields are marked *