Writing the PhD thesis: the tools Part I

I’m getting ready to write my PhD thesis, and for some time now I’ve been gathering information on tools that can help me get from here to there. This first post is an attempt to organize this material, to write down my thoughts on the approach I plan to take for tackling the beast. This might not be exactly what I end up doing, so I’ll try to update the post on the changes or difficulties I’ve found along the way, to keep this in a sort of live document. Continue reading

Advertisements

To wrap or not to wrap

First of all, if you don’t know what a line wrap is, but you’re constantly using text editors you’re going to want to know. So lets ask Wikipedia,

In text display, line wrap is the feature of continuing on a new line when a line is full, such that each line fits in the viewable window, allowing text to be read from top to bottom without any horizontal scrolling.

Additionally, you can do a soft wrap, which is the break resulting from a line wrap, or a hard wrap as an intentional break–creating a new paragraph. Most modern text editors soft wrap lines by default, that is they adjust the line lengths automatically with adjustments to the width of the user’s window.

While in most situations staying with soft wrapping is not an inconvenience, hard wrapping might just be what you need under several special circumstances. Computer programmers actually make use of hard wrapping on a daily basis, because when working with text editors for checking/writing code you really need your lines perfectly wrapped and properly indented to check your code or for spotting errors.

The actual issue comes from the fact that when compiling, you might get an error pointing to line 87 of your code. If line 87 is soft-wrapped with who knows what other code. It could be truly cumbersome to find the error. Now, the same applies for tex files. And it is really easy to mess up a tex file, especially because you’re actually writing a document (article, presentation, etc.) with–most likely–soft-wrapped paragraphs, as opposed to programming.

If you consider another situation, such as in version control. When carrying out a diff command, it is almost impossible to spot a typo with a soft-wrapped paragraph. Furthermore, fixing this single typo will be considered as a change in whole line (is this what you really want?). The same happens when running a grep command. There’s another typical situation where you wish the editor would best hard wrap. Some mail clients don’t wrap well (or don’t wrap at all) when you’re forwarding or replying to a message. The consequence is that the recipient has to scroll horizontally to what seems and endless line to read the quoted message.

However, not everything is great with hard wrapping. Hard-wrapped paragraphs look nice until you start to edit them. If you hard wrap again, you end up with a much more lines changed in the diff than you originally intended.

So, do I soft wrap or hard wrap?

On the one hand, if you haven’t had any of the problems I’ve mentioned, and you really don’t know what your regular text editor is doing, keep doing what works for you. On the other, there seems to be reasonably compromise as suggested by Will Robertson on stackoverflow. He wraps by sentences,

  • Small changes are comparatively easy to spot in a diff.
  • No re-flowing of text, only changes to, insertions of, or removal of single lines.

Looks a bit weird when you first look at it, but is the only compromise I’ve seen that addresses the two problems of soft and hard wrapping.

If you want to try it, or had a similar issue with wrapping, leave a comment. Who knows, this approach could probably make us write shorter sentences, which in general is much better than really long sentences that hardly let you catch your breath.

No LaTeX at all

If I were to tell you that I’ve actually come to literally hate “do-it-all” word processors (yes, MS Word I’m looking in your direction) that take forever to launch, that usually crash as soon as you add a couple of paragraphs plus some images, and more of the old stuff we’ve come to know; I’d bet you’d agree with me. As a matter of fact, it’s been quite a while since I last used MS Word. I do have it installed in my Mac, but I try my best not to use it. All papers I write are written in LaTeX, except for the occasional what-narrow-minded-scientist-organizes-this-kinda conference that requires the proceedings to be formatted exclusively by an MS-word template.
Depending on who you ask this might actually be considered a sin. Check the ninth circle from the The Nine Circles of LaTeX Hell what Not using TeX or LaTeX means to some:

This one is so bad, it tops Scott’s list of signs that a claimed mathematical breakthrough is wrong. If you are typing up your results in Microsoft Word using Comic Sans font, then perhaps you should be filling out TPS reports instead of writing scientific papers.

These days I’m just in this sort of using-MS-Word predicament because I have to submit a paper to the spanish national meeting on optics, and the organizers just deemed themselves of putting a .doc and .docx templates for submission. If you think about it, what kind of people think that MS Word is the only document format there exists? I know it is the de facto format in many places, but one could expect better from the scientific community. The previous meeting, which was held three years ago in Orense was superb. Not only did they have a LaTeX template for submission, but the meeting was exceptional. The food, the wine, the people, the science, the atmosphere, everything was outstanding. For most days there was actually too much food and wine, without taking into account the cultural activities arranged by the organizers, which were also first-class.

Now, back to the MS Word template trouble. The best part is that they only want a pdf file for submission that must supposedly be produced with their template. However, my big surprise came when I downloaded the template. They’re actually trying to mimic the LaTeX article style. There are several fonts within the document, a font for the abstract, another for the title, for the text body, etc. On top of that if you take into account the requirements for tables, figures, margins, and keep counting, it really becomes cumbersome to write your paper while trying to keep up with all of the formatting. And it gets even worse if, like me, you already have most of the paper written in LaTeX. Just thinking about it causes some distress. In LaTeX one mostly worries about the text itself, and let LaTeX worry about the formatting.

Just for the sake of it, I’m thinking of importing the template to Pages. Copying and pasting what I have in LaTeX (probably I’d do some LaTeXtoRTF first) and finish writing the paper in Pages. Since my equations are in LaTeX I’d be best inserting them in Pages via LaTeXiT with the services option. The equations are much better formatted this way, than with the MS Word equation editor. If you see another way around this feel free to leave a comment.

Texmaker Error : Can’t open the dictionary

Ever since I upgraded to the latest version of Texmaker the spellchecker started to show the following error Can’t open the dictionary. So after struggling a bit with it I realized that the dictionary file for English US (en_US.dic) I had obtained from the openoffice repositories as recommended by the texmaker documentation did not have the affixes file (en_US.aff). So I read a bit about it a found out the following:

The .dic file is a list of words along with a group of letters which refer to the affixes found in the .aff file. This saves space because instead of having include all forms of a word, like jump (jumping, jumps, jumped), the .dic file will include the word once and the references to the affixes in the .aff file allow the construction of all the other forms.

via MySpell – Wikipedia, the free encyclopedia.

Solution: Download an up-to-date spelling dictionary that includes this aff file. You can get one from wordlist.sourceforge.net. Unzip, put it wherever you want, and then head to the preferences->editor in texmaker and point to where you have your .dic file. It should work.

LyX: failed to start ispell

Hi everyone,

I recently installed LyX for MacOS and it’s pretty neat, specially for us LaTeX users because it makes it so easy to produce LaTeX-quality documents in no time. If you want to make a brief report on some topic you’re researching, or a quick draft, it’ll save you a fair amount of time instead of using your regular TeX editor. However, when I wanted to check the spelling it produced the following warning LyX: failed to start ispell. What happens is that the GNU package ispell was not installed in my system. Therefore the appropriate solution is to install it.

If you have macports, simply open a terminal and write: sudo port install ispell

I guarantee it’ll work.

Cheers….

Latex bibliography without citing

If you want to show all your bibliography citations even without making a proper citation in the text the solution is simple.

Simply add the reference you want to be shown under \nocite{reference}

This way, the bibliography will contain the reference you specified.
If what you need is for all your citations to appear, just enter \nocite{*} and all of them will be there.