Scientific Computing

Build POV-Ray

Install POV-Ray by:

apt install povray

or build POV-Ray from source

Example POV-Ray tutorial

#include "colors.inc"
background { color Cyan }
camera {
    location <0, 2, -3>
    look_at  <0, 1,  2>
}
sphere {
    <0, 1, 2>, 2
    texture {
        pigment { color Yellow }
    }
}
light_source { <2, 4, -3> color White}

POV-Ray can accomplish photorealistic rendering via raycasting.

POV-Ray example

Play video from Beamer LaTeX presentation PDF

To pop up your default video player upon click in Beamer LaTeX-generated PDF, use the LaTeX syntax

\href{run:myvideo.avi}{cool video}

You must use either

  • relative path (e.g. ../data/myvid.avi gfx/myvid.avi)
  • fully resolved absolute path (e.g. /home/joe/data/myvid.avi)

These will NOT work

  • ~
  • $HOME

LaTeX Beamer multi-column table of contents

A LaTeX Beamer presentation (slide deck) with a long table of contents as generated by

\tableofcontents

may run off screen.

Fix

add to LaTeX preamble (near top of main .tex file):

\usepackage{multicol}

Then the TOC slide will go over multiple columns. In this example Beamer slide, two column table of contents is specified:

\frame{
\begin{multicols}{2}
\tableofcontents
\end{multicols}
}

Ubuntu applications shortcuts

For Linux desktop environments programs show up in menus from:

  • /usr/share/applications
  • ~/.local/share/applications ← especially for WINE

Sometimes an application might not appear in the desktop menus because it doesn’t have a .desktop file in either of these locations. Try opening one of the .desktop files for a program that works, and saving as a new file, editing for a program you’d like to work the same way.

Reference

LaTeX content in parent/sibling directories

error: epstopdf Output filename not allowed in restricted mode

may occur if you include .eps files above the directory of the .tex file. LaTeX by default cannot traverse upwards from the current “*.tex” directory. This is generally a good security choice.

When necessary, it is possible to bypass this security by including the --shell-escape option in pdflatex command:

pdflatex --shell-escape myfile.tex

In TeXmaker / TeXstudio, under: Options → Configure → Commands add --shell-escape right after pdflatex in the PdfLaTeX command box.

This example shows when --shell-escape is needed. Assuming files

~/work/report.tex
~/matlab/plot.eps

This LaTeX content triggers the error until --shell-escape is used.

\includegraphics{../matlab/plot.eps}

Unstick Windows update network connection

Windows Fast Ring builds keep sticking at 87% before updating. I got into a giant boot loop where the update would fail or I’d hard reboot (hold power button) and this was not working. This problem can be fixed by if computer is on WiFi, additionally plug it in via Ethernet. This may require a USB 3 to Ethernet adapter if your PC doesn’t have an Ethernet port.

  1. Unplug the Ethernet connector when Windows Update is stuck (for me it was at 87%)
  2. wait say 10 seconds, then plug in Ethernet again.
  3. upon plugging Ethernet in, Windows Update very rapidly finished the update and rebooted and continued installing Windows.

This happened for me on multiple Windows builds. Each time, the procedure above made Windows Update complete rapidly and successfully.

TeXstudio user dictionary ignored words

The TeXstudio user dictionary is a plain-text .ign file. The user dictionary is used for simple match-and-ignore.

  • Linux: ~/.config/texstudio/texstudioen_US.ign
  • Windows: %APPDATA%/Roaming/TeXstudio/dictionaries/en_US.ign