Simple and effective LaTeX editing on Linux/Cygwin/etc

First, install and use Vim.

Second, add this to ~/.vimrc:

syntax enable
command L !pdflatex %

(I would also add set mouse=, but maybe that is just me.) Third, create the PDF if it does not already exist.

$ pdflatex myfile.tex

Fourth, open the PDF in gv with the -watch option, and adjust the window to occupy half your screen. You can use the ‘-spartan’ gv option if you want less framing and more content.

$ gv -spartan -watch myfile.pdf &

Fifth, open the tex file in Vim and adjust Vim (that is, your terminal emulator) to occupy half your screen.

$ vim myfile.tex

Sixth, edit the file in Vim, using the :L command to compile it as and when you want to.

That’s it. gv will watch the PDF file and reload it when it changes — unasked. No need to leave the Vim window, no need to click. You will need to tab out the gv and Page Up or Page Down as needed, but that’s it.

I find this has the following advantages:

  • very quick to configure, so I don’t have to ‘miss’ my personalisations when I use another machine
  • very few dependencies (though I’ll admit, given the enormous bloat of a full TeX distribution, that may not mean much)
  • low resource requirements
  • low mouse use (better for your joints)
  • gives a very simple, clutter-free screen that is good for concentration and focus.

With a little effort, it is easy enough to add any other commands you might need to .vimrc (eg biblatex), or to have several files open at once (.tex, .bib …) but the whole point of this is to be simple and nondistracting.

screenshot
Vim on the left. gv on the right. That’s it.

On Debian, the update frequency is controlled by resources in the file /etc/X11/app-defaults/GV. If the updating of the PDF file view is too fast/slow, you can try changing:

!GV.watchFileFrequency: 1000

(Remove ! and change 1000, which is in ms)

Probably should copy this line into a local .gv file. For example:

$ cat ~/.gv
GV.watchFileFrequency: 5000
GV.version:		gv 3.6.7.90

If gv does not like your .gv file, run:

gv-update-userconfig

after adding the new resources.

The Daylight Gate by Jeanette Winterson

Uncharitably, one could call this a well-wrought snuff tale.Book cover; a crow in a bare tree

It is in fact many things. A look at the brutality and violence that fear, poverty and ignorance engender. A look at the lengths the helpless will go to to feel some sense of agency. An outline of the types of torture, disfigurement and punishment that were applied by so-called God-fearing men (and probably still are in some places). A fantasy about witches, but one that avoids the expected tropes. A look at male versus female ‘power’. A love story (or two). One could argue it may be too short to contain everything the author is trying to do. It certainly has no lack of descriptions (and inferences) of brutal behaviour, including sexual violence and incest.

It is (in brief) the story of the hunting down of witches and papists in Stuart England, and the punishments meted out to them. Its presentation of the brutality of the times  is unflinching. Often in a book the violence is cartoonish and you can disregard it. Here, it is the opposite. It is clumsy yet vicious, it is matter-of-fact yet beyond the pale, and you cannot even pretend it didn’t happen this way.

Note, if this were a movie, it would be R18+, and is certainly not suitable for kids or the squeamish, or people who are likely to be kept awake when their mind replays horrible visions from what they’ve read or seen.

The writing is on the whole very good. Not all the arresting images are brutal — some are admirable figures of speech, evocative conjurings, subtle delineations of character (after all, one can skilfully and subtly describe a crude, venal or ignorant character).

It is interesting to think how lowly regarded a book covering much the same territory but written in a pulpy, exploitative style would be.

It’s quite good, but that does not mean it’s for everyone.

Getting files off a Nokia G10

This was a pain. I went into developer tools and tried turning on USB transfer, tried setting it to PTP mode, tried plugging it in to a Windows computer, into a Linux box — simply could not see the pictures on the phone. Could not get it to appear on any computer at all, despite lots of googling and trying things that are alleged to work.

Typical Linux errors included dmesg output like this:

[12758.619103] usb 2-1: new full-speed USB device number 113 using xhci_hcd
[12758.619276] usb 2-1: Device not responding to setup address.
[12758.827267] usb 2-1: Device not responding to setup address.
[12759.035069] usb 2-1: device not accepting address 113, error -71
[12759.035142] usb usb2-port1: unable to enumerate USB device

USB-C to A adapter. $2 on ebay.

In the end, I used a USB-C to USB-A adapter, plugged an old USB flash drive into it, and the phone’s file manager saw the drive and I could use the file manager to copy all the pictures onto the USB stick.

I should say I have been able to ‘see’ other phones, including a Nokia 1.3, so whatever the problem is, it is (in my experience) unique to this phone.

 

Interstellar Empire by John Brunner

This is number 4 in the Venture SF series, and it’s not too bad. It’s 50s-style space opera by one of its top producers.The cover -- a generic space scene

It contains 3 pieces; 2 short novels and a novella — The Altar on Asconel, The Man from the Big Dark (a novella at 40 pages) and The Wanton of Argus. The stories are set in a galactic empire centred on Argus. All are lean, straightforward adventure stories, with no pretences and a sensible economy of description.

Interesting also is the foreword, in which Brunner discusses the galactic history that might lead to the coexistence of swords and spaceships.

Wanton of Argus is replete with mysterious figures, beautiful women, swordsmen, robots in disguise, you name it, before it ends in a kind of confrontation between two mighty wills  — the kind of ending that renders much of what went before superfluous. A bit like a story in which much happens and then a comet wipes out the Earth anyway. Well, not quite as extreme as that, but that’s the somewhat unsatisfactory sense it gives. It is most interesting because it is a very early work — as a piece of fiction, it’s pretty clearly little more than grist for the publishing mill of the time. Brunner wrote it when he was 17, and sold it and got paid for it, although the buyer slapped the terrible title on it that is completely unreflective of the content.  It was republished as The Space-Time Juggler.

The other stories are better constructed, as you’d expect, especially Asconel, but nothing here is a major work, and there’s really no reason to read the book unless you’re interested in Brunner or a fan of SF from the 50s.

The omnibus is a good read if you like freewheeling, unselfconscious space opera in the 50s style. Very much not like Brunner’s major novels of the late sixties and early seventies. More like this one.

 

Space opera

The Week the Sea Blew Up by Gordon Ross

The title is not great. The story is so full of incident it becomes schematic, with little room for character. It ends abruptly. Usually, I like how these old books are around 120, 130 pages. Modern books are so bloated by comparison, loose and not edited hard enough. These are written to a fixed format. But in this case the author has crammed so much in the book is a little compromised.

Even so, many details ring true, and I confess I found it adequate entertainment. But the bar is pretty low — I am an easy mark for such stories. Where others watch police procedurals or murder mysteries, I read these old stories. Like a TV mystery, you know what’s going to happen in broad terms, but the details always differ. The detective will, in the end, solve the murder.

cover -- a destroyer at sea amidst gouts of water

This  tells the story of  a British antisubmarine group — sloops and corvettes, led by a sole destroyer — hunting for a German submarine wolf pack. Intrigue about a Nazi ‘political’ on the crew of the lead sub upsets the apple cart, and other incidents occur, and then it all ends.

I cannot recommend it, really, unless you’re already a reader of such books; and in truth what are the odds you’d ever see a copy anyway?

Deep Escape by Alistair Mars

The cover of this book, and its title, would give you the idea that the whole book is about a lone man escaping from a damaged submarine at the limit of its depth range. A kind of Gravity underwater. This is only strengthened by the author’s bio, which refers to Mars as a wartime submarine ace; it sounds like he was a larger-than-life figure.

The cover, showing a submarine and a torpedo

In truth, the escape occupies the first few pages — and it’s pretty good stuff. The rest of the book is subterfuge and intrigue on an Italian island, complete with a villa occupied by a beautiful woman, educated in the USA and ready to escape occupied Europe with our (Australian) hero who is a much-needed expert on radar.
Commando operations, a love story, a naval adventure, brave resistance fighters — it’s all here in 130 pulpy pages. It’s not going to win any prizes, but it’s quite a fun read. It’s just not what the cover would imply.

HTML emails in Pegasus Mail 3.50 on FreeDOS

Pmail works well on FreeDOS if you use some great new tools to grab and send the mail.  But a lot of emails are written in HTML these days, and old Pmail does not render that (current Pmail does, I hasten to add). FLmail does, but it does so somewhat slowly. In Pmail, if an email is all HTML gobbage, and I can be bothered, I eXtract it to a file then run my little batch file:

c:\> htmemail.bat file.htm

Here is the batch file:

@ECHO OFF
COPY %1 temp$$$$.htm
REM Make sure the pattern is on a new line.
REM (And lower case.)
SED -i "s/HTML/html/g" temp$$$$.htm
SED -i "s/<html/\n<html/g" temp$$$$.HTM
REM Then delete the lines in front of the pattern
VIM  -c "g/<htm/1,-1d" -c "wq" temp$$$$.htm
REM Then view it
CALL LINKSG temp$$$$.htm
REM Then delete the copy
DEL temp$$$$.htm

It uses DOS versions of SED and Vim. SED does a nice job of preparing the file — changing HTML to html to simplify the next line, then making sure that the <html> token appears on a new line by finding it in the file and prepending a newline (\n) character; note that this requires GNU SED, and BSD SED works differently.

PMAIL (Pegasus mail)

The VIM editor is also used as a command line processor, so this needs VIM.EXE and SED.EXE to be in the PATH. VIM is part of FreeDOS.

(Some HTML emails seem to be just one long line of stuff, which is why I search for<html> and replace it with itself prefixed by \n (newline), which makes sure the pattern is on a new line.)

Then the VIM incantation finds the pattern and deletes everything in front of it. This may not always be needed — many HTML viewers can ignore the cruft before <html>, but I found that LINKS was sometimes seeing the crap at the front as indicative that the file was a plain text file, and then rendering it accordingly…

Note that LINKSG.BAT is just a batch file to call the graphical interface version of LINKS:

c:\net\links\links -g -mode 1024x768x32k %1 %2 %3

And here is the SED information, for reference:

c:/freedos/bin/sed (GNU sed) 4.2.2
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by Jay Fenlason, Tom Lord, Ken Pizzini,
and Paolo Bonzini.
GNU sed home page: <http://www.gnu.org/software/sed/>.
General help using GNU software: <http://www.gnu.org/gethelp/>.
E-mail bug reports to: <bug-sed@gnu.org>.
Be sure to include the word ``sed'' somewhere in the ``Subject:''
field.

Pegasus Mail and Gmail — easy!

I want to set up Pegasus Mail (‘PMAIL’) to use Gmail on one of my computers because the computer is a bit old and using a heavy application like Thunderbird or Firefox is a bit slow. The Pegasus Mail setup wizard holds your hand through this, and makes it pretty easy. And I don’t think I needed admin, either.

Downloaded the  Pegasus Mail v4.81 with Gmail OAUTH2 support public beta. Ran the exe file.

Clicked ‘Setuo Info’ and browsed a bit.

From previous experience, if I let it install to C:\PMAIL, it will put my mail in there as well, and anyone else who logs into this box will be able to see my mail, or at least see the folder it is in. So I installed it into:

C:\Users\USERNAME\installs

I do note that this folder path has no spaces in it. I don’t know how PMAIL plays with paths with spaces, but I chose to avoid them.

I don’t want it to deal with ‘mailto:’ links (yet), and I don’t want a desktop shortcut, so I unchecked these options. The Roaming option was not be relevent here.

It ran and the installer exited.

Now, I could run it from the Start menu. I just ran ‘Pegasus mail’ (no admin). The account setup wizard started.

The dialog said:Do you use Gmail…? and gave me a single ‘Gmail’ button to push. I pushed it!

OK!

I put in my Gmail address, did not mess with any defaults, and clicked OK. It then gave me a dialog that told me we were about to ask Google for permission to use Pegasus Mail with Gmail. I clicked Transfer and logged in.

And… a window opened in my browser, taking me to the Gmail sign-in windows and then back to PMAIL.

OK, now I’d rather use IMAP than POP3, so in PMAIL I go Tools > Internet options and Receiving (POP3) and disable that profile. The installer has also created IMAP, and I want to use that in preference. If you are not careful with your settings, POP will download all your email off the server and delete it from the server! There are options to set in PMAIL to prevent that, but IMAP is generally to be preferred anyway. POP was rather designed on the assumption that you’ll only access your email from this computer, using this software, and although the settings let you avoid that assumption, and POP is fine really, IMAP is more modern and is generally to be preferred if available (as I understand it).

Also in Tools > Internet options, I add my email address to the General tab.

Now, I click on the icon of the Earth with an arrow coming out of it.

Nothing.

Restart PMAIL. OK, can I send a mail? Seems I can. OK, maybe I have to enable IMAP explicitly. Duh! When I go Tools > IMAP profiles, I see a ‘Connect’ button. Press that. It is working. I can see in the status bar that PMAIL is grabbing lots of folders, and now they appear in the PMAIL window!

That was easy enough.

Click Done.

Great. Looks excellent. Last step was to pin the PMAIL icon to the taskbar before exiting.

Now, PMAIL has a lot of configuration options, many of which are not available in other software. It works out of the box, but you may want to spend some time hunting around and looking at your other options. Its mail filter is especially powerful.

 

 

 

 

Office 2007 on wine on Linux — seamless!

The wine project is very impressive. Old Office 2007 DVD, so why not? Word has not changed much in 20 years. Had to do some cleaning up first.

I used PlayOnLinux but chose manual install and pointed it to the setup.exe file on the DVD, and specified 32-bit to matchthe Office version (and  made sure 32-bit wine was installed).

Installer ran succeasfully; clicked Close.

PlayOnLinux asked about shortcuts to make. Chose Winword then Excel and PPT; they appeared in the PlayOnLinux dialog.

The software wants to be activated…  but the software is very old! I chose over internet, and it seemed to work. ??? (Or more likely just did not complain.)

Cannot sign up to Microsoft update service, of course.

But seems ok. Works basically seamlessly.

I find I can print from Word 2007 to any of the printers installed via CUPS — for example, my Apple ImageWriter II.

So I can run Microsoft Word from 2007 on Linux from 2022 and print seamlessly to an Apple printer from 1986. Now that’s convergence!