Friday, January 24, 2014

Medieval Cyrillic fonts in LaTeX (or XeLaTeX)

Links: tfm font install :: ttf fonts available :: old bulgarian lcyw
Note: a short note about LibreOffice at bottom

The name of one of the intstalled (2021) LaTeX packages is fonts-churchslavonic. And there's a good explanation of how to implement it here: https://www.ctan.org/tex-archive/fonts/fonts-churchslavonic.Overall however, we'd want to write in Latin fonts, but then convert them in our markup. LaTeX does also contain some TTF utilities.

LaTeX - installed cyrillic fonts

LaTeX font files have an associated .tfm file. Find their directory by following the variable (TEXMFLOCAL) which points to it. The list of directories for various fonts is underneath it...
$ kpsewhich --var-value TEXMFLOCAL
$ ls ~/latex/2013/texmf-dist/fonts/tfm/
$ cd latex/2013/texmf-dist/doc/fonts/
Inside here, we can see most any of the codes we need for the \renewcommand{\sfdefault}{some code}\normalfont command. I don't know of any definitive listing of all of them, but some have Cyrillic characters and some don't, eg Cantarell has Cyrillics and its code is "fca". To switch to Cantarell
\renewcommand{\sfdefault}{fca}\normalfont
For proper line breaks, it's additionally good to point out "\textcyrillic{}", eg.
\textcyrillic{машина}
And of course code is needed at the top of the TEX document:
\usepackage[T2A,T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[russian,english]{babel}

pdflatex - packages


In a TexLive installation, Old Slavonic text pasted from this posting compiled in pdflatex with the following headers...
\documentclass[letterpaper]{article}
\usepackage{amsmath,amsthm,amssymb}
\usepackage{mathtext}

\usepackage[T2A]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english,bulgarian,russian,ukrainian]{babel}
\begin{document}
Russian text block
\end{document}
...however T2A coding is not a solution because it produced mostly Ukrainian versions instead of OCS. Close, but no cigar. Substituting T2C did slightly better, for example with "theta", but otherwise mostly produced Serbian versions. X2 coding provided only one dot over the "I", and so on. So we were left with pieces of success, but mostly failure (with respect to OCS), in each option. Unless I've overlooking something, it's possible one would have to build their own glyphs to properly code the OCS using pdflatex. Further, we'd still have run T1 coding if we have English (latin alphabet) portions in the document.

pdflatex - take two

I decided to seek from an Old Bulgarian angle. A Macro was located here, which included an INS with the DTX.
$ kpsewhich --var-value TEXMFHOME
$ unzip lcwy.zip -d ~/texmf
$ texhash

xelatex - packages


Using xelatex, the following compiled...

\documentclass[letterpaper]{article}

\usepackage{fontspec}
\usepackage{xunicode}
\usepackage{xltxtra}

\setmainfont{DejaVu Sans}

\begin{document}
Russian text block
\end{document}
... but produces a severe, sans-serif Ukrainian.

alphabetum


LibreOffice - ttf

For WYSIWYG, a partial solution is true-type fonts. We can obtain fonts here for some medieval slavic fonts. One researcher particularly liked "dilyan.ttf", and "BukyVede-Regular.ttf"; he said they were accurate except for lacking diacritics. I explained he could place TTF's into LibreOffice /usr/share/fonts or ~/.fonts, directory (I prefer ~./fonts); they were immediately available on his font list the next time he opened LibreOffice.

Monday, January 6, 2014

[solved] zotero consistency - standalone w/browsers

Links: Zotero resources

After an update to Chromium, and using standalone Zotero, I no longer had Zotero icons in the URLbar at book and article sites. What a pisser --- it looks like yet another "one of those things" on the long list of problems we all face during updates. I wish I were a database designer so I didn't have to rely on database products (eg. Zotero), but that's life.

solution

It appears the new disconnect between the browser and Zotero is a "translation" issue. I went to the Zotero site and downloaded the Chromium extension "Zotero Connector" and, voila, my URLbar icons for documents reappeared.

citation backup - zotero

Some of us forget where we installed the data directory when we installed Zotero originally. Open Zotero then note the "Show Data Directory" button (Edit-> Preferences -> Files and Folders) which points to it. The best backup is to copy the "zotero" folder with all subdirectories (eg., "storage").

bare bones

In a pinch, copy the file and subdirectory:
  • zotero.sqlite
  • "storage" subdirectory
With these, use a file manager to overwrite the vanilla versions of these after a vanilla install.

restoration

If I only have the database, without storage, I'd have to reenter all the notes and so forth, but I'd at least have my titles and authors. Overwriting an entire install's "storage" directory and zotero sqlite is a complete restoration.