Monthly Shaarli

All links of one month in a single page.

August, 2023

Zoom lectures on 20th century physics from MIT OCW

A nice series of lectures from MIT on the 20th century history of physics (Maxwell's equations, light quantisation, etc.) by David Kaiser. Recorded in fall 2020, just recently shared on their OpenCourseWare youtube channel:

Numeric style biblatex with citation [1] in mainmatter despite citations in frontmatter?
thumbnail

Using biblatex with a numeric style and a book class with frontmatter/mainmatter, would it be possible to have all citations in the frontmatter appear last in the list of references, as if the frontmatter (from biblatex's point of view) appeared after the mainmatter?

\documentclass{book}
\usepackage[utf8]{inputenc}

\usepackage[backend=biber,sorting=none,style=nature]{biblatex}
\usepackage{filecontents}
\begin{filecontents}{\jobname.bib}
@misc{hydrogen,
  author = {Author, A.},
  year = {2001},
  title = {Alpha}}
@misc{neodymium,
  author = {Luthor, Lex.},
  year = {2002},
  title = {Bravo}}
\end{filecontents}
\addbibresource{\jobname.bib}

\frontmatter
\cite{neodymium}

\mainmatter
\cite{hydrogen}

\backmatter
\printbibliography[title={List of references}]

\end{document}

In the above MWE, references in the "List of references" are printed in the same order as they were given in the document, so neodymium would be listed before hydrogen in the "List of references".
This also means that the citation in the frontmatter would be labelled [1] in the text and the first citation in the mainmatter would be labelled [2].
This is just as expected with the numeric style as often used in science and engineering theses.

I wonder if there is some way to make the first citation in the mainmatter be [1] (because it might be jarring for the reader to see the first citation in the first chapter be something like [11], it may make them wonder what they missed), without having a separate \printbibliography for the frontmatter (nor using refsection or refsegments, because I don't think they will help in this case). Preferably any citations in the frontmatter would simply be appended to the end of "List of references", as if the frontmatter was processed after the frontmatter by biblatex.

I think this would be hard to achieve. But I'd like to hear if anyone knows better?
Would something like this be possible? Have I missed something obvious?

I have read the Sorting section in the biblatex manual, and read these related (but not-very-pertinent) questions on TeX.SE

gpg password prompt in the terminal when using SSH (but only then)?

Passwordstore is a great password manager, and I rely on it also in my Ansible playbooks, where it works by causing the gpg-agent to prompt me for the passphrase of my gpg key.

This prompt is a GUI prompt, which is very suitable when sitting at the computer in question. But a small annoyance is that it does not work at all when working on a remote computer via ssh (the prompt shows up on the remote computer's desktop, and the Ansible playbook in the terminal just freezes until it eventually fails).

It would be so much nicer if those ssh terminal sessions would instead get the gpg-agent prompt in the terminal. So far I have not found a method that achieves this without also sacrificing the GUI desktop prompt for non-remote work.

Desktop and laptop running Ubuntu 22.04 with i3wm desktop.
The relevant parts of my config can be seen in https://codeberg.org/ansible/dotfiles.

I considered the following related Q:s&A:s but did not achieve the desired outcome.

Some more tests

In the SSH session (no effect, unfortunately):

gpg-connect-agent updatestartuptty /bye

Learned that the gpg-agent is running in --supervised mode, and its ENV variables include DISPLAY=:0:

solarchemist@desktop:~
$ sudo cat /proc/2652288/environ
HOME=/home/solarchemist LANG=en_US.UTF-8 LC_TIME=sv_SE.UTF-8 LOGNAME=solarchemist
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/snap/bin
SHELL=/bin/bash SYSTEMD_EXEC_PID=2652288 USER=solarchemist
XDG_DATA_DIRS=/home/solarchemist/.local/share/flatpak/exports/share:/var/lib/flatpak/exports/share:/usr/local/share/:/usr/share/:/var/lib/snapd/desktop
XDG_RUNTIME_DIR=/run/user/1000 QT_ACCESSIBILITY=1
DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/1000/bus DISPLAY=:0 XAUTHORITY=/home/solarchemist/.Xauthority
MANAGERPID=1532 LISTEN_PID=2652288 LISTEN_FDS=4
LISTEN_FDNAMES=browser:extra:std:ssh INVOCATION_ID=<stuff> JOURNAL_STREAM=<stuff>

(the PID of the gpg-agent process is easily identified with ps aux | grep [g]pg).

Manual work-around

Manual work-around is to set pinentry-program /usr/bin/pinentry-tty in ~/.gnupg/gpg-agent.conf and reload the agent gpg-connect-agent reloadagent /bye.
To revert to the default (GUI) pinentry behaviour, just remove the line and reload the agent again.

Draw a line on top of your screen

How could we go about to draw a straight line (vertical or horizontal) on top of any other window on our Linux desktop? I'm using i3 window manager with picom compositor at present, so I'm primarily interested in solutions that works for that.

I should get back to this question in the future and implement a nicer solution than pango-view

pango-view

Produces a vertical line (actually, more of a vertical box of limited width).
Very easy to make it, just issue the command in a terminal. pango-view was already installed.

$ pango-view --height=99999 --margin=1 --background=red -t ''