6

I'm using git to store my project files including the tex files. Now I'm thinking about starting to write up a first draft.

What's a good project structure for combining latex and the git technology?

For example, if I will have different versions of the draft (say, the first version sent out for conference XYZ, and then newer versions), should I create a folder structure for these? Or should I use git's branching feature? Or something different?

On top of that, should I keep something specific in mind when creating the file structure? Keeping in mind the git versioning, is it more useful to have a file for the head, and files for main parts of the draft? How many of the old "style guides" for tex structures are still valid when using git as a versioning system?

FooBar
  • 983
  • 2
    Sorry, but I think this question is off-topic and not TeX specific, but the technique holds for any software or electronic document writing, basically –  Feb 03 '16 at 15:11
  • 4
    It is not off-topic. See this question http://tex.stackexchange.com/questions/103244/git-latex-and-branches-workflow and this http://tex.stackexchange.com/questions/75862/automatic-branching-for-versions-and-git and of course also gitinfo package manual. – percusse Feb 03 '16 at 15:29
  • 1
    The question is not off-topic, but unspecific: you are asking, what to do with git. If you can not answer this question, how should we? Go ahead, write your draft! – Keks Dose Feb 03 '16 at 15:46
  • 3
    I agree that the question is not off-topic, but "What's a good project structure..." is inherently an opinion-based question. There are many such project structures. Some are completely flat, some are excessively hierarchical, some are pure fairy dust. You need to hone your question down to something more specific so it's answerable :-) – Sean Allred Feb 03 '16 at 16:05
  • @SeanAllred I was hoping that mentioning git would reduce the set of such project structures. – FooBar Feb 03 '16 at 16:15
  • 2
    @FooBar One of the reasons git has been so successful is its flexibility to a multitude of software engineering paradigms :) There isn't any 'one true flow' for git -- it just doesn't exist. Branches, tags, remotes, versioned folders, etc. are all valid solutions to this. A right answer doesn't exist -- nor does a wrong answer. (In the future, there are usually people in chat with strong opinions that are happy to share them :) – Sean Allred Feb 03 '16 at 16:18
  • 1
    Imho there is no git specific structure, the structure depends on the project and your working mode not on git. But you will need a good .gitignore-file so that the various external files don't clutter your commits, and you should consider a git filter that adds e.g. a date to files, especially if you sent files around so that you know which version other people got. – Ulrike Fischer Feb 03 '16 at 16:49
  • Related: http://academia.stackexchange.com/questions/5327/is-there-an-advantage-of-branching-in-version-controlled-paper-writing – StrongBad Feb 03 '16 at 18:53
  • @UlrikeFischer From our Brent Longborough https://www.ctan.org/pkg/gitinfo2 – percusse Feb 03 '16 at 19:23
  • 2
    @percusse gitinfo adds the info to the pdf not to the source. – Ulrike Fischer Feb 03 '16 at 19:28
  • @UlrikeFischer Yes and the rest is also possible with the git structure. With file extensions there is no problem at all. So all is possible – percusse Feb 03 '16 at 19:30
  • 2
    The whole point of using git is so that you do not need to keep different folders for different versions. I use git with my latex files. I have one repository per project (paper, book, thesis etc) and different branches for different "versions" of the project (draft 1, draft 2,sent to coauthors,..., submitted etc). The directory structure that I use is dictated by the project. For a paper typically I have one directory and one file. For a book, a main directory, possibly with subdirectories, containing the relevant files. I recommend combining git with latexdiff. –  Feb 10 '16 at 07:46
  • Related from SoftwareRecs: "Simple versioning for plain-text documents (Linux)" - first answer quite detailed on git for plain text document version control. Also, linked in the Academia.SE Q&A noted above, "git + LaTeX workflow" on SO. – Dɑvïd May 10 '16 at 10:01

1 Answers1

1
Whats about this?

Core
-- animate
------ timeline
------ singlefigures
-- attachments (files to include)
-- audio (for mp3s which can be included in the pdf)
-- bibliography
-- content
------ codelisting
------ glossar
------ hypernation
------ titlepage
------ cites
-- doc
-- figures
------ frontimage
------ symbols
------ tex
------ pdf (pdf created by tex all the time)
------ pdf-export (tikz externalize method or similar)
------ pdf-static (static pdf which wont change)
------ gnuplot
-- performancelog
-- preamble
------ subfolder (for commands and packagesettings)
-- searchstring
-- statistics
-- tables
-- videos