Tag Info

Hot answers tagged

67

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 ...


56

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 ...


47

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" ...


40

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.


38

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 ...


38

Using revision control makes you unafraid to make radical changes to your document. As one of my friends, Peter Boothe, put it, you can now freely throw away bits and pieces, secure in the knowledge that if you actually want them back, they are there in the revision control system. Interestingly, almost nobody actually uses this feature. Revision control ...


35

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 ...


35

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@ ...


27

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 ...


26

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 ...


21

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 ...


21

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 ...


21

Use the same editor you are using today, and use subversion with tortoise svn. Tortoise is a simple and good windows explorer extension.


20

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 ...


18

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 ...


17

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 ...


17

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 ...


17

Dropbox or a similar service?


17

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. ...


14

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 ...


13

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 ...


13

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 ...


13

I find git branching model to be useful when I am maintaining two versions of the same document, say a one column version for peer review and a two column version for the final draft. But I follow a branch and rebase strategy rather than branch and merge. The journals that I publish in to require the authors to submit both the one column and two column ...


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 ...


12

I wish I could say TeXShop, my editor of choice, but I can't. There's always emacs and Eclipse.


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.


11

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/


11

You can use package catchfile to store the contents of a file in a macro: \documentclass[letterpaper,12pt]{article} \usepackage[pdftex,colorlinks=true,hidelinks]{hyperref} \usepackage{catchfile} \usepackage{trimspaces} \CatchFileDef{\GitHash}{contains_git_hash.txt}{} \makeatletter \trim@spaces@in\GitHash \makeatother \hypersetup{ pdftitle={A method ...


11

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 ...


10

You can run custom commands in Texmaker (User -> User Commands) as well as TeXstudio (Configure -> Build -> User Commands). With that it should be possible to call Git command line tools from within the editor. Moreover in TeXstudio, you can combine this with scripting and triggers, which allows you to automatically trigger these actions e.g. on ...



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