Archive | LaTeX RSS for this section

nu and vee, I and l — design of physics books and modern fads for fonts


As someone working in a technical field, I often feel like designers do not really appreciate the subtleties of notation and how to make it clear. In the title of this post, ‘I and l’ is upper case ‘eye’ and lower case ‘el’. Not that you can tell.

For example, because so many symbols are used, formulas can often contain symbols which might be mistaken for each other. The classic example is…ilb1

and here is the same formula using some sans serif fonts, using Microsoft Word…


Now, this is not to criticise these fonts. They are just not designed for this job. It is the chooser of the font who is being a wee bit silly if these fonts are used in a mathematical document. An even trickier example is…


which I have produced in LaTeX, and the nu and vee are well-differentiated, but that is because the font was designed by someone (Knuth) with the express purpose of laying out mathematics.

If I was able to give advice to anyone out there designing a text with mathematics in it, it would be to look at the two letter/symbol pairs I have shown here, and make sure they can be told apart. If not, the font choice is a poor one and needs to be changed. And what is fashionable at the moment is irrelevant beside the need for clarity and the fight against ambiguity and lack of precision.


Rant over.

A further little trick with tlmgr: Trouble downloading and unzipping

Went to install some LaTeX packages I needed and typed this at the command line:

$ tlmgr install comment

which gave

[1/1, ??:??/??:??] install: comment [248k]
Useless content call in void context at /usr/share/perl5/LWP/Protocol/ line 379.
TLDownload::get_file: response error: 400 FTP return code 000 (for
TLUtils::download_file: persistent connection ok, but download failed:
TLUtils::download_file: retrying with wget.

TLUtils::download_file: retry with wget failed:
did not succeed, please retry.
TLPDB::_install_package: couldn't unpack to /home/username/installs/texlive/2015/texmf-dist
tlmgr: package log updated: /home/username/installs/texlive/2015/texmf-var/web2c/tlmgr.log


This is ungood. I had already made sure I was using the correct repository, so I knew it was not that. But tlmgr has a switch to force it to use a new connection to the server, rather than trying to reuse a ‘persistent’ one. If the persistent one fails it falls back on wget, which is what the error message above sort of says; what it does not make clear is that the download still failed for some reason.

It is possible to force tlmgr to make a fresh connection each time, and this will work on a wider variety of routers, wifi networks and the like:

$ tlmgr --no-persistent-downloads install chemfig

And this worked a treat. The option can be set in the config file.

$ tlmgr conf tlmgr

shows which configuration file tlmgr is using. It may not exist yet.


$ tlmgr conf tlmgr persistent-downloads 0

has the result of setting non-persistent as the default behaviour, but the documentation is flaky (it says you need an equals sign in there, but that seems to mess it up).

If you then rerun

$ tlmgr conf tlmgr

you’ll see that the configuration value indeed seems to have been inserted into some configuration path somewhere. When I installed a package it worked without the command line flag.


Nothing else.

A little trick with tlmgr: Unknown directive …containerchecksum error

Went to install some LaTeX packages I needed and typed this at the command line:

$ tlmgr install etoolbox

which gave

Unknown directive ...containerchecksum c59200574a316416a23695c258edf3a32531fbda43ccdc09360ee105c3f07f9fb77df17c4ba4c2ea4f3a5ea6667e064b51e3d8c2fe6c984ba3e71b4e32716955... , please fix it! at /home/username/installs/texlive/2015/tlpkg/TeXLive/ line 210,  line 5579.


Turns out the problem was that tlmgr was accessing the 2016 repository when I have the 2015 installation. So I could either update to 2016 or tell tlmgr to use an archived repository.

Since LaTeX evolves fairly slowly, I went with the latter. I didn’t feel like using up my bandwidth. So on the command line I ran:

$ tlmgr option repository

which gave

tlmgr: setting default package repository to

and then all was well.

This was all prompted by using moderncv LaTeX package, and I have noticed that when moving from an older to a newer version of it, I had to move the \begin{document} command a little higher in the .tex file, for some reason.

Nothing else.

Step-by-Step Install of Debian 8.4 on my old NetBook: A successful but too-long Odyssey

My NetBook is a Acer Aspire D255E with an Atom N550 and 1GB RAM and 260GB HD. It is about 5 years old now, with a BIOS date in late 2010.

I put Win 10 on it and stripped away some cruft and its runs pretty well, similar to Win 7, but I don’t like the extra rubbish MS have packed into Win 10, especially the way it handles updates. Since I use Debian at home and RHEL at work, and most of what I do on the NetBook uses programs like LibreOffice and LaTeX, which are open source, and cygwin, which imitates Unix/Linux, I thought the time had come to toast the HD and put Debian on. Having said that, this is Debian using systemd, which is new to me and has been controversial. I shall be interested to see what changes, if any, are apparent. If Slackware 14.2 was out I would seriously consider that.

Issues: Where I am, I cannot access the network without logging in through a pop-up-enabled browser.  Thus I cannot do a network-based install until I have a working browser.  As a result, I first downloaded and burned the eight (8!) CDs in the Debian disk set (here, at UNSW in my case) — I am using an external USB CD drive for the install media, an ASUS SDRW-08D2S-U

Step by step.

  1. I downloaded the disk images and burned them to CDs using a desktop (Windows) machine. Windows 7 and up comes with an iso burning tool, easily accessed through right-clicking on an iso file in the file manager. A distinct improvement.

  2. I put disk 1 in the USB CD drive and rebooted the NetBook, hitting F2 to bring up the BIOS menu. Went to ‘BOOT’ options and moved the USB CDROM option to the top. (BIOS recognised the CD drive — very helpful.)

  3. Saved and exited and let it boot.

  4. Selected ‘install’ from the boot menu.

  5. Selected language, time zone, key map.

  6. Waited for a bit, then chose the wireless network interface.

  7. Problem — I normally have to log into the network through a browser. So…

  8. Oh well, chose Do Not Configure at This Time and went on.

  9. Created root password and a user.

  10. Set time zone in detail.

  11. Manual partition. The partitioner was pretty easy. Selected things by hitting enter, chose options by arrowing up and down the menus. I have 250GB to play with, so I decided to be generous (that is quite a lot relative to what I intend to use the old machine for — it is not like I am going to be editing videos).  So I wanted 40GB root, 5GB swap, rest as /home. I won’t come close to using up these amounts of space.

    1. Deleted existing partition structure (nothing is done till I choose to write anyway).

    2. Created 40GB ‘/’ (root) partition. Set as ext4 file system and bootable. Selected ‘Finished setting up partition’.

    3. Created new partition in remaining space — 5GB — ‘use as’ select swap. Done.

    4. Set up the ‘/home’ partition by selecting defaults, then said, yes, write it to disk! This removes all data from the hard drive, so I made sure I backed up anything I wanted beforehand.

  12. It then installed the base system from the CD.

  13. Said Yes, I want to select a mirror.

  14. No internet, so chose to install ‘standard system utilities.’

  15. Installed GRUB to the HD.

  16. Removed CD and rebooted. Did not get a GUI. Logged in at text console and tried…

  17. Xorg -configure


  18. Used apt-cdrom add to add the CDs in the disk set to /etc/apt/sources.list.
  1. Thought maybe installing more bits of X would automagically cause the dependency-fixing tools in Debian to sort things out. Tried reinstalling xinit but not good, so, what if I try installing a big X-based package and see if it drags in all the dependencies for me (I am no expert; seemed worth a try)…

    apt-get install mate
  2. No good — ‘Dependency problems’ … how can that be when I have not installed anything but from the install media using the approved tools? I have never had issues like this with Debian before…

  3. Tried

    apt-get -f install
  4. It seemed there was no display manager installed…? Huh?

  5. Well, tried typing


    got a very bare X terminal. But it was X. That meant I might be able to run a browser and therefore log into the WiFi (no text browsers that I know of can log in to the network available).

  6. apt-get install iceweasel
  7. Errors – why? Dunno.

  8. Tried

    apt-get -f install


  9. Now seemed ok. Iceweasel ran. Tried to set up mirrors and log in to network. But there was apparently no network. Well, in fact there should have been wired and wireless.

  10. Installed synaptic to help search for available programs to help me out! Thought maybe if I could get onto a current mirror I ccould get it to sort itself out. I wish Slackware 14.2 was released.

  11. But for the moment I was restricted to using the disk set… tried installing MATE through synaptic… Nope, problems. ‘Dependency problems’. Are there more disks?

  12.  apt-get -f install

    again, then MATE again – seemed to be working, as if through repeated applications of ‘-f’ I was cycling back and forth towards a working system.

  13. Tried a reboot.
  14. Logged in (text console) then ran


    then in the resulting terminal window typed

  15. Seemed to run. Used synaptic to install network-manager (still restricted to using the disk set). Seemed to work.

  16. Rebooted.

  17. Installed wdm to given some kind of display manager —  for some reason the MATE install did not depend on that! wdm is a good one as it has very few dependencies compared to kdm or gdm.

  18. Reinstalled xinit, xorg (just because I could). Rebooted.

  19. Now had a graphical login prompt (wdm) and logged into MATE and… I was on the (wired) network!

  20. But… ifconfig did not show a wireless adapter. Should it? I am no guru.  Oh, whatever. I have other things to do.

  21. But first, reinstalled mate-applets, since I could not find the network manager applet.  Still could not find it. Turned out…

  22. …There were dependency problems: installer could not find python-gtk2 and python-glade2. That figures, it would be Python. How I hate it. But since I now had wired network, I should have been able to ensure the installer can find whatever it needed by setting up a mirror, so added a mirror to /etc/apt/sources.list — I used the UNSW mirror.

  23. Reinstalled wireless-tools, since I am now in the habit of reinstalling things. Ran apt-get -f install again out of habit.

  24. Then

    apt-get update

  25. Then

    apt-get if install

  26. Then

    apt-get autoremove

  27. Then

    apt-get upgrade

  28. Then

    apt-get install network-manager-gnome

  29. Then rebooted, and it found the wireless networks ok. So looked promising.

  30. Now, smaller issues: The card reader did not work, and sound did not seem to be working either. Found this very helpful page on the web: and then installed the (non-free) firmware. Turned out that the driver had been added to firmware-linux-nonfree in ‘Jessie’, the current Debian (‘8.4’, I prefer to call it), so:

     apt-get install firmware-linux-nonfree

    which worked without any issues.

  31. Rebooted, and the card reader worked. At some point sound also started working. Webcam works too… guvcview, fswebcam take care of that.

  32. Installed LaTeX according to my own instructions, using tlmgr rather than Debian packages. That needed installation of Tk, which was fine.

Conclusions: Now that it is done, I am glad. For two reasons. One, it is over and it was much more trouble than I expected. Two, the machine is faster and more responsive than when it ran Windows, whether Win7 or Win10. Linux does a better job of managing the battery (it could tell that my old battery only works at about 40% of original capacity, and warned me as such) and seems to drain it more slowly. Boot time is about halved and I can interact meaningfully with the desktop almost immediately. The install seemed to need a lot of going back and forth between installing stuff and ‘apt-get -f install’ to fix it and then back again, and using disk sets was a pain; swapping the disks in and out of the external optical drive repeatedly was tedious, and something about the disk sets seemed to be incomplete and I could only finally get things working by gaining access to a network mirror, suggesting that the best way to install would have been to use the ‘netinstall’ media and find a network elsewhere that the install program could access directly without my having to log in through a working browser (I have used network install in the past, where you boot from a smaller CD image that then downloads everything from a mirror, and never had so much trouble). Installing the non-free firmware seemed to be the only ‘tweak’ required, though.

So very good but does not dovetail well with WiFi networks that need you to log in through a browser session. Perhaps an install from a live disc would have worked better, since they give you a working browser…

I am very happy with the combination of MATE and Debian. Took a bit longer to get there than I had hoped, is all.

And it’s done.

Problems with epstopdf: Image sizes in pdflatex wrong compared to LaTeX

Okay, this is a note to myself.

I made an EPS (encapsulated PostScript) using gsview (see this post).  Then when I run LaTeX everything looks nice.  I handed the files off to the collaborator who wanted them (I was just handling the Word to LaTeX process) and they compiled them and got a tiny graphic in a big white space.

Left: The document <tt>latex</tt>ed. Right: Same document, <tt>pdflatex</tt>ed.

Left: The document latexed. Right: Same document, pdflatexed.

What was going on?  Well, my colleague’s TeX GUI program (I don’t use one, and I don’t know what they use.  Some Windows GUI I think) automagically converted the EPS to PDF — which it did because its default setting (I am guessing) was to use pdflatex — but the conversion was dodgy and it did not keep the EPS bounding box, but put the graphic on an A4 (or letter paper perhaps) page.  Now why would it do that?

I took a look at the first few lines of the EPS file.  They look like this:

%!PS-Adobe-3.0 EPSF-3.0
%%BoundingBox: 88 536 446 715
%%HiResBoundingBox: 0 0 595.00 842.00

A-ha (I thought at the time)! The ‘HiResBoundingBox’ is clearly not being set by gsview, and presumably this is the bounding box being used by epstopdf, the command line tool used to convert (I had tried running epstopdf directly on the EPS file but the resulting PDF had the same problem as when the PDF was produced automatically by the GUI). So I copied the ‘BoundingBox’ numbers into the HiRes field and changed them to be reals by putting ‘.0’ on the end (that’s a nought, not the letter ‘o’).

And it did not work.  This leads me to suggest that epstopdf has its problems.  But, anyway, the solution is… pdfcrop by Heiko Oberdiek. As simple as:

pdfcrop fig1.pdf fig1_crop.pdf

and then use the cropped PDF in the document and all is well!


Microsoft Word Drawing to LaTeX — CutePDF and gsview

I sometimes get work from collaborators who grew up with Microsoft products and they need their manuscript translated into LaTeX. This is usually not such a big deal, though I have come to dislike translating tables. But sometimes you get one where they’ve done the illustration using Word’s built-in drawing capabilities. This is a pain in the neck. On way to get the image out is as a screen grab, but that pixelates. There are other ways that you can find on the web, but I have found the following route to be very reliable and to produce nice, vector graphics.  I know it is not as direct as it might be.

I have a Windows computer with cygwin and gsview (and gs of course) installed.  These are fabulous free and/or open source tools that I recommend to anyone.

(1) Make a copy of the Word file and delete everything except the drawing.

A Word file with just a drawing in it. Oh, and some random text which is part of the figure.

A Word file with just a drawing in it. Oh, and some random text which is part of the figure.

(2) You ought to already have it, but if not install CutePDF (or some other ‘print to PDF’ option, if your version of Word does not have an option like that already).  I should note that I have only bothered to try this with CutePDF; my work provides the full-on “Adobe Acrobat integrated with Word” solution, and it seems to be slow, buggy and generally inferior to CutePDF. You may be able to print directly to a PostScript file in which case you can skip the ‘pdf2ps‘ step.

(3) Print the Word file to a PDF (say fig1.pdf).  It should give you a single page document.

(4) Run pdf2ps (command line program readily available) on the resulting PDF file.  Call the result, say.  You can just as easily use pdftops; they are not the same but they both work.

(5) Open the resulting PostScript file in gsview and select File -> PS to EPS.

The resulting eps file in its bounding box.

The resulting eps file in its bounding box.

(6) Done.  If you use pdflatex you can convert back to PDF using whatever tool you like; gsview will do it.

The main reason for doing it this way is it preserves the vector nature of the image, so if you use it in your LaTeX document it will not pixelate as you change size.  It is also a good way of getting graphics out of Excel.  Printing to a PostScript printer is always possible and for a long time was the simplest thing to do.  I go via CutePDF just because I find it a very reliable little tool.

Now, if you have a Mac it is easier because (and I’m doing this from memory) I think you can open the PDF in Preview, draw the bounding box with the mouse, then hit ‘Cmd-K’ to set the crop box and just save it and then use pdflatex like most modern people.


Note to self: No more notes to self.

tlmgr, perl-Tk, RHEL 6.7 and LaTeX

Man this is tidy!

When I got my new box, I decided that instead of installing LaTeX/TeX using the packages from the distribution (RHEL 6.7 suplied by my work), I would use TeXLive’s own manager, tlmgr.

The TeXLive manager (<tt>tlmgr</tt> GUI.

The TeXLive manager (tlmgr) GUI.

I’m very happy with the decision. Here is the simple path laid out.

(1) Went to and downloaded install-tl-unx.tar.gz to a subdirectory. I called it ~/installs/texlive.

(2) Extracted the archive:

tar x -vzf install-tl-unx.tar.gz

and went to the created subdirectory (install-tl-20160209).

(3) Created some subdirectories — I decided to install in userspace, since I am not sharing the box:

mkdir ~/installs/texlive/2015

(4) Ran the installer and responded to some questions:


(5) For the GUI (useful), I needed to install perl-Tk. this can be done in different ways according to your distro, but on RHEL it is a little tricky since that package is not in the default repo.  So…

(6) Needed to add the EPEL (extra packages for enterprise Linux) repo. This is best done by following the instructions at but in summary in my case (RHEL 6.7, not the newest version) I had to:

(6a) First…


(6b) …then…

sudo rpm -ivh epel-release-6-8.noarch.rpm

(7) Then can install — note that the yum command explicitly enables the EPEL repo.

sudo yum --enablerepo=epel install perl-Tk

(8) This then allows the tlmgr GUI to be run thus:

tlmgr --gui &

The GUI (see picture above) is useful because you can interactively search for what you need and install it in a click or two.

I like this approach, whether GUI or command line, because it means (1) I do not have to install LaTeX via a bunch of huge packages made up by the Linux distro maintainers which means that (2) I don’t install a huge amount of stuff that I don’t need because I can (3) readily install what is missing when and only when I actually need it and I know that (4) when I do install it it will be the current version not a version from some time in the past (whenever the Linux package was assembled).

I like my Debian, but in retrospect, given Debian’s conservative policies (the stable version of LibreOffice on my Debian box is 3.X, for example), I should have installed LaTeX using tlmgr and associated tools.

There are some minor issues however.  One is that  this means the LaTeX needs to be updated separately from the OS.  Another is that (at least in my case) some dependency resolution had to be done by hand.  In this case, xdvi wanted libXaw installed, which means I had to look at the error output from trying to run xdvi then work out the appropriate yum command; not hard (sudo yum install libXaw) but would not have been needed had I installed LaTeX from the RHEL repos.


Et. seq.

My new toy.

It’s here and on my desk… my new toy is a…number crunching computer for Monte Carlo modelling of materials.

Intel 6th-Gen i7 6700K SSD DDR4 4.0GHz CPU, 16GB DDR4 RAM, 2TB SATA III 6GB/s HDD,N600 Wireless Dual Band PCI-Express Network Adapter with 2 Antennae. (Just a cut and paste from the specs.)

It's just a box.

It’s just a box.


Ordered it from D&D Computer Technology Pty Ltd, and delivery was pretty quick. At my work the standard Linux ‘solution’ is RHEL, so it is running RHEL 6.7 (the IT guys here don’t like 7 — it uses the controversial systemd, for one thing…)

Wireless internet so I can put it wherever I want to.

Compared to our previous generation of boxen (4+ years old), it runs a fairly typical Monte Carlo simulation in 20m55s instead of 27m21s, which is a useful but not massive improvement, which is really the result of code that is really just a single, single-threaded process which results in it scaling more with the clock speed than anything else.

I’ve put LaTeX on the box, but I am going to manage it via TeXLive’s tlmgr rather than RHEL’s package management, so we’ll see how that works out…


At the other end of the spectrum.

TeX says it is stymied and format does not match pool, or something

I did an update on cygwin and then when running LaTeX got an error message something like:

(Fatal format file error; I'm stymied)

and it said that a format did not match the pool, or something (the error message scrolled off the buffer and I can’t see it any more).

This seems to mean that there’s been an upgrade and the formats need to be regenerated. I am using TeXLive on cygwin, and what I did was this:

texconfig confall
texconfig init

and latexing the document only worked after the third step. I don’t know if all were necessary, but this did fix it. This is well known, but the trick is not to panic and start reinstalling things and suchlike…

Enough for now.

Converting “On Second Thoughts. . .”: Changes of Mind as an Indication of Competing Knowledge Structures

A paper recently published by a couple of my colleagues was converted from a Word .docx file to a LaTeX file. We tried a whole bunch of the more common converters, and in the end could not get a good result without considerable manual labour. I have almost come to the conclusion that it is easier to just take the text as unformatted ASCII and add the formatting by hand.


The document, published at, looks at how questions in tests, in this case a very widely used diagnostic test from Physics, are not independent.  I have talked briefly about it before.

The text does not contain any figures, but contains several tables.  Tables are very rarely converted well by any of the usual tools.  I tried importing into LibreOffice then saving as LaTeX, and similarly with Abiwordword2latex was similar.  All got some things right, but all added enough stuff that I had to undo manually that the benefit was minor, especially because I had to fit the document into the journal’s document class (REVTeX 4.1, actually), which means that the preamble all had to be put together by hand.  So once I had to sort out the preamble manually, the tables manually, and fix much of the other text manually, I almost decided I might as well just get unformatted text out of Word and mark it up manually.  But in the end I used chunks of the LibreOffice converter output, cutting and pasting blocks of ‘good’ conversion in when it was sensible to do so and using manual conversion when it wasn’t.

A bit laborious.

I explored my options pretty thoroughly, converting the document in quite a few different ways, so I conclude that at this time none of the free and open conversion tools is really up to the task.  I can’t speak on the proprietary ones.



Oh well.