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:


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:


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 ( 14 12){\rotatebox[origin=c]{-90}{\huge\ver\char”300E}};
\node at ( 14 11){\huge\ver 他};
\node at ( 14 10){\huge\ver 们};
\node at ( 14 9){\huge\ver 是};

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


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.


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


%\errorcontextlines 10000 %for getting fuller error messages










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

% Yi block



% Linear A block



% Linear B syllabary block



% Linear B ideograms block



% Vai block



% Miscsellaneous symbols, emoticons, etc blocks



% Tangut Components block



% Tangut block



% Bamum block



% Anatolian hieroglyphs block



% Egyptian hieroglyphs block



% CJK part block



% Phaistos Disc block



%Cuneiform block







% url=

% 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



\ifcsname CJK\the\cjkcharcnt\endcsname

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


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

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


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






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









%scriptname, fontname, startcharactervalue, stopcharactervalue






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

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





%\shownumberstrue % uncomment to show (decimal) numbers

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

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


\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}








% \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



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:


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.

Unicode glyphs for Egyptian Hieroglyphs


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

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

\newfontface\eh{Noto Sans Egyptian Hieroglyphs}


Typesetting Adventures


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.



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).










\newcommand\ugafontf{MPH 2B Damase}

\newcommand\ugafontg{Noto Sans Ugaritic}













































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

{#1 #2 #3}






































\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 \ %



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

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



\title{Ugaritic Script}


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





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:


\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


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.



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




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




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




There are a whole bunch of linguistics-related packages.

For syntax trees and glosses:


Glosses in other scripts:


Playful stuff:




And so on.


(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):



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



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.