25/03/2019

Help! Kile is stuck!

"The file x.kilepr cannot be opened as it does not appear to be a project file." Which didn't stop Kile from "scanning project files", which in turn blocked the entire interface. All in vain, I might add, since the project file had moved anyway, so there was nothing to scan in a folder that didn't exist any more. An existential crisis ensued: it is almost midnight, after all, and I'm in mid deadline panic.
Ah well, let's find kilerc, which happens to be in ~/.config/ (if there is a method to KDE's config folder organisation's madness I haven't found it yet). The culprit was in the FilesOpenOnStart section:

[FilesOpenOnStart]
DocsOpenOnStart0[$e]=/path/to/file1.tex
DocsOpenOnStart1[$e]=/path/to/file2.tex
EncodingsOfDocsOpenOnStart0[$e]=UTF-8
EncodingsOfDocsOpenOnStart1[$e]=UTF-8
NoDOOS=2
NoPOOS=1
ProjectsOpenOnStart0[$e]=/this/path/is/invalid.kilepr

I just had to adapt the numbers and paths of docs and projects open on start after all. 

23/08/2018

Zenbook data rescue

RIP, Medusa (2013 Zenbook). I believe her power socket is finally dead.

Which was a bit of a bummer because I'm not too regular in my backups and the old Zenbooks feature non-standard 18pin-connectors instead of the more recent M.2/NGFFs. Ah well. There are adaptors for everything.
There were exactly 2 drive types with this form factor, SanDisk's SASA5JK and ADATA's XM11 and I got a board that transfers to a standard SATA and can then be stuck in a USB drive case like the one pictured above (I got the adaptor from here, but there are other suppliers as well).

16/05/2018

KDE freezes on Special Window/Application Settings menu

I wanted to disable Global Shortcuts for Blender and happened on a nasty bug on Kubuntu 16.04 (applies to all windows).

The standard method is to go via right click on the title bar, 'More Actions' and 'Special Application (Window) Settings', clicking which completely froze my desktop. It wasn't reproducible on my laptop running 18.04, so I just note the workaround: don't ever click on those menu entries. Save your work more often. Change Window Rules via System Settings -> Window Management -> Window Rules.

26/03/2018

Spyder 3.2.8, pip3 and and PyQt5

I recently ran into segfaults on all my computers after upgrading spyder via pip3. Lots of Qt5 error messages. The trouble seems to be PyQt5-5.10.1; spyder 3.2.8 requires at least 5.10.0 (which happens to work). Thus pip3 install --upgrade PyQt5==5.10.0 spyder 
solved my issue.
Note to self: pip3 install PyQt5== is a handy way to list available versions. Sadly, it's deprecated (--use-deprecated=legacy-resolver).
Second note to self: There's also spyder==4.0.0b1 which seems to work with newer PyQts. Good thing I switched to virtual environments.

23/03/2018

Moving your thunderbird data to a custom location

Thunderbird's profile data is stored in ~/.thunderbird by default.
If that's inconvenient, i.e. due to disk quota limits, here's is how to move the profile folder. It will have some random name, we'll call it pr0f1le.default, and ~/.thunderbird contains a file profiles.ini and a folder named pr0f1le.default.
Here, I've moved the profile folder to e.g. /media/data/thunderbird/pr0f1le.default and changed profiles.ini to (changes in bold):
[General]
StartWithLastProfile=1

[Profile0]
Name=default
IsRelative=0
Path=/media/data/thunderbird/pr0f1le.default

Default=1

IsRelative has to be 0 because I've given Thunderbird an absolute path to the new location.

08/09/2017

How to get okular to play nice with pretty much all embedded movies

The trick is to have VLC play them, because vlc plays basically everything.
Install via apt-get either phonon4qt5-backend-vlc or phonon-backend-vlc or both.
In System Settings -> Audio and Video, prefer 'Phonon VLC' in the backend tab. If in doubt, restart Okular.

13/04/2017

Beamer to pptx via LibreOffice.

Notes on getting your beamer slides into PowerPoint via LibreOffice without too much postediting. (AKA boss asks you for a few quick slides from a recent presentation. Gah, I wish I'd figured out the tricks below last Monday)

Standard procedure:
  • Open PDF in LibreOffice Draw. 
  • Save as ODP (or as odg and rename the extension to odp).
  • Open in Impress. Fix display issues. Save as PPTX. Pray.

How to prepare your LaTeX source in order to minimise postediting:
  • Use a recent libreoffice. There were some improvements of the PDF import with regard to text spacing in 2014 which should have been implemented by version 5.x.
  • Speaking of text spacing: avoid justification. Best switch it off globally with the ragged2e package.
  • Don't use PDF figures. Convert to PNG if necessary.
  • Forget about conversion-proofing equations, take screenshots and add them afterwards as pictures. They will get screwed up during PDF import and then there's the issue of LibreOffice vs. PowerPoint math editors.
  • Use LuaLaTeX with a Microsoft system TTF font and switch off ligatures. (note setsansfont vs. setmainfont for beamer!)
  • Don't worry about advanced figure/text block positioning with columns or tikz pictures.  That stuff transferred surprisingly well.

Minimum example:

\documentclass{beamer}
\usepackage[document]{ragged2e}
\usepackage{fontspec}
\setsansfont[Ligatures = {NoRequired, NoCommon, NoContextual}]{Arial}
\usepackage{lipsum}
\begin{document}
 \frame{\frametitle{Lorem Ipsum}\lipsum[1]}
\end{document}



06/03/2017

Greek letters via compose key

h/t to Peter Williams: https://newton.cx/~peter/2013/04/typing-greek-letters-easily-on-linux/
If you don't have an .XCompose file in your home directory yet, copy the default file (replace locale if necessary, e.g. 'de_DE.UTF-8'):
cp /usr/share/X11/locale/en_US.UTF-8/Compose ~/.XCompose
The file in your home directory should take precedence over the one in /usr/share/… The default XCompose file already has the greek letter mapped using a key (line 5357 in my instance). If you don't have a Greek dead key defined in your key map, you can just switch to a different Compose prefix - e.g. 
<dead_greek> <d> : "δ" U03B4 # GREEK SMALL LETTER DELTA 
to 
<Multi_key> <g> <d> : "δ" U03B4 # GREEK SMALL LETTER DELTA 
which produces δ via <Compose>-g-d. I had to restart my application (e.g. LibreOffice) for the changes to take effect, but needed no logout/restart.
Also, sometimes the damn letters don't show up. It took me a while to realise that this might have something to do with the font in use not having them implemented (*headdesk*)