Vertical

Using TeX for vertical typesetting

Advertisements

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.

***

 

LaTeX, treasure cave

Have discovered the joys of typesetting. Specifically, the XeLaTeX incarnation of LaTeX: it can understand Unicode, and can access any fonts installed on the system. Plus its code is expandable, and user-written packages extend its functionality and abilities.

Latex et al. (the tex part is from Greek τέχνη, techne, “art, skill, craft”, meaning both skill of mind and skill of hand) has maths typesetting at its core.

 

maths

Using suitable packages if required (and there are thousands), you can do papers on more maths:

venn

isotopes:

isotope

(and even, on the Arts Faculty side, smugcat)

 

Mazes:

maze

Chess games (of course), step-by-step

chess

.

 

There are a whole bunch of linguistics-related packages.

For syntax trees and glosses:

linguistics

Glosses in other scripts:

glossing

Playful stuff:

censor

and

roundbox

And so on.

ancient

(As an aside, learning cuneiform must have taken ages at school, not to mention if you were Babylonian and had to go to Ancient Sumerian classes!)

There’s a package called manuscript, designed for emulating the old-style typewriter-written theses, which must have been written for LaTeX in the old days, I think. Now, with XeLaTeX, with its access to any and all installed fonts, one line of code (selecting a typewriter font) is all that is needed for emulating an old-style thesis.

Well, almost. Using the underline command, produces a nice, typeset line, which contrasts with the font (Urania Czech, in this case):

 

underline2

But with the old typewriters, you could backspace, and use the _ key (or the X key for typing errors, before liquid paper was invented):

 

overstrike

And of course, some typewriter ribbons were red-and-black (never found out what the red ink was used for).

 

Lots of fun.

 

 

 

===

Addendum 27-Aug-2017: corrected spelling to: XeLaTeX.