<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Cobra's bits (Posts about latex)</title><link>https://cobra.pdes-net.org</link><description></description><atom:link href="https://cobra.pdes-net.org/categories/latex.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2023 &lt;a href="mailto:najahannah@gmail.com"&gt;Cobra&lt;/a&gt; 
&lt;a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/"&gt;
&lt;img alt="Creative Commons License BY-NC-SA"
style="border-width:0; margin-bottom:12px;"
src="../images/by-nc-sa.svg"&gt;&lt;/a&gt;</copyright><lastBuildDate>Sun, 21 May 2023 14:39:06 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>latexdiff-vc</title><link>https://cobra.pdes-net.org/posts/latexdiff-vc.html</link><dc:creator>Cobra</dc:creator><description>&lt;p&gt;Since my &lt;a class="reference external" href="https://cobra.pdes-net.org/posts/collaboration.html"&gt;first post on version control systems (VCS) and latexdiff&lt;/a&gt;, the whole kaboodle has become much easier for the user. Instead of looking for some python scripts to ease the generation of diffs, latexdiff itself offers this functionality. For example,&lt;/p&gt;
&lt;pre class="literal-block"&gt;latexdiff-vc --hg --pdf -r 0 example.tex&lt;/pre&gt;
&lt;p&gt;will create a diff between the original(-r 0) and current version of example.tex handled by mercurial (--hg), and compile the resulting diff by pdflatex (--pdf).&lt;/p&gt;
&lt;p&gt;Even better, latexdiff supports multi-file documents, the use of which is highly advisable for dissertations and books or other long documents. The workflow is simple: as usual, we create the repository and add files to it, but this time &lt;em&gt;all&lt;/em&gt; files have to be included:&lt;/p&gt;
&lt;pre class="literal-block"&gt;hg init
hg add master.tex file1.tex ... filei.tex ... filen.tex
hg commit -m "Initial version"&lt;/pre&gt;
&lt;p&gt;And after editing an arbitrary file:&lt;/p&gt;
&lt;pre class="literal-block"&gt;hg commit -m "Did this or that"
latexdiff-vc --hg --pdf --flatten -r 0 master.tex&lt;/pre&gt;
&lt;p&gt;Voilà, here's your compiled diff. 😎&lt;/p&gt;
&lt;p&gt;As a sidenote: I have seen way too many students trying to compile the active chapter of their dissertation, just to realize that only the master file including their active chapter can be compiled. Hence, they classical sequence: compile – oops, switch tabs, compile, switch tabs, edit, compile – oops, etc. etc. ad nauseum. Except for masochistically inclined witers, there's a simpler and better way.&lt;/p&gt;
&lt;p&gt;Indeed, many specialized LaTeX editors (TeXWorks, TeXStudio) and also several of the most prominent general programming editors with a LaTeX extension (Sublime Text with LaTeX Tools, VS Code with LaTeX Workshop, Vim with Vimtex ...) respect the following magic command at the top of the active chapter:&lt;/p&gt;
&lt;pre class="literal-block"&gt;% !TeX root = master.tex&lt;/pre&gt;
&lt;p&gt;Only Emacs with auctex needs a slightly different syntax:&lt;/p&gt;
&lt;pre class="literal-block"&gt;% -*- TeX-master: "master.tex" -*-&lt;/pre&gt;
&lt;p&gt;After setting this command, you can just type and compile, and your focus will not be distracted any longer by the compilation cycle sketched above.&lt;/p&gt;</description><category>latex</category><category>presentations</category><guid>https://cobra.pdes-net.org/posts/latexdiff-vc.html</guid><pubDate>Mon, 03 Oct 2022 12:47:34 GMT</pubDate></item><item><title>Modern times</title><link>https://cobra.pdes-net.org/posts/modern-times.html</link><dc:creator>Cobra</dc:creator><description>&lt;p&gt;Since the beginning of time (or so it seems), I've had &lt;a class="reference external" href="https://en.wikipedia.org/wiki/Emacs"&gt;Emacs&lt;/a&gt; installed with the extension &lt;a class="reference external" href="https://en.wikipedia.org/wiki/AUCTeX"&gt;AUCTeX&lt;/a&gt; to handle LaTeX documents. And, mind you, I'm still using it from time to time! As a matter of fact, in 2018 I've worked on a number of manuscripts exclusively with Emacs to prepare myself for the editor shootout I've &lt;a class="reference external" href="https://cobra.pdes-net.org/posts/yay.html"&gt;promised&lt;/a&gt; for the end of 2018 (and which may or may not be done by the end of this year). I'm still quite happy with it, that much I can say already now.&lt;/p&gt;
&lt;p&gt;Perhaps you can then understand my surprise when &lt;a class="reference external" href="https://cobra.pdes-net.org/posts/yay.html"&gt;yay&lt;/a&gt; told me that AUCTeX has been orphaned on the AUR. I was even more surprised when I saw that the maintainer was Stefan Husmann, who is also the maintainer of several hundred other packages and a moderator on the &lt;a class="reference external" href="https://bbs.archlinux.de/"&gt;German Archlinux forum&lt;/a&gt;. Not the guy to thoughtlessly abandon a package on a mere whim.&lt;/p&gt;
&lt;p&gt;And then it hit me: of course! Emacs has got it's own package manager (&lt;a class="reference external" href="https://elpa.gnu.org/"&gt;ELPA&lt;/a&gt;) some time, well, perhaps two years ... &lt;a class="reference external" href="https://lists.gnu.org/archive/html/info-gnu-emacs/2012-06/msg00000.html"&gt;actually, eight years ago&lt;/a&gt;. 😣&lt;/p&gt;
&lt;p&gt;So what's the meaning of this post? Let's say that there're one billion computer users out there. Only one percent of these know what an editor is, and only one percent of these again are actually using one. Of these again, only one percent use Emacs. Once again one percent of these Emacs users use AUCTeX, but more than 80% of these guys have installed AUCTeX via ELPA, the recommended and canonical way. I'm not one of them. Am I the only one? No, if we do the math, it turns out that there's one kindred spirit who is in the same situation like me. This post is for you, my brother in arms!&lt;/p&gt;
&lt;p&gt;Well, as stated above, Emacs recommends installing AUCTeX via ELPA. After removing AUCTeX from the AUR, we can install manually&lt;/p&gt;
&lt;pre class="literal-block"&gt;M-x package-install RET
auctex&lt;/pre&gt;
&lt;p&gt;or, in a properly maintained init.el (like mine), automatically:&lt;/p&gt;
&lt;pre class="literal-block"&gt;(require 'package)

(add-to-list 'package-archives
        '("melpa" . "`https://melpa.org/packages/" &amp;lt;https://melpa.org/packages/"&amp;gt;`_))

(package-initialize)
(when (not package-archive-contents)
        (package-refresh-contents))

(defvar myPackages
   '(better-defaults
         material-theme
         ein
         elpy
         flycheck
         py-autopep8
         ac-math
         auctex
         auto-complete-auctex
         ))

(mapc #'(lambda (package)
        (unless (package-installed-p package)
          (package-install package)))
          myPackages)&lt;/pre&gt;
&lt;p&gt;&lt;a class="reference external" href="https://tex.stackexchange.com/questions/450956/cannot-load-preview-latex-despite-auctex-already-installed"&gt;and&lt;/a&gt;&lt;/p&gt;
&lt;pre class="literal-block"&gt;;;(load "auctex.el" nil t t)
;;(load "preview-latex.el" nil t t)&lt;/pre&gt;
&lt;p&gt;While I was pondering the question whether this post would be relevant for anybody at all, I found these news: &lt;a class="reference external" href="http://www.pell.portland.or.us/~orc/Code/levee/"&gt;Levee, a vi clone, has got a new major release after 30 years&lt;/a&gt;. Now that's the spirit! Compared to the estimated number of users interested in this update (interestingly, the &lt;a class="reference external" href="https://aur.archlinux.org/packages/levee/#comment-759865"&gt;only comment&lt;/a&gt; in the AUR is from Stefan Husmann), my post is for the masses. To celebrate this Chucknorishness of software development, I've installed levee and prepared this text in it. It was ok (just like vi), but David Parsons will certainly understand if I say that I prefer vim for everyday work.&lt;/p&gt;</description><category>desktop</category><category>latex</category><category>linux</category><guid>https://cobra.pdes-net.org/posts/modern-times.html</guid><pubDate>Sat, 05 Sep 2020 11:52:22 GMT</pubDate></item><item><title>One does not simply exit vim</title><link>https://cobra.pdes-net.org/posts/one-does-not-simply-exit-vim.html</link><dc:creator>Cobra</dc:creator><description>&lt;p&gt;A few days ago, stackoverflow has hit a major milestone: &lt;a class="reference external" href="https://stackoverflow.blog/2017/05/23/stack-overflow-helping-one-million-developers-exit-vim/"&gt;the community has helped one million developers to exit vim.&lt;/a&gt; If that isn't reason for celebration, nothing is.&lt;/p&gt;
&lt;p&gt;'Of course, these aren't real programmers, since those use something else entirely.'&lt;/p&gt;
&lt;p&gt;Surely the &lt;a class="reference external" href="https://www.gnu.org/fun/jokes/ed-msg.html"&gt;mighty ed?&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;'&lt;a class="reference external" href="https://xkcd.com/378/"&gt;Not even close.'&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;For those still interested in the grandfather of vi (aka &lt;a class="reference external" href="https://en.wikipedia.org/wiki/Ed_(text_editor)"&gt;the most user-hostile editor ever created&lt;/a&gt;): here's an excellent little &lt;a class="reference external" href="https://sanctum.geek.nz/arabesque/actually-using-ed/"&gt;tutorial.&lt;/a&gt; By the way, you can exit ed by the canonical quit command of Unix applications: q. Much more intuitive than vim!&lt;/p&gt;
&lt;p&gt;I'll write about the editors I'm using (and why) in the near future.&lt;/p&gt;</description><category>latex</category><category>linux</category><guid>https://cobra.pdes-net.org/posts/one-does-not-simply-exit-vim.html</guid><pubDate>Fri, 26 May 2017 12:06:37 GMT</pubDate></item><item><title>LaTeX vs. Unicode</title><link>https://cobra.pdes-net.org/posts/latex-vs-unicode.html</link><dc:creator>Cobra</dc:creator><description>&lt;p&gt;I'm using &lt;a class="reference external" href="http://pdes-net.org/cobra/posts/toolchain.html"&gt;matplotlib to create figures for my publications&lt;/a&gt;. For axes labels, legends, and everything else requiring text and symbols in a figure, I've so far used the excellent LaTeX support of matplotlib, and the results are (obviously) highly satisfactory:&lt;/p&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;br&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;img alt="../images/plot_tex.svg" src="https://cobra.pdes-net.org/images/plot_tex.svg" style="width: 600px;"&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;br&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;There's a disadvantage, though: there are not too many fonts to chose from. Naively, I thought that this limitation would be lifted if I wouldn't use LaTeX, but Unicode instead:&lt;/p&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;br&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;img alt="../images/plot_uc.svg" src="https://cobra.pdes-net.org/images/plot_uc.svg" style="width: 600px;"&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;br&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;And wouldn't XeLaTeX even combine the advantages of both?&lt;/p&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;br&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;img alt="../images/plot_xetex.svg" src="https://cobra.pdes-net.org/images/plot_xetex.svg" style="width: 600px;"&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;&lt;br&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;p&gt;As you can see, matplotlib allows you to use any of these options, but what you don't see is that the desired results can be achieved only with a very limited set of fonts. For example, there are only a few fonts that include the unicode character for a 'superscript minus' (for an overview, see &lt;a class="reference external" href="http://www.fileformat.info/info/unicode/char/207b/fontsupport.htm"&gt;here&lt;/a&gt;). Sadly, most of these are part of the &lt;a class="reference external" href="https://www.microsoft.com/typography/ClearTypeFonts.mspx"&gt;ClearType Font Collection,&lt;/a&gt; which was introduced by Microsoft with Windows Vista. Free fonts with a 'superscript minus' include Dejavu Sans, Free Sans, and Free Serif. If the 'superscript minus' is included instead as a command by employing the internal LaTeX support of matplotlib, many more fonts become accessible. Examples are shown in the table below. But even then one can't make any assumptions: while Source Sans Pro works fine, Source Serif Pro doesn't. I have no idea why.&lt;/p&gt;
&lt;p&gt;You see from my last statement that this post in not in the least authoritative. I'm just toddling around, and if you find a better way, I'd appreciate corrections and additions. That's particularly true for the case of XeLaTeX, the use of which seems to require OTF-only fonts with math table support. I wasn't even able to find a single Sans Serif font with this profile 😞 . Others have &lt;a class="reference external" href="http://tex.stackexchange.com/questions/96024/how-to-use-system-font-for-equation-in-xelatex"&gt;similar&lt;/a&gt; &lt;a class="reference external" href="http://tex.stackexchange.com/questions/118244/what-is-the-difference-between-unicode-math-and-mathspec"&gt;problems&lt;/a&gt;.&lt;/p&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;&lt;th class="head"&gt;&lt;p&gt;Renderer&lt;/p&gt;&lt;/th&gt;
&lt;th class="head"&gt;&lt;p&gt;Serif&lt;/p&gt;&lt;/th&gt;
&lt;th class="head"&gt;&lt;p&gt;Sans Serif&lt;/p&gt;&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;&lt;p&gt;LaTeX&lt;/p&gt;&lt;/td&gt;
&lt;td&gt;&lt;p&gt;Palatino, Fourier&lt;/p&gt;&lt;/td&gt;
&lt;td&gt;&lt;p&gt;Kurier, CM Bright&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;p&gt;Unicode&lt;/p&gt;&lt;/td&gt;
&lt;td&gt;&lt;p&gt;Noto, Gentium Plus&lt;/p&gt;&lt;/td&gt;
&lt;td&gt;&lt;p&gt;Open Sans, Source Sans Pro&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;p&gt;XeLaTeX&lt;/p&gt;&lt;/td&gt;
&lt;td&gt;&lt;p&gt;Libertinus, XITS&lt;/p&gt;&lt;/td&gt;
&lt;td&gt;&lt;p&gt;?&lt;/p&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Finally, &lt;a class="reference external" href="http://pdes-net.org/scripts/plot.tar.xz"&gt;here's an archive&lt;/a&gt; containing the three scripts I've used to create the figures above. In each case, I let matplotlib render a pdf, convert that into an svg by pdftocairo, and compress this svg files by gzip:&lt;/p&gt;
&lt;pre class="literal-block"&gt;./plot_uc.py
pdftocairo -svg plot_uc.pdf plot_uc.svg
gzip -S z plot_uc.svg&lt;/pre&gt;
&lt;p&gt;The results are compressed scalable vector graphics that are fully compatible with inkscape if a post-processing should be necessary. That's how I got the &lt;a class="reference external" href="https://en.wikipedia.org/wiki/File:Unicode_logo.svg"&gt;unicode logo&lt;/a&gt; in, by the way. 😉&lt;/p&gt;</description><category>latex</category><category>presentations</category><guid>https://cobra.pdes-net.org/posts/latex-vs-unicode.html</guid><pubDate>Sun, 13 Nov 2016 10:03:52 GMT</pubDate></item><item><title>In the old days</title><link>https://cobra.pdes-net.org/posts/in-the-old-days.html</link><dc:creator>Cobra</dc:creator><description>&lt;p&gt;Research places like the one I'm associated with are characterized by a constant turnover of personnel. Currently, our 20 senior scientists are supported by about 50 assistant and associate researchers on temporary positions. Our annual turnover rate is thus as high as 30 to 40%, meaning that I meet about 15 to 20 new people every year.   &lt;/p&gt;
&lt;p&gt;The level of understanding in physics and material science fluctuates, but does not seem to deteriorate over the years. That's the good news. What does decline significantly is the ability to read and write and to use a computer efficiently. At the same time, the fraction of people with an undue sense of entitlement is growing dramatically.&lt;/p&gt;
&lt;p&gt;What do I call an “undue sense of entitlement”? Well, imagine. It's your first day at a new place where you hope to perform top-notch research yielding results important enough to publish them in prestigious journals. You are shown into your office, which you share with some more experienced colleagues, and on your desk sits a brand-new 24 inch Full-HD display connected to an equally brand-new desktop computer.  And exactly that's the moment when you demand, loud and clear, two monitors. The bigger the better! And an hour later, you call our IT service to demand the real Office. And Photoshop! When the IT freaks ask for which purpose you need this software, you most strongly express your righteous indignation. First of all, that's none of his business, and second, that should be obvious! After all, you have letters to write. And later, there may be images whose contrast needs to be increased. &lt;/p&gt;
&lt;p&gt;Now, that's exactly what you would do, right? &lt;/p&gt;
&lt;p&gt;No, of course not. No halfway sensible person would behave in this way. Alas, every year we get more and more young people with this attitude. Experience tells us that the people demanding the most are the ones returning the least. They also tend to create constant trouble: they are more concerned with their own self-importance than with their research, and are generally ignorant, obnoxious, and unproductive.  &lt;/p&gt;
&lt;p&gt;I still vividly remember my own time as a PhD student at the &lt;a href="http://de.wikipedia.org/wiki/Max-Planck-Institut_f%C3%BCr_Festk%C3%B6rperforschung"&gt;MPI-FKF&lt;/a&gt;. I had previously written my diploma thesis on an &lt;a href="http://www.hpmuseum.net/images/VectraWith35741B-38.jpg"&gt;HP Vectra&lt;/a&gt;, an &lt;a href="https://en.wikipedia.org/wiki/IBM_Personal_Computer/AT"&gt;IBM AT compatible,&lt;/a&gt; which I had to share with the six or seven members of our research group. At the weekends, I also had access to my own computer, an &lt;a href="https://en.wikipedia.org/wiki/PC1512"&gt;Schneider PC1512&lt;/a&gt; that I primarily used for running Pascal programs. God, did it feel slow compared to the Vectra at work! At the MPI, however, computing was not yet “personal”. Instead, &lt;a href="https://en.wikipedia.org/wiki/VT220"&gt;VT220&lt;/a&gt; text terminals were offered for the interaction with the &lt;a href="https://en.wikipedia.org/wiki/VAX_6000"&gt;VAX&lt;/a&gt; station in the basement. I'd say we had perhaps 20 terminals for about 300 scientists. &lt;/p&gt;
&lt;p&gt;Basically, these terminals were used for three essential tasks. First, one could receive and send e-mails using the 'mail' program. That was my first contact with the Internet and I found it exciting! Second, we wrote our manuscripts using &lt;a href="https://en.wikipedia.org/wiki/EVE_(text_editor)"&gt;EVE,&lt;/a&gt; the &lt;a href="http://www.livingcomputermuseum.org/Online-Systems/User-Documentation/OpenVMS-7-3-(VAX-11-785)/3_(Editor)_EVE.aspx"&gt;extensible versatile editor,&lt;/a&gt; compiled them with &lt;a href="LaTeXhttps://en.wikipedia.org/wiki/LaTeX"&gt;LaTeX&lt;/a&gt;, converted the resulting &lt;a href="https://en.wikipedia.org/wiki/Device_independent_file_format"&gt;dvi&lt;/a&gt; file to postscript with &lt;a href="https://en.wikipedia.org/wiki/Dvips"&gt;dvips&lt;/a&gt;, and used &lt;a href="https://en.wikipedia.org/wiki/Line_Printer_Daemon_protocol"&gt;lpr&lt;/a&gt; to send the postscript output to one of the three or four Hewlett-Packard &lt;a href="https://en.wikipedia.org/wiki/Laserjet#1980s"&gt;LaserJets&lt;/a&gt; located at strategic locations (mine was close to the beer machine¹) in the institute. The VT220 could not display any graphics, so we had to print to see if our LaTeX code did what we wanted! Third, EVE was also used to write FORTRAN code, and there were always a number of computations running on our VAX. I do not remember which model we had, but &lt;a href="http://www.roylongbottom.org.uk/mips.htm#anchorDEC"&gt;a VAX 6360 from 1988&lt;/a&gt; had six processors clocked at 16.7 MHz and an estimated performance of 22 &lt;a href="https://en.wikipedia.org/wiki/Instructions_per_second#Millions_of_instructions_per_second_.28MIPS.29"&gt;MIPS&lt;/a&gt;, all for a meager $752K. A high-end smartphone is easily 1000 times as fast. &lt;/p&gt;
&lt;p&gt;Just that you have an idea of how it feels to work on a VT220, here's an impression recorded by &lt;a href="http://jstn.cc/post/8692501831"&gt;jstn.&lt;/a&gt; The little cube on the left is the VT220 displaying a terminal of the Mac Pro it is connected to.  &lt;/p&gt;
&lt;p&gt;&lt;img alt="" src="https://cobra.pdes-net.org/images/vts220.png"&gt;&lt;/p&gt;
&lt;p&gt;Between January 1990 and September 1991, I wrote 10 manuscripts on this little cube as the first author (all of which got published) followed by my dissertation which I've submitted just before Christmas 91. How I did that? Instead of complaining, I typed. &lt;/p&gt;
&lt;p&gt;¹ Yes, you heard right: we had a beer machine. All right, it was actually a standard soda machine, but it offered two kinds of beer in addition to Coke and Co.: Stuttgarter Hofbräu &lt;a href="http://www.stuttgarter-hofbraeu.de/produkt-sortiment/stuttgarter-hofbraeu/herren-pils-05/"&gt;Pils&lt;/a&gt; and &lt;a href="http://www.stuttgarter-hofbraeu.de/produkt-sortiment/stuttgarter-hofbraeu/export/"&gt;Export&lt;/a&gt;, if I remember correctly. The machine was heavily frequented and we had the most illuminating discussions in the park just outside the canteen, where the beer machine—and the printer—were located. Many great ideas originated from these discussions. Nowadays, where people wear a helmet when going to the loo, that's unimaginable.&lt;/p&gt;</description><category>hardware</category><category>info</category><category>latex</category><category>thoughts</category><guid>https://cobra.pdes-net.org/posts/in-the-old-days.html</guid><pubDate>Sat, 03 Sep 2016 12:43:46 GMT</pubDate></item><item><title>Long-time support</title><link>https://cobra.pdes-net.org/posts/long-time-support.html</link><dc:creator>Cobra</dc:creator><description>&lt;p&gt;LaTeX files with a bibliography (or an index) require several compiler passes to resolve all references for building:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;latex paper.tex
bibtex paper.aux
latex paper.tex
latex paper.tex
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Tedious, isn't it? For that reason, wrappers have been invented, automating this procedure. The veterans on this field are &lt;a href="http://users.phys.psu.edu/~collins/software/latexmk-jcc/"&gt;latexmk&lt;/a&gt; and &lt;a href="https://launchpad.net/rubber/"&gt;rubber&lt;/a&gt;, but there are &lt;a href="http://tex.stackexchange.com/questions/64/tools-for-automating-document-compilation/26573#26573"&gt;several others,&lt;/a&gt; including &lt;a href="https://bloerg.net/2014/10/31/a-better-latex-driver.html"&gt;a new kid on the block&lt;/a&gt; called &lt;a href="https://github.com/aclements/latexrun"&gt;latexrun&lt;/a&gt; that sounds truly promising.  &lt;/p&gt;
&lt;p&gt;I've used rubber for many years, despite the fact that its development had stalled nine years ago. Rubber has worked for me since scientific publishers are ... ahem ... extremely conservative: they will probably stick to the pdflatex/bibtex workflow for the next few centuries (or forever, whatever comes earlier).&lt;/p&gt;
&lt;p&gt;However, for documents not intended for submission to a publisher, I've long ago switched to XeLateX/Biber&lt;a href="https://cobra.pdes-net.org/posts/long-time-support.html"&gt;.&lt;/a&gt; For example, my curriculum vitae is to be compiled with these engines rather than with their prehistoric ancestors. Since it is technically identical to its template, you can download &lt;a href="http://www.latextemplates.com/template/friggeri-resume-cv"&gt;Adrien's CV&lt;/a&gt; to test the wrapper you want to use. &lt;/p&gt;
&lt;p&gt;The following commands should compile this CV in a single run, including the bibliography:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;latexmk --xelatex --synctex=1 --silent cv.tex

rubber --module xelatex --module biber --synctex cv.tex

latexrun --latex-cmd xelatex --bibtex-cmd biber cv.tex
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;In July 2015, only latexmk managed to do that, while rubber 1.2 failed despite my manual addition of &lt;a href="https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=579757"&gt;XeLaTeX&lt;/a&gt; and &lt;a href="http://tex.stackexchange.com/questions/46133/using-biber-with-gedit-rubber"&gt;Biber&lt;/a&gt; support. I was only mildly disappointed: after all, rubber had become lame and grey, and I realized that it was time to leave it behind. I was surprised, though, that latexrun, the newly developed contender, failed as well.&lt;/p&gt;
&lt;p&gt;Now, to my absolute astonishment, the rubber project suddenly became alive again this year. After nine years of inactivity, rubber 1.3 was published in October, and 1.4 just a few days ago. Rubber 1.4 passed the test above with flying colors, and twice as fast as latexmk. What's more, SyncTeX support, which I previously &lt;a href="https://bugs.launchpad.net/ubuntu/+source/rubber/+bug/414431/comments/4"&gt;smuggled in manually&lt;/a&gt;, has now been added to the rubber feature list as well. &lt;/p&gt;
&lt;p&gt;Rubber thus manages to once again take the crown of LaTeX wrappers, with latexmk just seconds behind (literally) because of its inferior performance. Latexrun in its present state leaves much to be desired, but I'll keep an eye on its further development (if any 😉 ).&lt;/p&gt;</description><category>latex</category><guid>https://cobra.pdes-net.org/posts/long-time-support.html</guid><pubDate>Sun, 27 Dec 2015 13:18:19 GMT</pubDate></item><item><title>Résumés and indices</title><link>https://cobra.pdes-net.org/posts/rsums-and-indices.html</link><dc:creator>Cobra</dc:creator><description>&lt;p&gt;I receive a constant flow of applications for PhD student and postdoc positions. A quick check of my trash folder in kmail reveals that the number of applications over the past 4 month is at least 27. Including the 3 I didn't trash, this number means that I receive about 90 applications per year.&lt;/p&gt;
&lt;p&gt;Fortunately, I don't have to spent much time (&amp;lt;10 s) with most of them. Over the years, I established the following policy:&lt;/p&gt;
&lt;p&gt;(i) If the application is not send to me, but to unspecified recipients: trash it.&lt;br&gt;
 (ii) If the cover letter starts with 'Dear Professor' without explicitly referring to a specific person, or with 'Dear Professor Paul Drude' and thus referring to the wrong guy, or with 'Dear Professor Braudd' or any other sad imitation of my actual name: trash it.&lt;br&gt;
 (iii) If the cover letter has no reference to where I work, or what I do: trash it.&lt;br&gt;
 (iv) If the cover letter contains several grammatical or typographical errors: trash it.&lt;/p&gt;
&lt;p&gt;If the applicant has come that far, I will at least send a brief mail informing him or her that we don't have a position available at the moment. In the unlikely case that we are indeed looking for somebody at this very moment, I'll have a quick (!) look at the attached résumé or curriculum vitae. What I see then is often pathetic — poorly formatted Word files with more grammatical errors and typos than you'd expect even from a mediocre high school student — and rarely informative: Chinese applicants frequently refer to their role as 'model student of the year' and their perfect command of the English language, while their Indian counterparts seem to view their enthusiasm for cricket as essential information.&lt;/p&gt;
&lt;p&gt;In some cases, however, I'm pleased by what I see. An astonishingly high number of these outstanding cases are prepared by applicants in German-speaking countries using the 'moderncv' class of LaTeX. This choice not only guarantees a well-structured and aesthetically pleasing résumé, but is also certain to register as a proof that the applicant has no problem dealing with LaTeX (which is definitely a plus in the natural sciences).&lt;/p&gt;
&lt;p&gt;The disadvantage is that applications based on moderncv in its default configuration all look the same, and lack any obvious individual characteristics. For me, that's such a serious drawback that I do not use the moderncv class for my own résumé but instead still the one I've improvised 25 years ago based on the article style and doing all formatting with the tabbing environment. Now, I'm not looking for a job, but I still need to attach my résumé to project applications, and at times I'm musing about how nice it would be to start from scratch and base my résumé on a more modern foundation.&lt;/p&gt;
&lt;p&gt;Well, at a lazy afternoon I searched the net and came across &lt;a href="http://www.latextemplates.com/cat/curricula-vitae" title="several interesting templates"&gt;several interesting templates&lt;/a&gt; for a résumé or curriculum vitae. Technically, the template provided by &lt;a href="http://www.latextemplates.com/template/friggeri-resume-cv" title="Adrien Friggeri"&gt;Adrien Friggeri&lt;/a&gt; is very attractive: it employs TikZ for the header, XeTeX and fontspec to use an arbitrary otf font, and biblatex/biber to automatically print selected sets of publications. The design is on the edge of being extroverted, but that's easy to change.&lt;/p&gt;
&lt;p&gt;I'm currently playing a little with this template, and I'm really enjoying it. In particular, it never fails to impress me how much we can compress information in the digital age. We can put a world into a single link, and I wonder why I don't see that more often in applications from young (and thus 'digitally native') researchers.&lt;/p&gt;
&lt;p&gt;Here's one example:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://cobra.pdes-net.org/images/about.svg" width="210"&gt;&lt;/p&gt;
&lt;p&gt;All of the lines following 'about' are active links when viewed in a pdf reader. They show my identity as researcher from different perspectives, but foremost, they list my publications and citations. What could be more important?&lt;/p&gt;
&lt;p&gt;Here's another:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://cobra.pdes-net.org/images/indices.svg" width="400"&gt;&lt;/p&gt;
&lt;p&gt;Only one link, but an important one. And certainly, I would treat an application offering explicit values of the publication indices very favorably. 😉&lt;/p&gt;
&lt;p&gt;What are these indices? Well, they are more or less smart attempts to compress the 'value' of a certain scientist's research into a single number. The most popular and prominent one is the &lt;a href="http://en.wikipedia.org/wiki/H-index" title="h index"&gt;h index&lt;/a&gt;, which is criticized for several reasons, among them the fact that it &lt;a href="http://michaelnielsen.org/blog/why-the-h-index-is-virtually-no-use/" title="can be obtained"&gt;can be obtained&lt;/a&gt; from the number of citations (in my case, the agreement is almost perfect). The &lt;a href="http://en.wikipedia.org/wiki/G-index" title="g index"&gt;g index&lt;/a&gt; does not have this weakness, but is more difficult to estimate (I use a &lt;a href="https://github.com/gsbabil/Google-Scholar-Gindex" title="script"&gt;script&lt;/a&gt; for that). Finally, the &lt;a href="http://en.wikipedia.org/wiki/I10-index" title="i10 index"&gt;i10 index&lt;/a&gt; has been created by Google in the attempt to promote its Google scholar service. It's determination is trivial and essentially serves to distinguish wheat and chaff.&lt;/p&gt;
&lt;p&gt;None of these indices is free from weaknesses, and none of them alone provides a reliable impression on a researcher's performance. Taken together, however, these indices can reveal much.&lt;/p&gt;
&lt;p&gt;As an example, let's compare my indices to those of a valued colleague of about the same age: &lt;a href="http://scholar.google.de/citations?hl=de&amp;amp;user=p3b43FsAAAAJ&amp;amp;pagesize=100&amp;amp;view_op=list_works&amp;amp;cstart=100" title="Steven C. Erwin"&gt;Steven C. Erwin&lt;/a&gt;. At the time of writing, his h, g and i10 indices are 37, 79, and 77, respectively. Evidently, the first two of these indices are close to mine, but his i10 index is drastically lower. Hey...that looks good for me, right?&lt;/p&gt;
&lt;p&gt;It doesn't. Nearly equal g, but vastly differing i10 indices simply signify that the guy with the lower value for the latter (i.e., Steve) is more efficient: he publishes less trash which is immediately forgotten.&lt;/p&gt;
&lt;p&gt;If I would have to chose between Steve and me, I would take him. Fortunately, he's a theorist, and thus not of much use for anything. 😄&lt;/p&gt;</description><category>latex</category><category>presentations</category><category>thoughts</category><guid>https://cobra.pdes-net.org/posts/rsums-and-indices.html</guid><pubDate>Sun, 30 Mar 2014 16:01:09 GMT</pubDate></item><item><title>Automated LaTeX</title><link>https://cobra.pdes-net.org/posts/automated-latex.html</link><dc:creator>Cobra</dc:creator><description>&lt;p&gt;We've got several tools which intend to automate the generation of complex documents by LaTeX. Without these tools, the generation of a publication ready for submission would require several compiler passes to resolve all references for building, for example, the index and the bibliography. &lt;a href="http://tex.stackexchange.com/questions/64/tools-for-automating-document-compilation/26573#26573" title="This thread"&gt;This thread&lt;/a&gt; illustrates the problem and highlights some of the most popular of these tools.&lt;/p&gt;
&lt;p&gt;For my modest requirements, I've found that &lt;a href="https://launchpad.net/rubber/" title="rubber"&gt;rubber&lt;/a&gt; is perhaps the most convenient choice. Rubber seems not to be in active development any more, but does what it should in the most unobtrusive way (and support for XeLaTeX is &lt;a href="http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=579757" title="easy to add"&gt;easy to add&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;For the &lt;strong&gt;command line&lt;/strong&gt;, I use a simple makefile:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;&lt;span class="n"&gt;TEXFILE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;$&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;wildcard&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;tex&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;PDFFILE&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;$&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;TEXFILE&lt;/span&gt;&lt;span class="p"&gt;:.&lt;/span&gt;&lt;span class="n"&gt;tex&lt;/span&gt;&lt;span class="p"&gt;=.&lt;/span&gt;&lt;span class="n"&gt;pdf&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;VIEWER&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;mupdf&lt;/span&gt;

&lt;span class="nb"&gt;all&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;pdf&lt;/span&gt;

&lt;span class="n"&gt;pdf&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;$&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;PDFFILE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c"&gt;%.pdf: %.tex&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="n"&gt;rubber&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;pdf&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;$&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;
&lt;span class="n"&gt;clean&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="n"&gt;rubber&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;clean&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;$&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;TEXFILE&lt;/span&gt;&lt;span class="p"&gt;:.&lt;/span&gt;&lt;span class="n"&gt;tex&lt;/span&gt;&lt;span class="p"&gt;=)&lt;/span&gt;
&lt;span class="n"&gt;tidy&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="p"&gt;@&lt;/span&gt;&lt;span class="n"&gt;rubber&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;clean&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="n"&gt;pdf&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;$&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;TEXFILE&lt;/span&gt;&lt;span class="p"&gt;:.&lt;/span&gt;&lt;span class="n"&gt;tex&lt;/span&gt;&lt;span class="p"&gt;=)&lt;/span&gt;
&lt;span class="nb"&gt;view&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;pdf&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;$&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;VIEWER&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;$&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;PDFFILE&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;PHONY&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;pdf&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;clean&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;tidy&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nb"&gt;all&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;For &lt;strong&gt;vim&lt;/strong&gt;, I use &lt;a href="https://github.com/vim-scripts/TeX-PDF" title="TeX-PDF"&gt;TeX-PDF&lt;/a&gt; (and &lt;a href="https://github.com/vim-scripts/LaTeX-Box" title="LaTeX-Box"&gt;LaTeX-Box&lt;/a&gt; for command completion). TeX-PDF respects my makefile, if one is present, or uses rubber or even plain pdflatex as a fallback.&lt;/p&gt;
&lt;p&gt;On my &lt;a href="https://cobra.pdes-net.org/posts/chitty-chitty-bang-bang.html" title="notebook with ArchBang"&gt;notebook with ArchBang&lt;/a&gt;, however, TeX-PDF opened Gimp for viewing the pdf, which is a wonderfully absurd choice.&lt;/p&gt;
&lt;p&gt;To correct that, I defined mupdf as the default application for opening pdf files:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;xdg-mime default mupdf.desktop application/pdf,
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;but that didn't change a thing.&lt;/p&gt;
&lt;p&gt;I finally found out that this behavior was caused by a glitch in the default configuration of ArchBang:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;$&lt;span class="w"&gt; &lt;/span&gt;grep&lt;span class="w"&gt; &lt;/span&gt;DE&lt;span class="w"&gt; &lt;/span&gt;~/.xinitrc
&lt;span class="nb"&gt;export&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nv"&gt;DE&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;openbox
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Openbox is not one of the possible values of the environment variable DE, and is thus not recognized by xdg-open. One should either substitute 'openbox' by 'xfce', or comment out the entire command.&lt;/p&gt;</description><category>latex</category><category>linux</category><guid>https://cobra.pdes-net.org/posts/automated-latex.html</guid><pubDate>Sun, 05 Jan 2014 17:08:16 GMT</pubDate></item><item><title>Word compatible</title><link>https://cobra.pdes-net.org/posts/word-compatible.html</link><dc:creator>Cobra</dc:creator><description>&lt;p&gt;Working in a publicly funded research institute instead of a university has many advantages. The most obvious ones are a decent funding and the lack of any teaching obligations. Disadvantages, however, also exist. In particular, we have to prepare an annual report in which we present the main activities to our advisory board, guests and third-party funding agencies.&lt;/p&gt;
&lt;p&gt;For the past 20 years, we have prepared and produced our annual report ourselves using LaTeX. The report grew in volume until reading and correcting all contributions became finally unmanageable. We thus decided last year to focus on our most important results. Furthermore, we outsourced the layout of the report to an external media agency to be able to concentrate on the content. We then supplied the content in the form of text files enriched with LaTeX directives and graphics files in postscript format.&lt;/p&gt;
&lt;p&gt;The first report produced in this way was indeed quite presentable and left a favorable impression on most people. This year, however, we were told that the media agency "had severe difficulties with converting LaTeX", and were "urged to produce conventional word-compatible files."&lt;/p&gt;
&lt;p&gt;"Conventional word-compatible files". There's a whole world of ignorance in this short statement. Evidently, the agency employs people with a good sense for color and arrangement, but no idea about technical issues.&lt;/p&gt;
&lt;p&gt;Because "converting LaTeX" is actually straightforward:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;pandoc -s source.tex -o result.docx
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;transforms a standard LaTeX file to &lt;a href="http://en.wikipedia.org/wiki/OOXML" title="OOXLM"&gt;OOXML&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Complicated equations may not be converted successfully in this way. In this case, it is better to export to &lt;a href="http://en.wikipedia.org/wiki/OpenDocument" title="OpenDocument"&gt;OpenDocument&lt;/a&gt;:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;pandoc -s source.tex -o result.odt
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Now just mark those equations not converted and click on the &lt;strong&gt;π&lt;/strong&gt;-icon of the LibreOffice extension &lt;a href="http://extensions.libreoffice.org/extension-center/texmaths-1" title="TexMaths"&gt;TexMaths&lt;/a&gt;. Select svg as format. Then save as docx.&lt;/p&gt;
&lt;p&gt;Existing vector graphics is best converted to bitmaps&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;pdftocairo -png -r 1200 image.pdf image.png
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;and then imported into the "word-compatible file".&lt;/p&gt;
&lt;p&gt;There are no "severe difficulties". That's hipster nonsense.&lt;/p&gt;</description><category>latex</category><category>linux</category><category>thoughts</category><category>windows</category><guid>https://cobra.pdes-net.org/posts/word-compatible.html</guid><pubDate>Fri, 04 Oct 2013 16:57:58 GMT</pubDate></item><item><title>Collaboration</title><link>https://cobra.pdes-net.org/posts/collaboration.html</link><dc:creator>Cobra</dc:creator><description>&lt;p&gt;Last week, I had to edit a manuscript of a fellow senior scientist. The file he gave me was named (I'm not joking) “manuscript.tex”. Since I usually work on many manuscripts in parallel, I gave it a unique name, edited it, and returned it as “xy_abc13_1.tex” using my usual naming convention with xy being the author's name and abc the journal's.&lt;/p&gt;
&lt;p&gt;After other authors had their say, a second round was started and the revised manuscript came back to me with the name “manuscript.tex”. I discovered that several of my changes had been overwritten by later changes or were reverted to the original. When I confronted the author with this irritating fact, he told me that he cannot be held responsible because it's obviously way too complicated to keep track of the changes by renaming the file.&lt;/p&gt;
&lt;p&gt;I don't share this point of view, but it's true that there are simpler ways to keep track of changes than to manually rename files, namely, &lt;a href="http://en.wikipedia.org/wiki/Version_control" title="version control systems"&gt;version control systems&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;In the following, I show you how to profitably use the version control systems mercurial or, alternatively, git when preparing a manuscript or thesis, and how to combine this version control with latexdiff, an indispensable tool for visualizing the changes made from one revision to the other. Using version control and latexdiff in conjunction is dead simple and has many benefits.&lt;/p&gt;
&lt;p&gt;After installing mercurial (or git), we first need a minimum configuration in form of an &lt;code&gt;.hgrc&lt;/code&gt; or &lt;code&gt;.gitconfig&lt;/code&gt; file containing the name and e-mail address of the local user.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;mercurial&lt;/strong&gt; (&lt;code&gt;.hgrc&lt;/code&gt;):&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;&lt;span class="k"&gt;[ui]&lt;/span&gt;
&lt;span class="na"&gt;username&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;John Doe &amp;lt;[john.doe@doe.de](mailto:john.doe@doe.de "john.doe@doe.de")&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;git&lt;/strong&gt; (&lt;code&gt;.gitconfig&lt;/code&gt;):&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;&lt;span class="k"&gt;[user]&lt;/span&gt;
&lt;span class="na"&gt;name&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;John Doe&lt;/span&gt;
&lt;span class="na"&gt;email&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;[john.doe@doe.de](mailto:john.doe@doe.de "john.doe@doe.de")&lt;/span&gt;
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;We can now initiate our first project:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;mkdir project
cd project
cp example.tex project/
hg init
hg add example.tex
hg commit -m "Original version."
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;The syntax of git is precisely the same.&lt;/p&gt;
&lt;p&gt;Now let's edit our manuscript "example.tex", save the changes (under the same name!), and commit the first revision:&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;hg commit -m "First revision."
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;code&gt;hg log&lt;/code&gt; should show you the existence of two revisions: 0 and 1. Git has a more complicated numbering scheme as you will discover when issuing &lt;code&gt;git log&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;You're now using a VCS! Now, that wasn't that difficult, was it?&lt;/p&gt;
&lt;p&gt;Let's add two more commands to our repertoire. Suppose you edit the file, but you are unhappy with the changes and actually would like to start afresh. A simple &lt;code&gt;hg revert -r 1&lt;/code&gt; brings you back to the state of revision 1. And if you have already committed the changes? In this case, &lt;code&gt;hg update -r 1&lt;/code&gt; defines revision 1 to be new head from which further development will occur.&lt;/p&gt;
&lt;p&gt;All right, we can track changes, but how can we visualize them? With LaTeXdiff, of course:&lt;/p&gt;
&lt;p&gt;&lt;img src="https://cobra.pdes-net.org/images/latexdiff.png" width="600" alt="LatexDiff"&gt;&lt;/p&gt;
&lt;p&gt;There are several ways to use Latexdiff in conjunction with a VCS.&lt;/p&gt;
&lt;p&gt;For example, Latexdiff itself supports git. &lt;code&gt;latexdiff-vc -r f76228 example.tex&lt;/code&gt; generates a tex file marking all changes between the current revision and revision f76228. &lt;del&gt;You have to compile this file yourself to obtain a pdf you can view and print.&lt;/del&gt; &lt;em&gt;See update at the end of this post.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Mercurial supports external diff programs, and this &lt;a href="http://eothred.wordpress.com/2010/11/07/latexdiff-and-git/" title="fragment"&gt;fragment&lt;/a&gt; in your &lt;code&gt;.hgrc&lt;/code&gt; allows you to use latexdiff within hg. &lt;code&gt;hg latexdiff -r 0 example.tex &amp;gt; diff.tex&lt;/code&gt; creates the tex file containing all differences as above. Once again, you have to compile this file yourself to obtain a pdf you can view and print.&lt;/p&gt;
&lt;p&gt;Far more convenient are scripts which automate this procedure. &lt;a href="http://sourceforge.net/p/hgdifflatex/code/ci/81bf03ee7da5d7a09ba83bb35a4027e8e6bb0669/tree/" title="Pål Ellingsen"&gt;Pål Ellingsen&lt;/a&gt; and &lt;a href="http://www.numbertheory.nl/2012/02/09/scm-latexdiff-a-python-script-to-calculate-diffs-for-tex-files-in-git-or-mercurial-repositories/" title="Paul Hiemstra"&gt;Paul Hiemstra&lt;/a&gt; wrote python scripts supporting mercurial (and additionally git in the case of Paul's script) which automatically generate the pdf containing all changes, including the additional runs necessary for bibtex, and even supporting multi-file documents such as used for writing theses and books. Create and view the diff by&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;diffLatex.py -r 0 example.tex
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;or&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;scm-latexdiff 0:example.tex.
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Paul's script also allows us to view the differences between arbitrary revisions: &lt;code&gt;scm-latexdiff 0:example.tex 1:example.tex&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;I still give files meaningful names, such as “ob_prb13_1.tex” for my first Physical Review B in 2013. But I will never again worry about file version numbers. What's more, the above scheme is convenient, foolproof (let's see) and entirely transparent. I plan use it for all of my projects in 2013 and the years to come. If only I could convince people to do the same ...&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Update 29.07.22:&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;Recent versions of &lt;code&gt;latexdiff&lt;/code&gt; also support explicitely selecting the version control system and compiling the diff file, generating, for example, pdf output:   &lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;    latexdiff-vc --hg --pdf -r 0 example.tex
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;See  &lt;code&gt;man latexdiff-vc&lt;/code&gt; for further options. &lt;/p&gt;</description><category>latex</category><category>presentations</category><guid>https://cobra.pdes-net.org/posts/collaboration.html</guid><pubDate>Sun, 24 Feb 2013 14:19:49 GMT</pubDate></item></channel></rss>