tag:blogger.com,1999:blog-6136579302243340792024-03-13T20:41:36.314+01:00Some blog about random Linux stuffavocadoheadhttp://www.blogger.com/profile/12354769500516971265noreply@blogger.comBlogger265125tag:blogger.com,1999:blog-613657930224334079.post-23274546048018614042023-02-16T15:53:00.002+01:002023-02-16T15:54:24.025+01:00Turning a LaTeX beamer presentation with movies into a portable PPTX via LibreOffice.<p><span style="font-family: inherit;">Use case: your talk venue insists you use their computer. And PowerPoint.</span></p><p><span style="font-family: inherit;">You'll need pdftoppm (or similar, comes with poppler) and FFMPEG if your movies still need conversion. And a recent Impress (mine was LO 7.4.4.2). Older versions crashed on saving as PPTX if there were embedded media. </span></p><p><span style="font-family: inherit;">First, create page images, in bash:</span><br /><span style="font-family: courier;">pdftoppm mypresentation.pdf img -png -r 250</span><br /><br />
<span style="font-family: inherit;">The output is a series of img-1.png, ...,img-n.png. Resolution is here 250.</span><br /><br />
<span>If necessary, convert all movies (let's assume they're .avi) to something PowerPoint/Impress will digest. Other containers and codecs might work as well, but my Windows failsafe is WMV2.</span></p><p><span style="font-family: courier;">ffmpeg -i input.avi -codec:v wmv2 -b:v 2000k output.wmv</span> </p><p><span>Batch conversion:</span>
<br /><span style="font-family: courier;">for m in *.avi; do ffmpeg -i $m -codec:v wmv2 -b:v 2000k ${m%avi}wmv; done</span> </p><p><span style="font-family: inherit;">Start a new Impress presentation, and add a photo album via the Insert->Media menu (see screenshot).</span></p>
<p></p><div class="separator" style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/a/AVvXsEhHGIJEhyiIcXX8yFP4qh_0ncuUSPRYan4qGPB9dwWzGiTmB1tkNFuJKLqX1uX_HpAhQY9eW4pHeCKOY2_IS7SZAwM6LMDJU-Vffazpa-fEo7dTgMD7LBlZBY9afhDSIB5fsaeqRWM5DRCtVmVJ6y-yNjruw7ab1l_ZVK3ekzQkiX8cDjr4h2ViD22wEg" style="color: #00c6dd; margin-left: 1em; margin-right: 1em; text-decoration-line: none;"><img alt="" data-original-height="629" data-original-width="862" height="234" src="https://blogger.googleusercontent.com/img/a/AVvXsEhHGIJEhyiIcXX8yFP4qh_0ncuUSPRYan4qGPB9dwWzGiTmB1tkNFuJKLqX1uX_HpAhQY9eW4pHeCKOY2_IS7SZAwM6LMDJU-Vffazpa-fEo7dTgMD7LBlZBY9afhDSIB5fsaeqRWM5DRCtVmVJ6y-yNjruw7ab1l_ZVK3ekzQkiX8cDjr4h2ViD22wEg" style="padding: 1px; position: relative;" width="320" /></a></div>
<span style="font-family: inherit;">At this point it's a good idea to protect position and size for all images in the slide (Properties sidebar). This is probably scriptable, but I'm not researching it today.</span>
<span style="font-family: inherit;">Add the movies on top of the slide images. Note: Videos added via drag and drop from a file browser will get linked and not embedded into the PPTX. To embed, you need to go via the Insert->Audio or Video... dialog. Save as PPTX.</span><p style="font-family: inherit;">Note: I tried importing PDFs directly into Impress but that only opened them in Draw . </p>avocadoheadhttp://www.blogger.com/profile/12354769500516971265noreply@blogger.com0tag:blogger.com,1999:blog-613657930224334079.post-35181326539128820932023-02-16T12:29:00.004+01:002023-02-16T12:29:36.715+01:00Customized matplotlib styles where python can find them.<p> Bugged me for a while. Turns out matplotlib is quite nitpicky about exact locations and file extensions. We assume the style file is called 'mystyle.mplstyle'.</p><p><span style="font-family: courier;">import matplotlib as mpl<br />import matplotlib.pyplot as plt</span></p><p>Find the configdir of your matplotlib:</p><p><span style="font-family: courier;">mpl.get_configdir()</span></p><p>Usually it's<span style="font-family: courier;"> ~/.config/matplotlib</span>. Put the style file in a subfolder named <span style="font-family: courier;">stylelib</span>.</p><p><span style="font-family: courier;">plt.style.use('mystyle')</span> should work now.</p><p>How to create your own style?</p><p>The syntax is the same as in a matplotlibrc file, so find one (e.g. via <span style="font-family: courier;">mpl.matplotlib_fname()</span>), copy and paste. </p>avocadoheadhttp://www.blogger.com/profile/12354769500516971265noreply@blogger.com0tag:blogger.com,1999:blog-613657930224334079.post-72346015254944016902023-02-01T14:26:00.004+01:002023-02-16T14:27:03.572+01:00How to get a matplotlib colormap into inkscape.<p>Inelegant, but works.</p><p>TL;DR: let python create an SVG file with a rectangle that uses the colormap as a gradient. Open, import or copy in inkscape.</p>
<p>Python code (this one gives coolwarm012.svg in your working directory):</p>
<p><span style="font-family: courier;">ncol=12 #number of stops<br />grad='coolwarm' #name of matplotlib gradient<br />from matplotlib import colors, cm<br />import numpy as np<br /><br />stopstr=""" <stop<br /> style="stop-color:%s;stop-opacity:1"<br /> offset="%.4f"<br /> id="stop%03d" />"""<br /><br />init="""<?xml version="1.0" encoding="UTF-8" standalone="no"?><br /><svg<br /> width="1cm"<br /> height="1cm"<br /> viewBox="0 0 1 1"<br /> id="svg"> <br /> <defs id="defs"><br /> <linearGradient<br /> id="%s%03d"><br />"""%(grad,ncol)</span></p><p><span style="font-family: courier;">exit="""<br /></linearGradient><br /></defs><br /><rect<br /> style="fill:url(#%s%03d)"<br /> id="rectangle"<br /> width="1"<br /> height="1"<br /> x="0"<br /> y="0"/><br /></svg>"""%(grad,ncol)<br /><br />cmap = cm.get_cmap(grad, ncol) <br />spac=np.linspace(0,1,ncol)<br /><br />#saves <gradientname+numberofstops>.svg with a 1x1cm^2 rectangle using the gradient <br />with open('%s%03d.svg'%(grad,ncol),'w') as f:<br /> f.write(init)<br /> for i in range(cmap.N):<br /> rgba = cmap(i)<br /> hexcol = colors.rgb2hex(rgba)<br /> f.write(stopstr%(hexcol,spac[i],i))<br /> f.write(exit)</span></p>
Some code taken from <a href="https://stackoverflow.com/questions/33596491/extract-matplotlib-colormap-in-hex-format">https://stackoverflow.com/questions/33596491/extract-matplotlib-colormap-in-hex-format
</a>avocadoheadhttp://www.blogger.com/profile/12354769500516971265noreply@blogger.com0tag:blogger.com,1999:blog-613657930224334079.post-2541755836774080992022-02-18T12:01:00.007+01:002023-02-27T10:17:03.377+01:00 How to convert a LaTeX beamer presentation with videos to PPTX using Python<p>Update: The crash issue appears to be fixed in recent LibreOffice. So there is really no reason to do all of the below any more, hooray. See <a href="https://eumenidae.blogspot.com/2023/02/turning-latex-beamer-presentation-with.html">updated howto</a>.</p><p>First, why on earth would you want to do that?<br /><br />The American Physical Society insists that you upload PPTX slides to their conference server and LibreOffice crashes every time I try to import a movie. The developers on the LO forums say it's not their problem because it works with ODP. Glad you asked.<br /><br />You'll need pdftoppm (or similar, comes with poppler) and the python-pptx and PIL modules. Also, FFMPEG if your movies still need conversion.<br /><br />First, create page images, in bash:<br /><span style="font-family: courier;">pdftoppm mypresentation.pdf img -png -r 250</span><br /><br />The output is a series of img-1.png, ...,img-n.png. Resolution is here 250. <br /><br />If necessary, convert all movies to something PowerPoint will digest. Other containers and codecs might work as well, but my Windows failsafe is WMV2.<br /><br /><span style="font-family: courier;">ffmpeg -i input.avi -codec:v wmv2 -b:v 2000k output.wmv </span><br /><br />Batch conversion:<br /><br /><span style="font-family: courier;">for m in *.avi; do ffmpeg -i $m -codec:v wmv2 -b:v 2000k ${m%avi}wmv; done</span><br /><br />We'll assume that we have movie1.wmv and movie2.wmv on slide 2 and movie3.wmv on slide 5. <br /><br />Now for the tedious bit - determine the bounding box (left, top, width, height, in px) for each movie on the img-1.png and img-5.png slide images. I just used gwenview's crop tool. <br /><br />Now for the python script:<br /><br /><span style="font-family: courier;">from pptx import Presentation<br />from pptx.util import Inches<br />from glob import glob<br />from PIL import Image<br /><br />prs = Presentation()<br />prs.slide_width = Inches(16) #assuming 16:9 aspect ratio<br />prs.slide_height = Inches(9)<br /><br />blank = prs.slide_layouts[6]<br /><br />imgs = sorted(glob("img*.png"))<br />w,h=Image.open(imgs[0]).size<br /># conversion factor for pixel values to inches.<br />pxtoin=16./w<br />slides={}<br /><br /># did the movie-slide attribution via some kind of messy dictionary/list construction. Use the top,left,width,height values determined above.<br />movies={4:[['movie3.wmv',[626,323,1263,708]]],<br /> 1:[['movie1.wmv',[155,324,710,710]],['movie2.wmv',[1163,324,710,710]]]}<br /><br />for i in range(len(imgs)):<br /> slides[i] = prs.slides.add_slide(blank)<br /> # add the slide contents as bitmaps<br /> pic = slides[i].shapes.add_picture(imgs[i], 0, 0, height=prs.slide_height)<br /> try:<br /> for it in movies[i]:<br /> movie = slides[i].shapes.add_movie(it[0],*[Inches(r*pxtoin) for r in it[1]]) <br /> except KeyError: pass<br /><br />prs.save("test.pptx") </span><br /><br /><br />This got me a minimum working presentation when I tested it on a remote Windows machine, apart from the fact that the movies had ugly speaker icons instead of poster images. There's a poster_frame_image keyword in add_movie where you can provide an image filename, but it didn't seem to change anything. <br /><br /> Sources:<br /><br />The python-pptx documentation has a lot of basic use cases. <a href="https://www.blogger.com/#">https://python-pptx.readthedocs.io/</a><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /><br /></p>avocadoheadhttp://www.blogger.com/profile/12354769500516971265noreply@blogger.com0tag:blogger.com,1999:blog-613657930224334079.post-82929688886900380762020-01-23T19:27:00.006+01:002021-08-18T18:28:32.018+02:00Installing external python modules for BlenderBlender comes with its own Python, and it's not necessarily your system's, so just symlinking system packages like matplotlib is risky and cumbersome.<br />
Some Googling Stackoverflow provided me with the following approach:<br />
<ul>
<li>create a (temporary) virtual environment (VE) linking against Blender's python executable</li>
<li>within that VE, pip install the packages you need, but into a folder in Blender's Python path (e.g. the one in ~/.config)</li>
<li>I'd keep the VE, but Blender doesn't need it to be active to run.</li>
</ul><p>In code (I keep Blender in ~/.local/bin, adapt to your setup), for matplotlib (You might have to run blender once at first to create the file structure in .config):<br /><span style="font-family: monospace;">virtualenv --python=~/.local/bin/blender-2.81a/2.81/python/bin/python3.7m ve-blender<br />source ve-blender/bin/activate<br />
mkdir -p ~/.config/blender/2.81/scripts/modules/<br />
pip install --upgrade -t ~/.config/blender/2.81/scripts/modules/ matplotlib<br />
deactivate</span>
<br />
<span style="font-family: monospace;"><br /></span>
Run Blender.<br />
</p><div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwnhdr5wb8Mo_nfF7Em-mExcl3zBfk8Fe-xZOk4HoG5P8qZs7cQKARoF7Rbs0u91PnBjEKi4KCLvww7Y8Dcjse-w6AJxXpNrwMpEIQzgq9So06NL2oltn-HDgB6TgIyuZ8roVRAlMroyZD/s1600/Screenshot_20200123_192652.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="922" data-original-width="655" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhwnhdr5wb8Mo_nfF7Em-mExcl3zBfk8Fe-xZOk4HoG5P8qZs7cQKARoF7Rbs0u91PnBjEKi4KCLvww7Y8Dcjse-w6AJxXpNrwMpEIQzgq9So06NL2oltn-HDgB6TgIyuZ8roVRAlMroyZD/s320/Screenshot_20200123_192652.png" width="227" /></a></div><p>
<span id="goog_1530006140"></span><span id="goog_1530006141"></span></p><p>Update: When I tried to do this with pickle5, gcc failed via "Python.h: No such file or directory".<br /></p><p>Fix: within the active VE, determine the Blender Python version (<span style="font-family: courier;">python -V</span>).<br />Download the respective sources (e.g. 3.7.7) from <a href="https://www.python.org/downloads/source/">www.python.org</a>. and unpack.<br />Copy the contents of the Include directory to <span style="font-family: courier;">~/.local/bin/blender-2.81/2.81/python/include/python3.7m/</span> (adapt versions and paths).</p><p></p><p>Next update:</p><p>Broken pip after initializing the virtual environment. Fixable via pip's bootstrap installer: <br /><span style="font-family: courier;">curl -sS https://bootstrap.pypa.io/get-pip.py | python3</span><br /><br />
Sources:<br />
<a href="https://stackoverflow.com/questions/1534210/use-different-python-version-with-virtualenv">https://stackoverflow.com/questions/1534210/use-different-python-version-with-virtualenv</a><br />
<a href="https://blender.stackexchange.com/questions/132278/how-to-make-use-of-custom-external-python-modules-in-blender-or-an-add-on-on-lin">https://blender.stackexchange.com/questions/132278/how-to-make-use-of-custom-external-python-modules-in-blender-or-an-add-on-on-lin</a></p><p><a href="https://blender.stackexchange.com/questions/81740/python-h-missing-in-blender-python">https://blender.stackexchange.com/questions/81740/python-h-missing-in-blender-python </a></p><p><a href="https://stackoverflow.com/questions/49478573/pip3-install-not-working-no-module-named-pip-vendor-pkg-resources ">https://stackoverflow.com/questions/49478573/pip3-install-not-working-no-module-named-pip-vendor-pkg-resources </a><br /></p>avocadoheadhttp://www.blogger.com/profile/12354769500516971265noreply@blogger.com0tag:blogger.com,1999:blog-613657930224334079.post-41571391347669578282019-10-26T14:36:00.001+02:002020-09-06T14:55:16.384+02:00IcyBox IB-RD3621U3 RAID1 with Ubuntu 16.04RAID is not backup, yeah, yeah, yeah…<br />
Still, my laptop is bursting its 512GB SSD and anything is better than my current backup method of randomly distributing copies of important data on external USB drives in various states of health.<br />
<br />
I settled on a mid price solution, two 4TB Seagate Barracuda and an IcyBox IB-RD3621U3 RAID enclosure, for about 250€ in total. Rsynced to a 4TB WD mobile drive I keep in daily use. <br />Setup procedure:
<ol>
<li>S.M.A.R.T. self test. Note: the IcyBox board is not Smart capable. To do a full initial self test on the drives, plug them into a desktop SATA. (smartctl -d sat provides output, but the test will fail)</li>
<li>Disk installation in the drive: note - there are handy stickers 'HDD1' and 'HDD2' in the box. Label your disks to correspond with the HDD1 and 2 labels on the front of the IcyBox.</li>
<li>RAID mode:<br />Switch the box off (1). Set the pins under MODE (2) to RAID1. Hold OK (3) pressed, switch the box on (1) and keep holding OK until the LED band at the front has stopped blinking in red (should take about 10 seconds)<br /> <a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkGumIDpj99a6-8txeZWfhnxEdRfRaUAj6ElfVxvdp3-tWSm9_GCpzhPxmuLqDXrFST-zty-FuUGOXhX3ogQBV4Sit0utiWYhGfMuNaC81XHbNblDaBVREQp0NtBpM0tcIC2uFrr7oycR-/s1600/IMG_20191026_142234631-01.png"><img border="0" height="192" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkGumIDpj99a6-8txeZWfhnxEdRfRaUAj6ElfVxvdp3-tWSm9_GCpzhPxmuLqDXrFST-zty-FuUGOXhX3ogQBV4Sit0utiWYhGfMuNaC81XHbNblDaBVREQp0NtBpM0tcIC2uFrr7oycR-/s320/IMG_20191026_142234631-01.png" width="320" /></a></li>
<li>Connect to a computer. The box should now register as a single drive in GParted, which you can format at will.</li>
<li>Note: GParted via the Dell XPS USB-C dongle hell didn't work too well, failed at creating the partition table.</li>
</ol>
<br />
<br />avocadoheadhttp://www.blogger.com/profile/12354769500516971265noreply@blogger.com0tag:blogger.com,1999:blog-613657930224334079.post-10634424526385066402019-06-11T12:17:00.002+02:002019-06-11T12:17:53.430+02:00KCM Wacom settings on (K)ubuntu 16.04There's a handy KDE System Settings module for configuring Wacom tablets - calibration, screen areas, you name it. I was rather keen to have it handle my old Graphire4 on a multi screen setup on my work desktop (Ubuntu 16.05).<br />
Sadly, the wacomtablet package (https://github.com/KDE/wacomtablet) seems to have been dropped from the repos between 14.04 and 19.04 due to ongoing bugfixes in dependencies.
They do offer instructions for manual compiling - with dire warnings that there'd there be no easy uninstall. 'make uninstall' worked nicely, though.<br />
However, I kept running into missing headers etc., until I found the one version that worked, 2.9.82.<br />
<br />
Command line log:<br />
<span style="font-family: Courier New, Courier, monospace;">wget https://github.com/KDE/wacomtablet/archive/v2.9.82.zip </span><br />
<span style="font-family: Courier New, Courier, monospace;">unzip v2.9.82.zip </span><br />
<span style="font-family: Courier New, Courier, monospace;">cd wacomtablet-2.9.82 </span><br />
<span style="font-family: Courier New, Courier, monospace;">mkdir build </span><br />
<span style="font-family: Courier New, Courier, monospace;">cd build </span><br />
<span style="font-family: Courier New, Courier, monospace;">cmake ../ -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Release -DKDE_INSTALL_USE_QT_SYS_PATHS=ON </span><br />
<span style="font-family: Courier New, Courier, monospace;">make </span><br />
<span style="font-family: Courier New, Courier, monospace;">sudo make install</span><br />
<span style="font-family: inherit;"><br /></span>
<span style="font-family: inherit;">Et voilà!</span><br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKJPiAmLrrs5DLshhZLbeGhhiT3MqBpHwu8XGuzpDu2REXuJkFWJ31PwG_8x3IglGKD1hU1dSY5KMFxchOlnK0nL1pitnWZ3c2tQGMDnR0wNv-LcuwUrGx_LZ_J7AkKPZsEVe3qqp563Rp/s1600/sceenshot.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="989" data-original-width="914" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKJPiAmLrrs5DLshhZLbeGhhiT3MqBpHwu8XGuzpDu2REXuJkFWJ31PwG_8x3IglGKD1hU1dSY5KMFxchOlnK0nL1pitnWZ3c2tQGMDnR0wNv-LcuwUrGx_LZ_J7AkKPZsEVe3qqp563Rp/s320/sceenshot.png" width="295" /></a></div>
<span style="font-family: Courier New, Courier, monospace;"><br /></span>avocadoheadhttp://www.blogger.com/profile/12354769500516971265noreply@blogger.com0tag:blogger.com,1999:blog-613657930224334079.post-32649145320290420522019-04-23T15:16:00.001+02:002019-04-23T15:16:25.733+02:00XPS13 webcam doesn't wake up (BIOS fix)The XPS13 9370 (summer 2018's model) webcam is horrible anyway (still stuck at the bottom of the display). However, it didn't help that it stopped working when the laptop resumed after suspend (all Kubuntu versions I used from 18.04 upwards).<br />
According to this <a href="https://www.dell.com/community/Linux-General/Dell-xps-13-9370-Webcam-support/td-p/6032049/page/17">Dell support discussion</a>, it was a BIOS problem that was fixed in BIOS 1.5.0 - I had 1.3.3. Updating seems to have fixed the problem.<br />
Steps:<br />
Get the current BIOS installer from <a href="https://www.dell.com/support/home/de/de/debsdt1/product-support/product/xps-13-9370-laptop/drivers">here</a>.<br />
Put it on a flash drive (unless you've got a USB-C one, the Dell dongle works. MicroSDs don't)<br />
Plug in your power supply.<br />
Press F12 during re-boot, select BIOS Flash Update. There should be a drop-down menu top left on the next screen that lets you select and browse the flash drive. Pick the EXE installer. Install. Reboot.avocadoheadhttp://www.blogger.com/profile/12354769500516971265noreply@blogger.com0tag:blogger.com,1999:blog-613657930224334079.post-76614021153497310852019-04-23T14:56:00.000+02:002019-04-23T14:57:07.240+02:00do-release-upgrade or don'tI couldn't resist the lure of the Dingo, but it took me some time to get there.
Long story short: do-release-upgrade is a picky bitch. It kept and kept and kept coming up with a "Your python3 install is corrupted. Please fix the '/usr/bin/python3'
symlink." message. That message is produced by a script downloaded into /tmp during the installation process and IMO *should* just make sure that the /usr/bin/python3 symlink points to a correct python binary (might have to be 3.6). After all, the update scripts have a "#!/usr/bin/python3" header.<br />
However, over the years, people have had to resort to the weirdest workarounds:
<br />
<ul>
<li>Make sure /usr/bin/python and /usr/bin/python3 point to python3.6</li>
<li>Reinstall default python3 </li>
<li>Purge anything done by update-alternatives (sudo update-alternatives --remove-all python)</li>
<li>Purge python2.x</li>
</ul>
Reader, I tried all of them.<br />
<span style="font-family: "courier new" , "courier" , monospace;">update-alternatives --display python</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">sudo update-alternatives --remove-all python</span><br />
<div>
<span style="font-family: "courier new" , "courier" , monospace;">sudo apt install --reinstall ubuntu-release-upgrader-core</span></div>
<span style="font-family: "courier new" , "courier" , monospace;">sudo apt install --reinstall python3</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">sudo ln -sf /usr/bin/python3.6 /usr/bin/python</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">sudo ln -sf /usr/bin/python3.6 /usr/bin/python3</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">sudo apt-get remove --purge python2.7-minimal</span><br />
In the end, purging python2.7 did the trick. That involved uninstalling inkscape and bits of TeXlive, but it was a small list of dependencies that could be reinstalled after the update.
Still, a mess. Serves me right for not bothering to do a clean reinstall.avocadoheadhttp://www.blogger.com/profile/12354769500516971265noreply@blogger.com0tag:blogger.com,1999:blog-613657930224334079.post-5876527373071503372019-04-11T16:47:00.001+02:002019-04-23T15:31:41.982+02:00articletitle, article-title, gnah! Joseph Wright is an awesome person who provides handy biblatex styles for numerous journals.<br />
Some of those require article titles in the submission reference list which are later removed for publication, so it makes sense to put in a switch when you load the package:<br />
<span style="font-family: "courier new" , "courier" , monospace;">\usepackage[style=science,articletitle=true]{biblatex}</span><br />
(the switch is defined in the science.bbx file, btw.) All hunky dory, except for the fact that the most recent texlive shipping with ubuntu (TeXLive 2018.20180824) still provides biblatex-science from 2016, where the switch is called <span style="font-family: "courier new" , "courier" , monospace;">article-title</span>. I hope the newest versions get into TexLive soon, apparently he's done quite a bit of cleanup.<br />
<a href="https://github.com/josephwright/biblatex-science/issues/1">https://github.com/josephwright/biblatex-science/issues/1</a><br />
Update: Fixed in the TeXlive 2018.20190227 that came with the Dingo upgrade. Gnah. Now my work desktop and laptop have different versions of the script. avocadoheadhttp://www.blogger.com/profile/12354769500516971265noreply@blogger.com0tag:blogger.com,1999:blog-613657930224334079.post-85127275620075812482019-03-25T23:56:00.005+01:002019-03-25T23:57:44.097+01:00Help! Kile is stuck!<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihEzmFbA98g90sBjjJ8v1lhVfnuZyznjFZ63mKbbbLJuHinIJnEW9qT9nS8KYCNjXovbyXF3urZsUqmWeE-OolWtwZF9r7jU9j0yBneJsnGX6sL2Yz2QjK7OKLQsK7HrN9TWE3Xh9h2KJK/s1600/Screenshot_20190325_233800.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="430" data-original-width="838" height="164" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEihEzmFbA98g90sBjjJ8v1lhVfnuZyznjFZ63mKbbbLJuHinIJnEW9qT9nS8KYCNjXovbyXF3urZsUqmWeE-OolWtwZF9r7jU9j0yBneJsnGX6sL2Yz2QjK7OKLQsK7HrN9TWE3Xh9h2KJK/s320/Screenshot_20190325_233800.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: left;">
"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.</div>
<div class="separator" style="clear: both; text-align: left;">
Ah well, let's find <span style="font-family: "courier new" , "courier" , monospace;">kilerc</span>, which happens to be in <span style="font-family: "courier new" , "courier" , monospace;">~/.config/</span> (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:</div>
<div class="separator" style="clear: both; text-align: left;">
<br /></div>
<div class="separator" style="clear: both;">
[FilesOpenOnStart]</div>
<div class="separator" style="clear: both;">
DocsOpenOnStart0[$e]=/path/to/file1.tex</div>
<div class="separator" style="clear: both;">
DocsOpenOnStart1[$e]=/path/to/file2.tex</div>
<div class="separator" style="clear: both;">
EncodingsOfDocsOpenOnStart0[$e]=UTF-8</div>
<div class="separator" style="clear: both;">
EncodingsOfDocsOpenOnStart1[$e]=UTF-8</div>
<div class="separator" style="clear: both;">
NoDOOS=2</div>
<div class="separator" style="clear: both;">
NoPOOS=1</div>
<div class="separator" style="clear: both;">
ProjectsOpenOnStart0[$e]=/this/path/is/invalid.kilepr</div>
<div class="separator" style="clear: both;">
<br /></div>
<div class="separator" style="clear: both;">
I just had to adapt the numbers and paths of docs and projects open on start after all. </div>
<br />avocadoheadhttp://www.blogger.com/profile/12354769500516971265noreply@blogger.com0tag:blogger.com,1999:blog-613657930224334079.post-84207435602170078142018-08-23T16:50:00.000+02:002018-08-23T16:50:07.690+02:00Zenbook data rescueRIP, Medusa (2013 Zenbook). I believe her power socket is finally dead. <br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvk06QRMC7d8FfB_8_rODvff2_BhXIW3pMcXfCHRt33_ezeBK2v08b_BCZta3INIIRDVoCIxBSvCr9fm_OQPOBj5iA9R1RZDCzZGbXaOYup-Pc9bcsFQy3y1g5B2Nyiw-jQ2Ku85GTUtQP/s1600/harddisk.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="641" data-original-width="1200" height="170" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvk06QRMC7d8FfB_8_rODvff2_BhXIW3pMcXfCHRt33_ezeBK2v08b_BCZta3INIIRDVoCIxBSvCr9fm_OQPOBj5iA9R1RZDCzZGbXaOYup-Pc9bcsFQy3y1g5B2Nyiw-jQ2Ku85GTUtQP/s320/harddisk.jpg" width="320" /></a></div>
<br />
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.<br />
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 <a href="https://www.m-ware.de/adapter-und-konverter/sata-adapter/m-ware-adapter-xm11-sdsa5jk-ssd-zu-sata-notebook-hdd-id14941/a-14941/">here</a>, but there are other suppliers as well). <br /><br />
avocadoheadhttp://www.blogger.com/profile/12354769500516971265noreply@blogger.com0tag:blogger.com,1999:blog-613657930224334079.post-52784805039481388992018-05-16T12:23:00.000+02:002018-05-16T12:29:16.436+02:00KDE freezes on Special Window/Application Settings menuI wanted to disable Global Shortcuts for Blender and happened on a nasty bug on Kubuntu 16.04 (applies to all windows).<br />
<br />
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLwtP2WDGO0fDYjake6xPChBmBiMBHmy3pATm8DRB4ZvChT5pXXl33S-atD3gAOCBAXmRNjwrURp-W0WAt4pIIZswWXmP9yFp5ZsnvcsNP-PARJg1s4blfAnQ0jKXhsWlkJ_-RVVPURmR4/s1600/Screenshot_20180516_122829.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><img border="0" data-original-height="435" data-original-width="665" height="209" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiLwtP2WDGO0fDYjake6xPChBmBiMBHmy3pATm8DRB4ZvChT5pXXl33S-atD3gAOCBAXmRNjwrURp-W0WAt4pIIZswWXmP9yFp5ZsnvcsNP-PARJg1s4blfAnQ0jKXhsWlkJ_-RVVPURmR4/s320/Screenshot_20180516_122829.png" width="320" /></a>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.avocadoheadhttp://www.blogger.com/profile/12354769500516971265noreply@blogger.com0tag:blogger.com,1999:blog-613657930224334079.post-86826881848505835332018-03-26T11:18:00.003+02:002021-02-03T14:15:30.097+01:00Spyder 3.2.8, pip3 and and PyQt5I 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
<span style="font-family: "courier new" , "courier" , monospace;">pip3 install --upgrade PyQt5==5.10.0 spyder </span><br />
solved my issue.<br />
Note to self:
<span style="font-family: "courier new" , "courier" , monospace;">pip3 install PyQt5==</span> is a handy way to list available versions. Sadly, it's deprecated (<span style="font-family: courier;">--use-deprecated=legacy-resolver</span>).<br />
Second note to self: There's also <span style="font-family: Courier New, Courier, monospace;">spyder==4.0.0b1</span> which seems to work with newer PyQts. Good thing I switched to virtual environments.avocadoheadhttp://www.blogger.com/profile/12354769500516971265noreply@blogger.com1tag:blogger.com,1999:blog-613657930224334079.post-6334222147212740402018-03-23T10:13:00.000+01:002018-03-23T11:16:55.918+01:00Moving your thunderbird data to a custom locationThunderbird's profile data is stored in ~/.thunderbird by default.<br />
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.<br />
Here, I've moved the profile folder to e.g. /media/data/thunderbird/pr0f1le.default and changed profiles.ini to (changes in bold):<br />
<div style="background-color: #555555; padding: 5px;">
[General]<br />
StartWithLastProfile=1<br />
<br />
[Profile0]<br />
Name=default<br />
<b>IsRelative=0<br />Path=/media/data/thunderbird/pr0f1le.default </b><br />
Default=1<br />
</div>
<br />
IsRelative has to be 0 because I've given Thunderbird an absolute path to the new location.<br />avocadoheadhttp://www.blogger.com/profile/12354769500516971265noreply@blogger.com0tag:blogger.com,1999:blog-613657930224334079.post-82467065669853741802017-09-08T13:01:00.001+02:002017-09-08T13:03:54.979+02:00How to get okular to play nice with pretty much all embedded moviesThe trick is to have VLC play them, because vlc plays basically everything.<br />
Install via apt-get either <span style="font-family: "courier new" , "courier" , monospace;">phonon4qt5-backend</span>-vlc or <span style="font-family: "courier new" , "courier" , monospace;">phonon-backend-vlc</span> or both.<br />
In System Settings -> Audio and Video, prefer 'Phonon VLC' in the backend tab. If in doubt, restart Okular.<br />
<br /><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGPTLZRbHeKWzhicTJxtTHA7J3FcoidbzQzD4qJ2-qzODpL3pb0Y9IgXF7pUSMO0TE89F29WhGnX2u5OKSNI8nHagvBxgXycqVMhWLTwSVP0OIecUlj-ytyvFmhu-13Q4mZCWeo7YRDf5-/s1600/phonon.png" imageanchor="1" ><img border="0" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhGPTLZRbHeKWzhicTJxtTHA7J3FcoidbzQzD4qJ2-qzODpL3pb0Y9IgXF7pUSMO0TE89F29WhGnX2u5OKSNI8nHagvBxgXycqVMhWLTwSVP0OIecUlj-ytyvFmhu-13Q4mZCWeo7YRDf5-/s320/phonon.png" width="320" height="280" data-original-width="656" data-original-height="574" /></a>avocadoheadhttp://www.blogger.com/profile/12354769500516971265noreply@blogger.com0tag:blogger.com,1999:blog-613657930224334079.post-78417605044244935252017-04-13T15:49:00.001+02:002017-04-13T16:00:06.419+02:00Beamer 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)<br />
<br />
Standard procedure:<br />
<ul>
<li>Open PDF in LibreOffice Draw. </li>
<li>Save as ODP (or as odg and rename the extension to odp).</li>
<li>Open in Impress. Fix display issues. Save as PPTX. Pray.</li>
</ul>
<br />
How to prepare your LaTeX source in order to minimise postediting:<br />
<ul>
<li>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.</li>
<li>Speaking of text spacing: avoid justification. Best switch it off globally with the ragged2e package.</li>
<li>Don't use PDF figures. Convert to PNG if necessary.</li>
<li>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. </li>
<li>Use LuaLaTeX with a Microsoft system TTF font and switch off ligatures. (note setsansfont vs. setmainfont for beamer!)</li>
<li>Don't worry about advanced figure/text block positioning with columns or tikz pictures. That stuff transferred surprisingly well.</li>
</ul>
<br />
Minimum example:<br />
<br />
<span style="font-family: "courier new" , "courier" , monospace;">\documentclass{beamer}<br />\usepackage[document]{ragged2e}<br />\usepackage{fontspec}<br />\setsansfont[Ligatures = {NoRequired, NoCommon, NoContextual}]{Arial}<br />\usepackage{lipsum}<br />\begin{document}<br /> \frame{\frametitle{Lorem Ipsum}\lipsum[1]}<br />\end{document}</span><br />
<br />
<br />avocadoheadhttp://www.blogger.com/profile/12354769500516971265noreply@blogger.com0tag:blogger.com,1999:blog-613657930224334079.post-32769119287470472532017-03-06T11:15:00.000+01:002017-04-13T14:58:37.886+02:00Greek letters via compose keyh/t to Peter Williams: <a href="https://newton.cx/~peter/2013/04/typing-greek-letters-easily-on-linux/">https://newton.cx/~peter/2013/04/typing-greek-letters-easily-on-linux/</a><br />
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'):<br />
<span style="font-family: "courier new" , "courier" , monospace;">cp /usr/share/X11/locale/en_US.UTF-8/Compose ~/.XCompose</span><br />
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 <dead_greek> 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><br />
<dead_greek><span style="font-family: "courier new" , "courier" , monospace;"><dead_greek> <d> : "δ" U03B4 # GREEK SMALL LETTER DELTA</span> </dead_greek><br />
<dead_greek>to </dead_greek><br />
<span style="font-family: "courier new" , "courier" , monospace;"><dead_greek><Multi_key> <g> <d> : "δ" U03B4 # GREEK SMALL LETTER DELTA </dead_greek></span><br />
<dead_greek>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.</dead_greek><br />
<dead_greek>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*)</dead_greek>avocadoheadhttp://www.blogger.com/profile/12354769500516971265noreply@blogger.com1tag:blogger.com,1999:blog-613657930224334079.post-72785340467457352162017-02-19T02:35:00.000+01:002017-02-19T10:14:33.371+01:00Garmin Fenix 3: maxing out the battery life.Some settings culled from a couple of forum threads and the official Garmin manuals. Go into the watch menu by pressing and holding Up, then choose Settings with the Go button. The following settings can affect battery life.<br />
<br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: right; text-align: right;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjW4viH440zhmu1yXtXBsRIzEsddDGooN9IlEO3GC5152iCLjqJyZTc-L0Iwjz9Ld9VWvicBusGm2P8o5Noit9WTpwapCFPsKXtLwY5avgjzVccdPz0-uakAtPtA0SaTWu0SExMCq7s9WHJ/s1600/ultratrac.png" imageanchor="1" style="clear: right; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjW4viH440zhmu1yXtXBsRIzEsddDGooN9IlEO3GC5152iCLjqJyZTc-L0Iwjz9Ld9VWvicBusGm2P8o5Noit9WTpwapCFPsKXtLwY5avgjzVccdPz0-uakAtPtA0SaTWu0SExMCq7s9WHJ/s320/ultratrac.png" width="223" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">GPS tracks by Garmin user canopenerboy</td></tr>
</tbody></table>
<b>Apps:</b><br />
<ul>
<li>Run (or whatever app you will use to record/navigate) →GPS →UltraTrack. In this mode, the GPS records, is switched off for a minute or so, on again, reacquires a signal, records, etc. This will extend the battery life, but considering how hard it is to get a fix while moving, it can result in really dodgy data. At least make sure your EPO is up to date. (<a href="http://www.javawa.nl/epo_en.html">http://www.javawa.nl/epo_en.html</a>)<br />Or better, skip UltraTrack and carry a charger (see below). <b> </b></li>
</ul>
<b>Watch Face:</b><br />
<ul>
<li><b> </b>Seconds Style. Pick one without a seconds hand/counter, so the watch face only updates every minute.</li>
</ul>
<b>Sensors:</b><br />
<table cellpadding="0" cellspacing="0" class="tr-caption-container" style="float: left; margin-right: 1em; text-align: left;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnN_CbWHR7T8k3zd1N2OnEuJkS18K0WMN3u_qOuAKa4dBoJ4eJX6B8QPZv4CiRWoQNsATw12fQVrRFa4p3tUGgLAhDVy30th8tNDXBSfp7ee9rf87lnikIrlKjEqU04OPvpxrZjLkmDta9/s1600/leastactiveday.jpg" imageanchor="1" style="clear: left; margin-bottom: 1em; margin-left: auto; margin-right: auto;"><img border="0" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjnN_CbWHR7T8k3zd1N2OnEuJkS18K0WMN3u_qOuAKa4dBoJ4eJX6B8QPZv4CiRWoQNsATw12fQVrRFa4p3tUGgLAhDVy30th8tNDXBSfp7ee9rf87lnikIrlKjEqU04OPvpxrZjLkmDta9/s320/leastactiveday.jpg" width="244" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Very thoughtful when you're ultra training.</td></tr>
</tbody></table>
<ul>
<li>Compass →Mode →off. I doubt this will seriously dent the battery life, though. Altimeter and barometer can't be disabled.</li>
</ul>
<b>Bluetooth</b>: Status →off<br />
<br />
<b>Activity Tracking:</b> Status →off. Duh. Unless you can't live without Insights.<br />
<br />
<b>System:</b><br />
<ul>
<li>Backlight: Mode manual, short timeout, reduce brightness.</li>
<li>Sounds: No one needs key tones. I'd keep alert tones, but switch off vibration. Shaking a steel watch consumes a lot of energy.</li>
<li>GLONASS: off. Unless you have GPS location troubles and know that the added GLONASS helps. </li>
<li> Data recording: "Smart" only reduces file size, not battery life. Garmin's .fit format is pretty compact (ballpark number: 100KB/h at the non-smart 1Hz recording rate) and you've got about 20MB of free space, so it's probably more useful to clean out/backup all .fit files from previous activities (GARMIN/ACTIVITY subfolder on the watch in mass storage mode)</li>
<li><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1rHk5nwG4z7sVcWbslmTYea23p3Vuttr4apBh8ldarox2nVYKXAGYStbO22PLT3t0Xt1HnEKKKtaOs5MjuIkR_Tc9JwEAWT2ku1DQzOOzq8Yg8eoOiTPbzFFkOcQnVjrU_vPQMV24DAwn/s1600/charging.jpg" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"><img border="0" height="268" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1rHk5nwG4z7sVcWbslmTYea23p3Vuttr4apBh8ldarox2nVYKXAGYStbO22PLT3t0Xt1HnEKKKtaOs5MjuIkR_Tc9JwEAWT2ku1DQzOOzq8Yg8eoOiTPbzFFkOcQnVjrU_vPQMV24DAwn/s320/charging.jpg" width="320" /></a>USB mode →Garmin. This will keep the watch data screens up if you charge during recording. The battery capacity is 300mAh, so even a compact 3000mAh lipstick power bank should be good for a couple of recharges and the watch can be worn with the charger clip attached.</li>
</ul>
<br />
My test run was about 10h in navigation mode, temperatures around freezing, all of the above settings except for UltraTrack (off), Compass (on), recording rate (1Hz, standard). Battery was down to 40%, so the advertised 16h battery life seems to be quite correct.avocadoheadhttp://www.blogger.com/profile/12354769500516971265noreply@blogger.com0tag:blogger.com,1999:blog-613657930224334079.post-73641998677936919922017-01-24T16:27:00.000+01:002017-02-09T11:04:27.001+01:00LuaLaTeX, TeXlive, beamer and multimedia<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="margin-left: 1em; margin-right: 1em;">
<div class="separator" style="clear: both; text-align: center;">
<a href="https://www.blogger.com/blogger.g?blogID=613657930224334079" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"></a></div>
<a href="https://www.blogger.com/blogger.g?blogID=613657930224334079" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><a href="https://www.blogger.com/blogger.g?blogID=613657930224334079" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-niwbORhe3zFgXqSFDk3Pas7tgsW9KEjtncCZGZXGHKH8ivhyrGVV21NW05a2Ompx89b0CldsszRCmEJ_-f-01hE083jzKF1fcOSiAjMrV3jTldT6_lD-qQFA1qGJCESd-KTr1d_AHLJL/s1600/screenshot.png" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"></a><a href="https://www.blogger.com/blogger.g?blogID=613657930224334079" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"></a><img border="0" height="212" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh-niwbORhe3zFgXqSFDk3Pas7tgsW9KEjtncCZGZXGHKH8ivhyrGVV21NW05a2Ompx89b0CldsszRCmEJ_-f-01hE083jzKF1fcOSiAjMrV3jTldT6_lD-qQFA1qGJCESd-KTr1d_AHLJL/s320/screenshot.png" width="320" /> </div>
<br />
<br />
Sometimes you need beamer to be a bit more, er, powerpointy. E.g., use a TTF font, have a more or less blank page and cram some text, images and movies on there. LuaLaTeX to the rescue. I installed texlive-xetex and texlive-luatex, got myself a minimal beamer template, started to dump objects into tikzpictures and compiled with lualatex instead of pdflatex. Sadly, what worked fine on TeXLive 2012 at work failed at home with a lot of nasty PDF specific error messages due to some bug in TeXLive 2016. Apparently, to get beamer, multimedia and LuaLaTeX to play nicely together, you need to add a <span style="font-family: "courier new" , "courier" , monospace;">\RequirePackage{luatex85}</span> as the first line in your document. So here's a minimal example in very bad taste.<br />
<br />
<div style="background-color: #555555; padding: 5px;">
%\RequirePackage{luatex85} %uncomment for texlive 2016<br />
\documentclass[gray]{beamer}<br />
\usepackage[english]{babel}<br />
\usepackage{fontspec}<br />
\setsansfont[Path = fonts/, <br />
Extension = .ttf,<br />
Ligatures = TeX,<br />
BoldFont = comicbd
]<br />
{comic}%use \setmainfont for non-beamer<br />
\usepackage{amsmath}<br />
\usepackage{multimedia}<br />
\setbeamertemplate{navigation symbols}{}<br />
\setbeamertemplate{footline}{}<br />
\setbeamertemplate{itemize items}[circle]<br />
\begin{document}<br />
\begin{frame}[plain]<br />
\frametitle{Science is fun!}<br />
\begin{columns}
\begin{column}{.5\textwidth}<br />
\begin{itemize}
\item random equation!
\end{itemize}<br />
\begin{align*}
\rho\left(\frac{\partial}{\partial t}+\vec{u}\cdot\vec{\nabla}\right)\vec{u} &=
-\vec{\nabla} p + \eta \nabla^2\vec{u}\\<br />
\vec{\nabla}\cdot\vec{u} &=0
\end{align*}<br />
\end{column}
\begin{column}{.5\textwidth}
\movie{\includegraphics[width=\textwidth]{movieposter}}{demomovie.avi}
\begin{itemize}
\item random animation!
\end{itemize}<br />
\end{column}
\end{columns}<br />
\end{frame}<br />
\end{document}</div>
Notes: I kept the TTF fonts in a subfolder 'fonts' next to the .tex source file. Font names correspond to the ttf file names without extensions (i.e. comic.ttf, comicbd.ttf). LuaLaTeX also works with system fonts, but then you're at the mercy of your font manager. In that case, just \setsansfont{comic} should work as well.<br />
Beamer's default font style is sans serif. For serif font styles, use \setmainfont instead.<br />
avocadoheadhttp://www.blogger.com/profile/12354769500516971265noreply@blogger.com0tag:blogger.com,1999:blog-613657930224334079.post-69549671449451554512016-07-14T11:04:00.005+02:002016-07-14T11:06:28.107+02:00Reminder: password protect PDF files.pdftk to the rescue!<br />
<span style="font-family: "courier new" , "courier" , monospace;">pdftk inputfile.pdf output outputfile.pdf userpw somepassword</span>avocadoheadhttp://www.blogger.com/profile/12354769500516971265noreply@blogger.com0tag:blogger.com,1999:blog-613657930224334079.post-3157432342694660492016-06-18T21:49:00.003+02:002016-07-14T11:02:37.782+02:00If Plasma's network manager doesn't display available networks after suspend/lock screen/etc....<span style="font-family: "courier new" , "courier" , monospace;">sudo service networking restart</span><br />
<span style="font-family: "courier new" , "courier" , monospace;">sudo service network-manager restart</span><br />
Bingo. avocadoheadhttp://www.blogger.com/profile/12354769500516971265noreply@blogger.com0tag:blogger.com,1999:blog-613657930224334079.post-1326990590930663382016-05-31T12:58:00.002+02:002020-09-06T14:26:35.811+02:00Damn you, kscreen<p>Actually, I like kscreen. The desktop display configuration interface is clicky, draggy and intuitive, and apparently they store settings for specific external monitors by EDID and feed them into xrandr once you connect the monitor.<br />
Enter my Zenbook, various microHDMI to VGA/HDMI dongles, external monitors and projectors. What happens, usually 10 minutes before an important presentation, on a bus without internet and my boss getting antsy, is KDE presenting me with a black screen and the mouse pointer stuck at the top screen edge. Panic mode fix: create a new user from the terminal. In the end I was stuck with 3 different temporary user accounts and no graphical interface unless the µHDMI to VGA dongle was plugged in. Don't judge me, I was overworked. <br />
Still, the troublesome configuration had to be somewhere in my home directory, so I needed to do some more creative renaming, i.e. .kde to .notkde, restarting sddm and praying to the deity of the moment.<br />
Kscreen's config files happened to be in ./local/share/kscreen, I just deleted them all, problem solved.<br />
Got a kernel update in the process and now I need to consolidate user accounts…</p><p>Update: As of 09/2020, kscreen still has problems with dongles. (PD USB-C hub with HDMI, XPS13 with BenQ screen) I got sick of constantly nuking the config files and tried apt remove kscreen. Config files still got written. Turns out you have to disable the kscreen service (System Settings->Startup). And now I'd better get used to Xrandr.<br /></p>avocadoheadhttp://www.blogger.com/profile/12354769500516971265noreply@blogger.com0tag:blogger.com,1999:blog-613657930224334079.post-9561383877082094082016-02-03T01:25:00.002+01:002016-06-10T15:01:41.470+02:00Three KDE5 quirks bugging me most right nowI recently upgraded to Kubuntu 15.10 (16.04 by now) and Plasma 5.<br />
Plasma 5 is gorgeous, but still a bit experimental in places. Erm, make that six and counting.<br />
<ul>
<li>Baloo desktop search. Once the index is written (takes hours on first run), it's actually usable. However, the config dialog in the system settings is incomplete. You're better off editing <span style="font-family: "courier new" , "courier" , monospace;">~/.config/baloofilerc</span>, as explained here:<br /><a href="https://community.kde.org/Baloo/Configuration">https://community.kde.org/Baloo/Configuration</a><br />Also, entirely disabling baloo search knocked out Dolphin's nice in-browser file search.</li>
<li>Dolphin hangs on startup in the home directory when hidden files are set to visible and Kile is running at the same time. (caused by Kile's <span style="font-family: "courier new" , "courier" , monospace;">~/.lyxpipe.in</span> and <span style="font-family: "courier new" , "courier" , monospace;">~/.lyxpipe.out</span>) Apparently fixed upstream: <a href="https://bugs.kde.org/show_bug.cgi?id=352828">https://bugs.kde.org/show_bug.cgi?id=352828</a></li>
<li>The device notifier has lost the automount configuration. There's a hack using the kde4<br />versions:<br />Edit <span style="font-family: "courier new" , "courier" , monospace;">/usr/share/kde4/services/kded/device_automounter.desktop </span>using the following line (value was 1 before): "X-KDE-Kded-phase=0"<br />Use <span style="font-family: "courier new" , "courier" , monospace;">kcmshell4 kcmkded </span>and<span style="font-family: "courier new" , "courier" , monospace;"> kcmshell4 device_automounter_kcm</span> to enable and configure automounting. Apparently fixed upstream as well.<br />Source: <a href="https://forum.kde.org/viewtopic.php?f=289&t=126846">https://forum.kde.org/viewtopic.php?f=289&t=126846</a></li>
<li>Dolphin context menu is missing the Ark extraction services. Fixable by <span style="font-family: "courier new" , "courier" , monospace;">sudo ln -s /usr/share/kde4/servicetypes/konqpopupmenuplugin.desktop /usr/share/kservicetypes5/ </span><br />Source: <a href="https://bugs.launchpad.net/ubuntu/+source/dolphin/+bug/1499530">https://bugs.launchpad.net/ubuntu/+source/dolphin/+bug/1499530</a></li>
<li>Dolphin etc. doesn't remember changes in mime type associations. Apparently it reads from one mimeapps.list file and saves to a different one. The solution is to link both to the same file.<br /><span style="font-family: "courier new" , "courier" , monospace;">ln -s ~/.local/share/applications/mimeapps.list ~/.config/mimeapps.list</span><br />
Source: <a href="https://bbs.archlinux.org/viewtopic.php?id=202636">https://bbs.archlinux.org/viewtopic.php?id=202636</a></li>
<li>Dolphin doesn't display PDF previews, even though they can be enabled in Preferences with kdegraphcis-thumbnailers installed. <br />Workaround:
<span style="font-family: "courier new" , "courier" , monospace;">sudo ln -s /usr/lib/x86_64-linux-gnu/plugins/* /usr/lib/x86_64-linux-gnu/qt5/plugins/ </span>Sources: <a href="https://bugs.kde.org/show_bug.cgi?id=351913">https://bugs.kde.org/show_bug.cgi?id=351913</a> <a href="http://osdir.com/ml/ubuntu-bugs/2016-04/msg19852.html">http://osdir.com/ml/ubuntu-bugs/2016-04/msg19852.html</a></li>
</ul>
avocadoheadhttp://www.blogger.com/profile/12354769500516971265noreply@blogger.com0tag:blogger.com,1999:blog-613657930224334079.post-51804131559321652272015-11-30T14:49:00.001+01:002016-05-31T13:18:21.328+02:00apt-get update gets stuckJust a quick note:
apt-get update froze regularly updating my software sources, with the shell output stuck at <span style="font-family: "courier new" , "courier" , monospace;">100% [Connecting to security.ubuntu.com]</span> or similar.<br />
Apparently, this was caused due to IPv6 being enabled on my system.
See this <a href="http://askubuntu.com/questions/272796/connecting-to-archive-ubuntu-com-takes-too-long">askubuntu discussion</a>.<br />
Fixes (as copied from the link above):<br />
<ul>
<li>edit <b>/etc/gai.conf</b> and uncomment the last line to change the order of precedence to IPv4 first:
<div style="background-color: #bbbbbb; color: black; padding: 5px;">
#<br />
# For sites which prefer IPv4 connections change the last line to<br />
#<br />
<b>precedence ::ffff:0:0/96 100
</b></div>
</li>
<li>Alternative: disable IPv6. Not sure whether that is a good idea, so first try option 1. Anyway, you can reverse this action by deleting the lines added to <span style="font-family: "courier new" , "courier" , monospace;">/etc/sysctl.conf</span> (everything below<span style="font-family: "courier new" , "courier" , monospace;"> #disable ipv6)</span>.<br /><span style="font-family: "courier new" , "courier" , monospace;">echo "#disable ipv6" | sudo tee -a /etc/sysctl.conf<br />
echo "net.ipv6.conf.all.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf<br />
echo "net.ipv6.conf.default.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf<br />
echo "net.ipv6.conf.lo.disable_ipv6 = 1" | sudo tee -a /etc/sysctl.conf<br />
sudo sysctl -p
</span></li>
<li>Check whether IPv6 is enabled with <span style="font-family: "courier new" , "courier" , monospace;">cat /proc/sys/net/ipv6/conf/all/disable_ipv6</span>, output is 0/1 for enabled/disabled.</li>
<li>"Have you tried switching it off and on again?" </li>
</ul>
avocadoheadhttp://www.blogger.com/profile/12354769500516971265noreply@blogger.com0