Digesting multi-stranded narratives

Two-layered referencing

Advertisements

Robert Graves, in his Greek Myths, used a citation style where each component of the myth was sourced to a list of relevant ancient authors and works. That technique will work for any narrative in general where there are multiple reporters, and will highlight the variations and commonalities of the different strands of traditions.

 

gamut

In Latex/Xelatex, this can be done by using the bibliography package biblatex with the option style=numeric-verb, which numbers the references, and in footnotes, if there are a series of cites, puts each of the items into their own set of square brackets.

To key them in any order but have them display in numerical order in the footnote, the biblatex option sortcites=true is used.

Rather than actual footnotes, putting all the notes at the end of the text is done by using the endnotes package, \usepackage{endnotes}, and setting the footnote to be an endnote with:

\let\footnote=\endnote

Next comes setting the endnotes to normal size

\renewcommand{\enotesize}{\normalsize}

and adjusting their margin

\makeatletter
\def\enoteformat{%
 \rightskip\z@ \leftskip\z@ %\parindent=1.8em
 \leavevmode{\setbox\z@=\lastbox}{\theenmark.\enskip}%
}
\makeatother

 

Now a shorthand command will come in handy to save typing in the full footnote and citation commands each time:

\newcommand\fnc[1]{\footnote{\cites{#1}}}

We type some text, with the references:

Item 1\fnc{a5,a3,a2}. Item 2\fnc{a1, a2}. Item 3\fnc{a5}. Item 4\fnc{a4}, Item 5\fnc{a4}, Item 6\fnc{a5,a4,a3,a2,a1}.

Print the endnotes with:

\theendnotes

And print the bibliography with:

\printbibliography

Job done.

Full code:

 

\documentclass{article}
\usepackage{filecontents}
\begin{filecontents*}{newsbase.bib}
%=====
% the test bibliography:
@article{a1,
author={An Author Name},
title={title 1},
titleaddon={[translation of title goes here]},
journaltitle={Example X},
date={2018-06-09}
}
@article{a2,
title={title 2},
journaltitle={Example Y},
}
@article{a3,
title={title 3},
journaltitle={Example Z},
}
@article{a4,
title={title 4},
journaltitle={Example cat},
}
@article{a5,
title={title 5},
journaltitle={Example fog},
}
\end{filecontents*}

%=====
% biblatex for the bibliography
\usepackage[british]{datetime2} % for date formatting of \today
\usepackage[style=british]{csquotes}
\usepackage[style=numeric-verb, sortcites=true, citereset=section, ibidtracker=true, indexing=cite, backend=biber, isbn=true, 
language=australian, 
%babel=hyphen
%autolang=true
]{biblatex}
\addbibresource{newsbase.bib}

%=====
% use endnotes instead of footnotes
\usepackage{endnotes}
\let\footnote=\endnote

%=====
%reset footnote marker size: not needed now, because endnotes are being used instead
\makeatletter
\def\@makefnmark{\hbox{[\normalfont\@thefnmark]}}
\makeatother

%=====
%set the endnotes to normal size, not footnote size:
\renewcommand{\enotesize}{\normalsize}

%=====
%original command to position the endnotes with respect to the margin:
%\makeatletter
%\def\enoteformat{%
% \rightskip\z@ \leftskip\z@ \parindent=1.8em
% \leavevmode{\setbox\z@=\lastbox}\llap{\theenmark.\enskip}%
%}
%\makeatother




%=====
%don't need paragraph indent when setting the format for the endnotes, but the rest of the command shifts everything to the right by a bit, so that it lines up.
\makeatletter
\def\enoteformat{%
 \rightskip\z@ \leftskip\z@ %\parindent=1.8em
 \leavevmode{\setbox\z@=\lastbox}{\theenmark.\enskip}%
}
\makeatother

%=====
%footnotes are not being used, so setting footnotes to normal size font won't do anything:
%\let\Huge\normalsize
%\let\huge\normalsize
%\let\LARGE\normalsize
%\let\Large\normalsize
%\let\large\normalsize
%\let\small\normalsize
\let\footnotesize\normalsize %footnote text
%\let\scriptsize\normalsize
%\let\tiny\normalsize

%=====
%short-version of the to-be-used-quite-often footnote~cite command pair; the cites command, because there could be multiple sources, and it handles one or more (comma separated):
\newcommand\fnc[1]{\footnote{\cites{#1}}}

%=====
%the data, meaning the text:
\begin{document}
Item 1\fnc{a5,a3,a2}. Item 2\fnc{a1, a2}. Item 3\fnc{a5}. Item 4\fnc{a4}, Item 5\fnc{a4}, Item 6\fnc{a5,a4,a3,a2,a1}.

%=====
%print the endnotes:
\theendnotes

%=====
%print the bibliography:
\printbibliography

%=====
%typesetting run is: xelatex, biber, xelatex, xelatex.
%
\end{document}

 

Visualising networked relationships

mathematicalplankton

With Latex (and Xelatex), networked relationships between entities, who talks to who(m), and so on, can be visualised. Some of the diagrams begin to take on the form and appearance of microscopic plankton, which suggests there will be whole ecosystems in social space (both human and electronic) to explore.

The picture is an example of an interaction net, and the programmatic definition comes from the tikz-inet package documentation (with .tex code via Overleaf, if I remember*).

 

*I feel a little bit like Humboldt on first looking into the sea.

 

 

 

Woodblock emulation

Latex: Can do

Latex.

The moral of the story, in the Tex/Latex/Xelatex world, is that it is solvable.

Given the traditional Chinese woodblock printing style, from top-down, right-to-left, the typesetting algorithm puzzle to solve is: given a string of characters, what is the formula for sequentially printing them Chinese-style into a w x h grid starting from the top left corner as column 1 row 1?

Answer: (w – c) * h + r

The symmetry group is almost quark-like if a third dimension were to be added.

 

vzh3a

Conjecture: Any (ordered) arrangement of locations, whether characters on a page, vertices in a crystal, or gluons in a glob, would have the same underlying mathematics.

 

The TBRL result, using the Chinese Wikipedia article on the star Achernar (水委一, shuǐ wěi yī) as an excerpt source (mid-March 2018 version; it has since been edited), is:

vz1JPG

River End Prime is a …”

Obviously, the next step is that punctuation etc needs to be made auto-adjusting, but that is solvable too.

It’s all in the formula.

 

vz0

 

 

 

 

Vertical

Using TeX for vertical typesetting

TeX is very good at horizontal typesetting, and can even do quite good vertical typesetting by the knack of using fonts with rotateable glyphs,  setting the page with its usual glue and stretchable spaces, then rotating the entire page 90 degrees.

Doing vertical typesetting by hand, so to speak, should also be possible.

Here follows an attempt:

Draw  a grid, then position the characters by trial-and-error adjustments:

vertical1

with code like this:

 

\draw[step=\dunit, color=blue]{ (0,0) grid (8,12)};
\node at (8-0.40,12-0.40) {\huge\ver\char”5647};
\node at (8-0.40,11-0.20) {\huge\ver\char”5648};
\node at (8-0.40,10-0.05) {\color{red}\huge\ver\char”5F48};
\node at (8-0.40,9+0.15) {\huge\ver\char”5748};
\node at (8-0.40,8+0.35) {\huge\ver\char”5848};

When finished, draw the grid in white, say, to get:

vertical2

It would be more convenient to have all the adjustments and positioning built-in, so to speak, and that can be done in the Tikz package by naming the text nodes methodically and then populating them (manually at first, later by a macro loop):

 

\node at (letters.center 14 12){\rotatebox[origin=c]{-90}{\huge\ver\char”300E}};
\node at (letters.center 14 11){\huge\ver 他};
\node at (letters.center 14 10){\huge\ver 们};
\node at (letters.center 14 9){\huge\ver 是};

but a square grid, rather than a rectangular one, is assumed:

vertical3

If each square is defined as a set of four sub-quadratures, and inter-column spacing were a parameter relative to font size, with subsequent headings, margin notes, and so on, much could be done.

The quest continues.

 

Little Lorem

Random characters from a specific script

Place-filling text (lorem ipsum) to give an idea of what a page layout would look like has a long pedigree and TeX can do it well.

Sometimes an idea of what characters in a specific script would look like is also needed.

textlipsum

Here’s some TeX code for that (it started off as displaying random Chinese characters [by egreg on stackexchange in 2011], but has been expanded to handle any Unicode block as requested):

%Random text by script

\documentclass[a4paper]{article}

%\errorcontextlines 10000 %for getting fuller error messages

\usepackage{geometry}

\geometry{margin=2cm,heightrounded}

\usepackage{fontspec}

\setmainfont{Cambria}

\usepackage{xcolor}

\usepackage{soul}

\input{random}

\newcount\cjkcharcnt

%\random=3

%-------------------------- customised section:

% Yi block

\newcommand\yistartc{"A000}

\newcommand\yistopc{"A48C}

% Linear A block

\newcommand\linastartc{"10600}

\newcommand\linastopc{"10726}

% Linear B syllabary block

\newcommand\linbsstartc{"10000}

\newcommand\linbsstopc{"1005D}

% Linear B ideograms block

\newcommand\linbistartc{"10080}

\newcommand\linbistopc{"100FA}

% Vai block

\newcommand\vaistartc{"A500}

\newcommand\vaistopc{"A62B}

% Miscsellaneous symbols, emoticons, etc blocks

\newcommand\iconstartc{"1F300}

\newcommand\iconstopc{"1F6D2}

% Tangut Components block

\newcommand\tangutcomstartc{"18800}

\newcommand\tangutcomstopc{"18AF2}

% Tangut block

\newcommand\tangutstartc{"17000}

\newcommand\tangutstopc{"187EC}

% Bamum block

\newcommand\bamumstartc{"16800}

\newcommand\bamumstopc{"16A38}

% Anatolian hieroglyphs block

\newcommand\anatolianstartc{"14400}

\newcommand\anatolianstopc{"14646}

% Egyptian hieroglyphs block

\newcommand\egyptianstartc{"13000}

\newcommand\egyptianstopc{"1342E}

% CJK part block

\newcommand\cjkstartc{"4E00}

\newcommand\cjkstopc{"9FBB}

% Phaistos Disc block

\newcommand\phaistosstartc{"101D0}

\newcommand\phaistosstopc{"101FD}

%Cuneiform block

\newcommand\cuneiformstartc{"12000}

\newcommand\cuneiformstopc{"12399}

%

\newcounter{startc}

\newcounter{stopc}

%--------------------------------------------------------------------

% url= https://tex.stackexchange.com/questions/20409/how-to-create-a-table-of-random-characters-in-xetex

% question = How to create a table of random characters in XeTeX:

% "I want to create a table of 1000 characters picked randomly from the unicode block "unified CJK ideograms" (4E00-9FFF). Each cell should contain exactly one huge character, no character should appear twice."

% answer = answered Jun 10 '11 at 16:18 by egreg

\newif\ifshownumbers

\def\cjkchar{\setrannum{\cjkcharcnt}{\thestartc}{\thestopc}%

\ifcsname CJK\the\cjkcharcnt\endcsname

\message{Recomputing (collision)}\let\next\cjkchar

\else

\expandafter\let\csname CJK\the\cjkcharcnt\endcsname\empty

\ifshownumbers{\footnotesize(\number\cjkcharcnt) }\fi

\ifnum\XeTeXcharglyph\cjkcharcnt=00

\message{Recomputing (missing character)}\let\next\cjkchar

\else

\char\cjkcharcnt\let\next\relax

\fi

\fi

\next}

\newcommand{\row}{\hbox to\hsize{%

\cjkchar\hfil\cjkchar\hfil\cjkchar\hfil\cjkchar\hfil\cjkchar\hfil

\ifshownumbers\else

\cjkchar\hfil\cjkchar\hfil\cjkchar\hfil\cjkchar\hfil\cjkchar\hfil

\cjkchar\hfil\cjkchar\hfil\cjkchar\hfil\cjkchar\hfil\cjkchar\hfil

\fi

\cjkchar\hfil\cjkchar\hfil\cjkchar\hfil\cjkchar\hfil\cjkchar}}

%----------------------------------------------------------

%Parameters:

%scriptname, fontname, startcharactervalue, stopcharactervalue

\newcommand\dosample[4]{%

\newfontface\ver{#2}

\setcounter{startc}{#3}

\setcounter{stopc}{#4}

\section{#1}

This is a sample of #1 (in \hl{\texttt{#2}} font): \par

{\huge \ver \row\row\row}

}

%----------------------------------------------------------

\begin{document}

\tableofcontents

%\shownumberstrue % uncomment to show (decimal) numbers

\dosample{Yi}{Noto Sans Yi}{\yistartc}{\yistopc}

\dosample{Linear A}{Aegean}{\linastartc}{\linastopc}

\dosample{Vai}{Dukor}{\vaistartc}{\vaistopc}

\dosample{Icons etc}{Code2003}{\iconstartc}{\iconstopc}

\dosample{Tangut Components}{Tangut Yinchuan}{\tangutcomstartc}{\tangutcomstopc}

\dosample{Tangut}{Tangut Yinchuan}{\tangutstartc}{\tangutstopc}

\dosample{Bamum}{Noto Sans Bamum}{\bamumstartc}{\bamumstopc}

\dosample{Anatolian hieroglyphs}{Anatolian}{\anatolianstartc}{\anatolianstopc}

\dosample{Egyptian hierglyphs}{Aegyptus}{\egyptianstartc}{\egyptianstopc}

\dosample{CJK ideographs}{SimSun}{\cjkstartc}{\cjkstopc}

\dosample{Linear B syllabary}{Aegean}{\linbsstartc}{\linbsstopc}

\dosample{Linear B ideograms}{Aegean}{\linbistartc}{\linbistopc}

\dosample{Phaistos Disc}{Aegean}{\phaistosstartc}{\phaistosstopc}

\dosample{Cuneiform}{Akkadian}{\cuneiformstartc}{\cuneiformstopc}

%\row\row\row\row\row\row\row

%\row\row\row\row\row\row\row\row\row\row

%\row\row\row\row\row\row\row\row\row\row

%\row\row\row\row\row\row\row\row\row\row

%\row\row\row\row\row\row\row\row\row\row

%\ifshownumbers

% \row\row\row\row\row\row\row\row\row\row

% \row\row\row\row\row\row\row\row\row\row

% \row\row\row\row\row\row\row\row\row\row

% \row\row\row\row\row\row\row\row\row\row

% \row\row\row\row\row\row\row\row\row\row

%\fi

\end{document}

Egyptian Hieroglyphics

Assembling some text

Imagine the quadrangle entrance to the Department of Antiquities of a university displaying a sign like the following for their Ancient Egyptian course:

EgyptianH2_MIKTEK2

Some random glyphs, except for ‘abcd’ in the middle, and ‘MikTeX’ in the bottom right-hand corner.

Done with the ‘Noto Sans Egyptian Hieroglyphs’ font (free from Google, along with hundreds of other fonts) and, for Latex/Xetex: (a) the \pmglyph command from the hieroglf package, with the package lightly modified to add (for the moment, some) named aliases for the font glyphs (easier to do it this way, using Xetex and Unicode Truetype fonts, instead of special fonts with customised mappings), with the \pmglyph command able to do its own internal stacking and re-sizing of glyphs; (b) the \raisebox command, a built-in TeX command I think, for lifting a box of anything above (or pushing below) its usual position on the baseline, so as to arrange things in an aesthetically pleasing manner; (c) the \resizebox command from the graphicx package, to scale things up (and down, if needed), likewise for aesthetic reasons; (d) the \Shortstack command from the stackengine pckage, for stacking things on top of each other (as in this case; stackengine also has commands for stacking things under each other); and (e) the \color command from the xcolor package.

named_glyphs
Unicode glyphs for Egyptian Hieroglyphs

Code:

\fbox{
\resizebox{!}{7em}{{\color{blue} \eh \HAxli }}
{\eh \huge \Shortstack[c]{{\HCxxiv} {\HAxii} {\HAi}}}
\ 
\raisebox{0.2em}{%
\resizebox{!}{6em}{%
{\eh \Shortstack[c]{{\pmglyph{a}} {\raisebox{1.2em}{\pmglyph{c}}}}}
}%resizebox
}%raisebox
\raisebox{0.2em}{%
\resizebox{!}{6em}{%
{\eh \Shortstack[c]{{\pmglyph{b}} {\raisebox{1.2em}{\pmglyph{d}}}}}
}%
}
\Shortstack[c]{%
\resizebox{!}{4.8em}{{\color{blue} \eh \HAxlii }} {\pmglyph{m-i:k}{\pmglyph{t:e:k}}}
}%Shortstack
}%fbox

with \eh being defined via the fontspec package’s \newfontface command:

\usepackage{fontspec}
\newfontface\eh{Noto Sans Egyptian Hieroglyphs}

Ugaritic

Typesetting Adventures

ugaritic

Typing characters that are not on the standard keyboard can be done if you are willing and able to: (a) create your own custom keyboard layouts; or (b) wait for someone else to (for a fee) upgrade and enhance their word processor program to cater for the new characters; or (c) use Latex (in particular, xelatex) and define your own mnemonic macros and then use them in your essay/report/thesis/paper.

e.g.,

\newcommand\ualpa{𐎀}
\newcommand\ubeta{𐎁}
\newcommand\ugamla{𐎂}

And macros within macros, to your heart’s content.

***

Here’s an example tex document, showing how the image snippet at the start was created. (You’ll need Noto Sans Ugaritic font, or similar, to display the Ugaritic characters – they are in Unicode).

\documentclass[12pt]{article}

\usepackage{fontspec}

\setmainfont{Cambria}

\usepackage{xcolor}

\newcommand\ugafonta{Aegean}

\newcommand\ugafontb{Andagii}

\newcommand\ugafontc{Code2003}

\newcommand\ugafontd{FreeSans}

\newcommand\ugafonte{K1FS}

\newcommand\ugafontf{MPH 2B Damase}

\newcommand\ugafontg{Noto Sans Ugaritic}

\newcommand\ugafonth{Quivira.otf}

\newfontface{\uga}{\ugafonta}

\newfontface{\ugb}{\ugafontb}

\newfontface{\ugc}{\ugafontc}

\newfontface{\ugd}{\ugafontd}

\newfontface{\uge}{\ugafonte}

\newfontface{\ugf}{\ugafontf}

\newfontface{\ugg}{\ugafontg}

\newfontface{\ugh}{\ugafonth}

%=====================================

\newcommand\uwscolour{red}

\newcommand\ualpa{𐎀}

\newcommand\ubeta{𐎁}

\newcommand\ugamla{𐎂}

\newcommand\ukha{𐎃}

\newcommand\udelta{𐎄}

\newcommand\uho{𐎅}

\newcommand\uwo{𐎆}

\newcommand\uzeta{𐎇}

\newcommand\uhota{𐎈}

\newcommand\utet{𐎉}

\newcommand\uyod{𐎊}

\newcommand\ukaf{𐎋}

\newcommand\ushin{𐎌}

\newcommand\ulamda{𐎍}

\newcommand\umem{𐎎}

\newcommand\udhal{𐎏}

\newcommand\unun{𐎐}

\newcommand\uzu{𐎑}

\newcommand\usamka{𐎒}

\newcommand\uain{𐎓}

\newcommand\upu{𐎔}

\newcommand\usade{𐎕}

\newcommand\uqopa{𐎖}

\newcommand\urasha{𐎗}

\newcommand\uthanna{𐎘}

\newcommand\ughain{𐎙}

\newcommand\uto{𐎚}

\newcommand\ui{𐎛}

\newcommand\uu{𐎜}

\newcommand\ussu{𐎝}

%\newcommand\uws{𐎟}

\newcommand\uws{{\color{\uwscolour}{𐎟}}}

\newcommand\utextsize{\huge}

\newcommand\ugaritic[3]{% font size text

{#1 #2 #3}

}

\newcommand\UgariticName{\uu\ugamla\ualpa\urasha\ui\utet\uws\ugamla\ualpa\uws}

\newcommand\utransltit{%

\def\ualpa{'}%

\def\ubeta{b}%

\def\ugamla{g}%

\def\ukha{ḫ}%

\def\udelta{d}%

\def\uho{h}%

\def\uwo{w}%

\def\uzeta{z}%

\def\uhota{ḥ}%

\def\utet{ṭ}%

\def\uyod{y}%

\def\ukaf{k}%

\def\ushin{ś}%

\def\ulamda{l}%

\def\umem{m}%

\def\udhal{ḏ}%

\def\unun{n}%

\def\uzu{ẓ}%

\def\usamka{s}%

\def\uain{`}%

\def\upu{p}%

\def\usade{ṣ}%

\def\uqopa{q}%

\def\urasha{r}%

\def\uthanna{ṯ}%

\def\ughain{ġ}%

\def\uto{t}%

\def\ui{i}%

\def\uu{u}%

\def\ussu{ss}%

%\def\uws{:}%

\def\uws{{\color{\uwscolour}{:}}\space}%

}

\newcommand\ugalphabet{%

\ualpa \ %

\ubeta \ %

\ugamla \ %

\ukha \ %

\udelta \ %

\uho \ %

\uwo \ %

\uzeta \ %

\uhota \ %

\utet \ %

\uyod \ %

\ukaf \ %

\ushin \ %

\ulamda \ %

\umem \ %

\udhal \ %

\unun \ %

\uzu \ %

\usamka \ %

\uain \ %

\upu \ %

\usade \ %

\uqopa \ %

\urasha \ %

\uthanna \ %

\ughain \ %

\uto \ %

\ui \ %

\uu \ %

\ussu \ %

\uws \ %

}

\newcommand\utexttrans[1]{%

\ugaritic{\ugh}{\large}{#1} (%

\textit{\utransltit{#1}}) %

}

%=====================================

\title{Ugaritic Script}

\author{xxx}

\date{11 November 2017: Saturday 11:30pm}

\begin{document}

\maketitle

\tableofcontents

\section{Ugaritic}

Ugaritic script, {\uga 𐎀𐎁𐎂𐎃𐎄𐎅𐎆𐎇𐎈𐎉𐎊𐎋𐎌𐎍𐎎𐎏}, is in Unicode. Fonts covering the Ugaritic Unicode range are: Aegean, Andagii, Code2003, FreeSans, K1FS (same shape and size as FreeSans), MPH 2B Damase, Noto Sans Ugaritic,and Quivira.

\par Using {\ugaritic{\ugb}{}{\UgariticName}} (\textit{\utransltit{\UgariticName}}) as sample text:

\vskip1.5em

\par\noindent \ugaritic{\uga}{\utextsize}{\UgariticName} Aegean,

\par\noindent \ugaritic{\ugb}{\utextsize}{\UgariticName} Andagii,

\par\noindent \ugaritic{\ugc}{\utextsize}{\UgariticName} Code2003,

\par\noindent \ugaritic{\ugd}{\utextsize}{\UgariticName} FreeSans,

%\par\noindent \ugaritic{\uge}{\utextsize}{\UgariticName} K1FS,

\par\noindent \ugaritic{\ugf}{\utextsize}{\UgariticName} MPH 2B Damase,
\par\noindent \ugaritic{\ugg}{\utextsize}{\UgariticName} Noto Sans Ugaritic,
\par\noindent \ugaritic{\ugh}{\utextsize}{\UgariticName} and Quivira.

\section{The Alphabet}
\par \ugaritic{\ugf}{\large}{\ugalphabet}

\par \textit{\utransltit{\ugalphabet}}

\par \utexttrans{\UgariticName}

\par xxx xxx xxx

\end{document}

Note that the bulk code and long lists were copy-pasted from Excel, being created using the CONCATENATE function to build up strings from substrings. No use (mis)typing miles of coding if a click or two is available.

***