Archive for the ‘LaTeX’ Category
Backwards compatibility
A long time ago, I decided to see if I could rewrite an essay I’d written as an undergrad in Open Office in LaTeX. I gave up soon after because (1) it was pointless since I had since then written a better paper (in LaTeX) on the same subject (the conventionality of spacetime geometry, if you must know) and (2) it was really irritating going through doing things like changing “…” into “…” and so on.
Now, recently I was again recovering old ground and I wanted to write something similar to something I mentioned in an essay I wrote (in LaTeX) as an MA student (About coin flipping and partitioning the space of initial conditions…). I was surprised to discover that even that was laborious to update. I had to do things like go through and replace \citet and \citep with \textcite and \parencite as appropriate. This is because I moved to using biblatex rather than bibtex. I know about the natbib=true compatibility option, but it doesn’t behave properly all the time, particularly with multiple citations… And I had to add signposts to my \labels. That is, write \label{fig:zebra} rather than \label{zebra}. OK, “had to” is probably a bit strong. I wanted to, because I think it’s a good idea to signpost whether it’s a figure or an equation or a section or what have you that you’re referring to.
Today I discovered that it is reccommended that I use \(…\) instead of $…$ for inline maths in LaTeX. This means that even a paper I wrote a couple of months ago (about the principle of indifference) which I now want to work on again has to be updated in a non trivial way before I can use it. (This is a change I can’t just do Find and Replace for… On the other hand, it’s an aesthetic thing rather than a functionality thing. $…$ still works fine, but I like to follow proper practice…)
So I suppose that means I should stick to writing about new stuff rather than recovering old ground if I want to avoid having to laboriously fix minor pseudoproblems with my LaTeX code…
Biblatex
I recently changed from using boring old BibTeX to exciting new BibLaTeX. There have been some slight problems with the transition (aren’t there always!). First, citations started appearing as: “Name, Year” instead of “Name (Year)” like I wanted them to. I got around this by adding the option “natbib=true” to the \usepackage{biblatex} command and replaced all my \cite commands with \citet commands. Not the most elegant solution, I’ll grant you, but it works. So I was casting around for a better solution. I thought I’d try the APA standards packages. They didn’t work at all until I did a “sudo texhash” and after that they didn’t solve the problem. (Though they did fix an annoying bibliography quirk: the biblatex standard authoryear bibliography style writes things as “Author, Year, Paper-title In: Journal” The APA packages do at least get rid of that annoying “In:” Tomorrow I’m going to see if Harvard or Chicago bbx and cbx files can get me out of that mess.
Two other outstanding gripes with biblatex. First is that I can’t have “X et al” appear in the citation while still having “X, Y and Z” appear in the bibliography. This was standard with whatever set-up I was using before (natbib and chicago probably). This is because the “maxnames” option controls both citations and bibliography. Not ideal.
Second gripe, I want my bibliography to be titled “References” rather than “bibliography” I had a work around for this using the memoir class and bibtex, but it no longer works with biblatex. I suppose I will explore this issue further tomorrow.
And why am I spending so much time playing with my bibliography? Well, because it’s a superb displacement activity and I have a huge project due in next week, that’s why!
Learn the rules! Establishment, establishment…
Cyclists who ignore traffic lights or otherwise disregard the rules of the road annoy me. As do cyclists who cycle on the pavement. Obviously cyclists are much more vulnerable than people in cars on the road. Does that not give cyclists even more incentive to obey the rules? apparently not. I regularly see cyclists run red lights. To my mind, they deserve to be knocked down. You are on the road and there are rules you should obey. A couple of days ago I saw someone on a bike go through a red light on her bike with no helmet on whilst talking on her mobile phone. You stupid stupid woman.
In other news I have migrated from Texmaker to Kile. I originally avoided Kile because I objected to using programs made for KDE in Gnome. But since then I’ve realised that Kile is significantly better than Texmaker. I can also get Kile on both my main computer and my little Acer Aspire One. Linpus linux that ships with the One doesn’t have texmaker in its repositories. (Check this out for how to get a package manager on Linpus and other cool stuff.)
The LaTeX figure environment
Instead of doing any proper work, I’ve been adding pictures to my dissertation. It’s a fiddly process. First, I find a Creative Commons or other free license picture (normally on wikimedia commons) in SVG format. Then I open it up in inkscape, and save as EPS. then I save another copy ar PDF. This is because latex and pdflatex like different picture formats. So, in the same folder as my mainfile.tex, I have npc.eps and npc.pdf So once I’ve done that I make my figure environment where I want the picture to appear. The environment looks like this:
\begin{figure}
\centering
\includegraphics[width=2in]{npc}
\caption{The nine point circle for a certain scalene triangle}
\label{fig:npc}
\end{figure}
If I latex-ify the document it looks for the EPS file. If I do pdflatex then it looks for the PDF file. I have discovered, through much experimentation and gnashing of teeth, that the order in which the things appear makes a great deal of difference. If the \caption is above the \includegraphics the caption appears above the figure. If below, the caption is below. Fairly straightforward. The \label has to be below the \includegraphics and \caption commands. If you put it anywhere else \ref{fig:npc} will reference the section or subsection containing the figure environment. The “fig:” thing is just a convention, it serves no functional role.
Was all this faffing about really worth it? Probably not, but it sure beats doing proper work!
I am a frog-pasta-tube
I have been reading some craaa-aaazy stuff today. So this one paper suggested that the fundamental metaphysical nature of the world is that of a graph. An unlabelled asymmetric graph-theoretic entity. OK. It kind of fits in with a lot of stuff about ontic structural realism. Kind of.
Now I’m reading something about the bird-eye view versus the frog-eye view of space and time. The “bird” sees the whole spacetime structure from the outside. What looks like a particle moving with constant speed to the frog looks like a strand of spaghetti to the bird. Two particles orbiting each other, to the bird, looks like two strands of pasta entwined like a double helix. Like the weird blob thing in Donnie Darko. So the bird sees the frog as an ensemble of worldlines for the frogs particles. The frog looks like a tube of pasta strands to the bird. I did not make up any of this up. (Except the Donnie Darko reference). It’s all there in Max Tegmark’s The Mathematical Universe. The weak point in his argument is that he claims that any “theory of everything” will be entirely mathematical. This simply cannot be the case. We have plenty of theories that are entirely mathematical; go ask your local maths professor. If it is to be a theory of the physical world, the theory is going to have to involve some kind of pointers as to how to apply its results to the world. So we had a theory of Riemannian manifolds before Einstein came along, but that didn’t make the (mathematical) theory a scientific theory. Not until Einstein started showing how the manifold could relate to our conception of space. Tegmark pretty much agrees with this point, but then says that that isn’t fundamental to the theory. He says we have a mathematical theory and then the interpretation is done afterwards and isn’t necessarily part of that theory. This is both methodologically backwards and I think just plain wrong. The interpretation is central to that mathematical theory qua scientific theory.
I am sympathetic to the (ontic) structural realist flavour of what Tegmark is getting at, but I don’t think his “derivation” of his “MUH: Mathematical Universe Hypothesis” really works. I have to say I gave up after the first 10 or so pages because it was getting near to dinner time and the two column layout is a pain in the arse to read on the computer.
Tegmark also has that annoying scientist’s habit of not putting the names of the articles in his bibliography. So in the text he will cite “[14]” which isn’t helpful. Then if I scroll to the bibliography I will see that [14] is “J. Ladyman Studies in History and Philosophy of Science 29 409-424 (1998)” God dammit. If he just wrote Ladyman (1998) in the text instead of [14] I’d know immediately that he meant What is structural realism? It would mean much less hopping back and forth. And what about if the author and name wasn’t enough for me to identify the paper? I’d have to bloody well look it up on the internet. I appreciate the practice makes sense in science where knowing the actual paper under discussion isn’t important to the argumentation, and that titles of scientific papers are long and would lead to bloated bibliographies, but come on! It isn’t even as if it would be a lot of work to change it. How hard is it to add the line “\usepackage{natbib209}” to the preamble of your LaTeX document and change your bibliography style to chicago, or similar? I bet the names of the articles are already in the bibtex file…
I did promise to post something that wasn’t a rant. And this started out as a light-hearted look at some of the dangerously bonkers stuff I take seriously every day. But it turned into a rant about bibliography formatting, of all things. I appear to be incapable of not ending up complaining about something. I guess that means I am just a mean spirited cynical rantophile.
Beware the angry monkey
I thought this was too funny not to mention.
I haven’t done a whole lot today. I spent a good long while just sitting here going “Yes, but what is a structure?” Which probably suggests I don’t quite have what it takes to be a structural realist. Shame.
I also spent rather too long trying to get LaTeX to play nicely with Kig. Now, kig can export pictures you have drawn as TeX files. But when you try and \include{thefile} in another file it messes up. So you can also export kig constructions as SVG files, which vector graphics software such as inkscape can transform into EPS, which is what should work with LaTeX. I haven’t actually tried this circuitous route to LaTeX picture perfection, because I don’t have any vector graphics software installed and I forgot to save my kig file of the nine point circle.
I have actually written a little bit today, and planned the next few weeks’ work. So it hasn’t been a totally wasted day.
I was thinking a bit more about my complaint about the kilo. I was wondering whether you could define a kilo in terms of the weight of a certain volume of a pure liquid, say water or mercury. But would that depend on the temperature and pressure? I don’t know. Or by making use of Einstein’s useful little mass/energy equivalence define a kilo as a certain amount of energy? A certain number of electron volts or some such…
Incidentally, I have started assigning tags as well as categories to my posts. This means that going through my old posts and tagging them could well become my displacement activity of choice…
We are all going to explode tomorrow.
Today’s Guardian had a cool little special section about CERN. It is available here. I now have a false colour bubble chamber image as my desktop background. So the LHC hasn’t blown us all up yet, which is nice. If it ever does, I might feel the tiniest bit responsible, since I’m signed up to the LHC BOINC project…
In other news, the nine-point circle is my favourite fact about triangles. I will try and mention it and its relation to incircles and excircles in my dissertation. Hopefully with gratuitous use of diagrams drawn in Kig. If I can be bothered to learn how to get pictures to work in LaTeX… Another thing I’d like to do is learn how to write chapters as separate files and include them in some master file. For 15,000 words it’s hardly worth it, but it’ll be useful for next year. I’d also like to change the default font to Gentium, for no other reason than to make a move away from default LaTeX formatting…
My favourite tautologies
So today I was reading Artificial Intelligence and Scientific Method and Gillies mentions that is a logical truth; a tautology in classical logic (but not in intuitionistic logic). I was interested by that and check that it is indeed the case by writing out the truth table. I didn’t bother to actually find a proof, but contented myself with the fact that the truth table + the fact that the propositional calculus is sound and complete is kind of a proof. Then I thought what are some other cool tautologies. Here are a couple I remembered.
Then I thought. Hmm. I’m a geek. But I’m still enamoured of this ability to put code in my wordpress posts so I thought I’d write about it…
LaTeX
So you can use code in wordpress posts. (Oddly, I can’t get \tex to display…[edit: use \LaTeX which I haven't seen before...]) That is cool and I thought I’d try it out.
I wonder if you can use Dirac notation
[edit, nope. not with \bra and \ket. you have to use |, \left, \right and > which just isn't the same...]
I don’t really have a purpose in writing this. I seldom have the need to write formulae in this blog. Maybe I should write more formulae. Although I do dislike the use of mathematics to legitimise something that might otherwise be considered “soft.” A prime example of this is where you say that Organisms change as a function of their environment and themselves, and the environment changes dependent on the state of the environment. Then the following meaningless equations are used. Apparently to justify the proposition:
Ignoring the fact that I’m pretty sure that should read rather than
(because they are clearly not supposed to be the same function…) and I believe that organisms affect how their environment changes, these equations mean nothing! What exactly is
supposed to mean? Yes it’s obvious they are angling for “change in organisms through time” or something like that, but why not say that? Why shoehorn in some fancy looking maths?
isn’t something that has time-derivatives in any meaningful sense. It’s purely an attempt to make the thing look more “scientific” which is crazy. There’s nothing unscientific about using words to express your ideas.
Anyway. That turned into a bit of a rant when it was supposed to me just testing out the LaTeX functions of wordpress…
I have edited this several times to make it all work. I don’t normally edit posts, but this is just a sandbox for my messing with messing…