Tag Info

Hot answers tagged

51

I'm also someone who uses version control as a single user. All of Caramdir's reasons are ones that I agree with, and I'll add the following: Tagging. When I send a paper off to a journal, I can "tag" that version and so even if I make my own improvements in the meantime, when I get the referee's report back then I can easily revert to the version that ...


45

As a single user the main advantages are Automatic backups: If you accidentally delete some file (or part of a file) you can undelete it. If you change something and want to undo it, the VCS can do so. Sharing on multiple computers: VCSes are designed to help multiple people collaboratively edit text files. This makes sharing between multiple computers ...


37

Yes, there are packages called svn and svninfo, as well as a few for other version-control systems. See the UK TeX FAQ: you can have something like \SVNdate $Date$ which will use the value of the Date SVN variable in your document, or have footers containing the date and version number in the document. I don't think either of them shows diffs, though.


34

Do you mean something like the following? ~/bin/git-latexdiff #!/bin/bash TMPDIR=$(mktemp -d /tmp/git-latexdiff.XXXXXX) latexdiff "$1" "$2" > $TMPDIR/diff.tex pdflatex -interaction nonstopmode -output-directory $TMPDIR $TMPDIR/diff.tex evince $TMPDIR/diff.pdf rm -rf $TMPDIR ~/.gitconfig [difftool.latex] cmd = git-latexdiff "$LOCAL" "$REMOTE" ...


34

I am using todonotes with enlarged margins. You just enlarge the size of your document and one margin, but you keep the textwidth the same. You need to use the geometry package for that. I actually wrote a blogpost about it. A nice point about todonotes is that they are configurable (you can change the colour & background colour of your notes), that ...


29

The reason for an ignore file list is the following. When your VCS spots a file in the directory that it isn't versioning, it tells you about it (politely). For example, in one of my directories then running bzr status, I get the following message: tex.SE% bzr status unknown: Project/ braids.sty@ bzr_test/ lessonplan.cls@ lessonplan.sty@ ...


28

For systems like CVS or Subversion, which modify source files, the TeX FAQ's bare-bones answer is my favourite: \def\RCS$#1: #2 ${\expandafter\def\csname RCS#1\endcsname{#2}} \RCS$Revision: 1.13 $ % or any RCS keyword \RCS$Date: 2010/04/02 18:20:00 $ ... \date{Revision \RCSRevision, \RCSDate} It's not very sophisticated, but you're only going to use it ...


24

For the last part of your question, I like the Perl script latexdiff. This generates LaTeX documents displaying linebreak-insensitive differences, with changebars and other visual markup. (Alas, the implementation is quite hacky, relying on complex regular expressions for parsing, so it's worth ensuring one has Perl 5.8.10 or later installed for greater ...


22

For Git and Mercurial the only packaged option for writing revision information to the output document is the vc-bundle, which works without keyword substitution by writing to an \input’ed file. For rendering a diff document a commit hook could be used that calls latexdiff-vc. Just inspecting diffs word-based instead of line based can be done with wdiff, or ...


17

I use the changes package, which allows authors to mark their changes and makes them colourful and so easier to spot. There's also the latexdiff program which is a bit like running diff except that you can process the output via LaTeX and get a more useful way of displaying the differences, (see also ldiff). One tip if you're using non-LaTeX-specific tools ...


17

LaTeX and its packages produce a variety of auxiliary files. There are also some external tools which create their own files. Then there is the set of output files generated by (La)TeX like DVI, PS and PDF files which you may or may not want to put under version control. Normally you don't. The reason some extension are missing in some lists is because the ...


13

My 2 cents (from experience with my thesis + several papers): even if your coauthors don't use version control, use it alone for your own work. typical workflow: give the .tex to your advisor, tell him to modify the source file directly, and forget about macros to mark differences manually. Whenever you get a revised version back from him, check it in. ...


13

Use a version control system, then you'll be also protected from your own errors in editing. Distributed VCSes have nice sync mechanism (pull/push), so you can easily copy it to various locations and then have them in sync. Not to mention you can use some online service like GitHub or Bitbucket, quite complete list for Git, for Hg, for Bzr. Some of them ...


13

First off, you may not want to use LaTeX directly if you want to use it as a whiteboard to develop ideas. You may be better off using Org-mode to draft your paper. You can embed LaTeX in Org-mode and you will probably be more effective than using LaTeX directly. The details on using Org-mode for drafting are not hard to learn, especially if you already use ...


12

Since this question is frequently visited: Here is a blogposting on a really great batch script here. The maintainer says: Latexbatchdiff A bash script that utilizes the brilliant perl script “latexdiff” in a latex project that is maintained in git. It does support multiple pdf files, and it automatically creates the pdf. You can get a ...


12

This is svn but any command line is the same. Depending on your configuration you probably need pdflatex --enable-write18 filename to enable \write18 to be a hook to execute shell commands. this writes to a temporary file using the shell escape, then inputs it \documentclass{article} \begin{document} \immediate\write18{svn info \jobname.tex | grep ...


11

Auctex on Emacs: SubVersion, Emacs Wiki page; Auctex, same place. The other editor, Vim, has a Subversion plugin. Vim does have special support for editing Latex &c, but it's not such a polished offering. Both Emacs and Vim work well on Windows. Take a look at the GNU FAQ for Emacs on Windows.


10

Git has nifty options to do diffs like you want =) http://idnotfound.wordpress.com/2009/05/09/word-by-word-diffs-in-git/ Also consider this tip to store preamble as a git submodule: http://markelikalderon.com/2008/07/31/keeping-your-latex-preamble-in-a-git-submodule/


10

You can probably hack it with something like this (I'm not sure if it would work). You may have to split the TeX file into the wrapper for the paper, and the body for the paper. In the wrapper for the paper, include the comment package, and set \usepackage{comment} \includecomment{bodyOfText} \includecomment{paraA} \includecomment{paraB} % One for each ...


10

My setup is one repository per document (article/thesis/book/presentation). Advantages, with respect to the "one repository to rule them all": you can share and sync the individual repositories with the colleagues you are working with. If some of them prefer another version control software, no problem, you use whatever they like. you can check out ...


10

I hesitate to say this, but I think you're doing it wrong; but you're close to what is, I think, needed. The purpose of a branch is to separate an activity, not a structural component. Thus, I would not have a branch for the "Introduction" file, but for the process "Develop the Introduction". This branch might include, for example, changes not only to ...


10

The username may not have a space. this runs without error \documentclass{article} \usepackage{svninfo} \begin{document} \svnInfo $Id: doc.tex 8 2013-04-11 19:37:31Z UserName $ %<= Id keyword substituted by svn \end{document} Since Windows user name allows spaces, you can let svnInfo allow them as well. this seems to work: ...


9

Keyword substitution is frowned on by revision control purists and is not facilitated in some modern systems such as Git and Darcs. Solution recommended to me is to have a script generate the information and then write it to a file. Then add the information from file using \input.


9

For me, one of the main reasons for using a VCS is to avoid cluttering my working directory with lots of mainly useless files with cryptic filenames like: mydocument20103001.tex mydocument20103001aa.tex mudocument20091221.tex mydocument20091221jonsversion.tex With such a system, it is hard to keep track of which changes occurred in which version. It ...


9

If it is just a few really important files, one simple way to do it is just to periodically tar the whole collection and e-mail it to a G-Mail account. On a unix/linux box you can automate this with a simple shell script. With 7G of storage, you are unlikely to run out of space, and with e-mail it is directly time-stamped and retrieval (even from another ...


9

I know coded the following Perl script which calls svn diff in summary mode to get the changed files. It extracts these using svn cat into two different directories and calls latexdiff on each modified file. It modifies the TEXINPUTS variable to load files first from the diff directory instead of the current one. This avoids the copying of all unchanged ...


9

Quite a few modules create their own auxiliary files. For example, you might also clean: *.lol (list of listings); *.ps (if it's not your final format); *.idv and *.lg; *.4tc, *.4ct, *.xref if you use tex4ht; In general, what I do is that I version all my source files. When I use new modules (or new renderers), after cleaning my code with make clean, I ...


9

I agree with ShreevatsaR's comment. For most projects, very few of these are actually generated - it depends what packages you decide to include. So I start off with an empty .gitignore and add only the ones that I actually see appearing when I compile my TeX files. Also, sometimes it's not appropriate to add an extension to the .gitignore willy-nilly. For ...


9

This isn't an optimistic answer, nor, probably, a very good one. It is based on my experience using git, and the accidents I had while trying to use git to manage different configurations within a number of projects. Why I think rebase isn't the answer I believe that the philosophy of version control systems is directed at linear development with ...


8

For diffing, I have successfully used the following approach. This is not Latex-aware, but it seems to work very well with Latex documents (and Bibtex files, too). I have used it both on Linux and Mac OS X. It is word-based and hence does not care about line breaks. For example, you can have each paragraph as a very long line in your source code; even then, ...



Only top voted, non community-wiki answers of a minimum length are eligible