LaTeX and octal line numbering

Started by Tìmuiäyä'itan, July 17, 2010, 06:22:31 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Tìmuiäyä'itan

Kxaltì ma smukan!

I thought about what if someone (me?) wants to use LaTeX to typeset a short story or a poem in Na'vi. Wouldn't it be sensible, in case line numbering is  demanded, to have it using octal digits? Does anyone here have any slight clue, how to get this working?

I have used LaTeX for years in order to write papers for uni and such, but this is a bit too far off for me, but maybe one of you can give me a hint?

Kiyevame!
srungìri ftära tsyokxìl ngeyä
ke ivomum futa pesuru
lu srung skiena tsyokxta ngeyä
ulte Jesus a nerìn ayfo pamlltxe
san sutehu lu keltsun
slä Yawähu frakem tsunslu sìk.

Muzer

If it's only short, why not just add them in manually?

I doubt LaTeX has that option. Of course, you could hack the source code, if you have the knowledge.
[21:42:56] <@Muzer> Apple products used to be good, if expensive
[21:42:59] <@Muzer> now they are just expensive

wm.annis

Quote from: Muzer on July 17, 2010, 06:56:05 PMI doubt LaTeX has that option. Of course, you could hack the source code, if you have the knowledge.

LaTeX has been around a while.  If there's something you want LaTeX to do, google to see if someone else has already done it.  There are packages to print numbers in different bases.

On the other hand, for shorter texts I tend to number things by hand, as in the Prolegomena to the Study of Na'vi Poetics.  The formatting was annoying enough with out dealing with automagical line numbering.

Tìmuiäyä'itan

#3
That's the problem, I couldn't find anything on the net, all I have is a package to change decimal to other base numbers, and the verse package. But I have no clue how to use the one to hack the other...

Talking of the Prolegomena: How did you get the two, poem and translation, to be printed one next to the other? Did you use a table?


Update:

Ha, it was much easier then I just thought (though I don't really understand how it works):

In the verse package there is the command \thepoemline, which can be redefined by \renewcommand*

There one can se the binhex package to change decimal numbers to octal ones. All you need is:

\renewcommand*{\thepoemline}{\oct{\arabic{poemline}}°}

The "°" is to mark it as octal numbers, you can leave it out as well. Think I'm gonna give an example of how to get a whole poem (this works on MacOS 10.5 and TeXLive2009), just in case anyone wants to do this, too:

\documentclass[a4paper,12pt]{scrartcl}


\usepackage{fontspec}% provides font selecting commands
%\usepackage{xunicode}% provides unicode character macros
%\usepackage{xltxtra} % provides some fixes/extras
\defaultfontfeatures{Mapping=tex-text}
\setromanfont[Mapping=tex-text]{Papyrus} %some stylish font


\usepackage{verse} %for poetry


\begin{document}

\newcommand{\attrib}[1]{% this is to add the author, here "traditional
\nopagebreak{\raggedleft\footnotesize #1\par}}



\pagestyle{empty} %no page numbering


\begin{verse}

\poemtitle{The Hunt Song} %the title of the poem
\input binhex %to enable the binhex package which changed decimal to octal numers (and other bases are also available)
\poemlines{4} %we want line numering each 4 lines
\renewcommand*{\thepoemline}{\oct{\arabic{poemline}}°} %this is the magic that turns decimal to octal, the \oct{} command does the conversion

\verselinenumbersright %we want the numers on the right side

Terìran ayoe ayngane\\
Zera'u\\
Rerol ayoe ayngane\\
Ha ftxey\\
Awpot set ftxeyayngal a l(u) ayngakip\\
Awpot a Na'viru yomtìyìng.\\!

Oeyä swizaw nìngay tivakuk\\
Oeyä tukrul txe'lanit tivakuk\\
Oeri tìngayìl txe'lanit tivakuk\\
Oeyä txe'lan livu ngay\\!

Lu nga win sì txur\\
Lu nga txantslusam\\
Livu win sì txur oe zene\\
Ha n(ì)'aw\\
Pxan livu txo nì'aw oe ngari\\
Tsakrr nga Na'viru yomtìyìng.\\!


\end{verse}
\attrib{traditional} %there's no author, it's a traditional text ;)


\end{document}
srungìri ftära tsyokxìl ngeyä
ke ivomum futa pesuru
lu srung skiena tsyokxta ngeyä
ulte Jesus a nerìn ayfo pamlltxe
san sutehu lu keltsun
slä Yawähu frakem tsunslu sìk.

wm.annis

Quote from: Tìmuiäyä'itan on July 18, 2010, 04:46:50 AMTalking of the Prolegomena: How did you get the two, poem and translation, to be printed one next to the other? Did you use a table?

Nope, I used the parallel package:

Code (latex) Select

\begin{Parallel}[v]{}{}
\ParallelLText{
\noindent Tompayä kato, tsawkeyä kato, $^{5+5}$ \lineno{1} \\
Trrä sì txonä $^5$ \\
S(ì) ayzìsìtä kato, $^6$ \\
Sì 'ekong te'lanä $^6$ \lineno{4} \\
Te'lanä le-Na'vi $^6$ \\
Oeru teya si, $^6$\\
Oeru teya si. $^6$ \\

\noindent Katot täftxu oel $^6$ \lineno{8} \\
Nìean nìrim $^5$ \\
Ayzìsìtä kato, $^6$ \\
'Ìheyu sìreyä $^6$ \\
'Ìheyu sìreyä $^6$ \lineno{12} \\
Sìreyä le-Na'vi, $^6$ \\
Oeru teya si, $^6$ \\
Oeru teya si. $^6$}

\ParallelRText{
\noindent Rhythm of rain, rhythm of sun, \\
Of day and of night, \\
And rhythm of the years, \\
And beat of the hearts, \\
Hearts of the People \\
Fills me, \\
Fills me. \\

\noindent I weave the rhythm \\
In blue, in yellow, \\
Rhythm of the years, \\
Spiral of the lives, \\
Spiral of the lives, \\
Lives of the people, \\
Fills me, \\
Fills me.}
\end{Parallel}

Tìmuiäyä'itan

Irayo. Didn't know about this package yet.
srungìri ftära tsyokxìl ngeyä
ke ivomum futa pesuru
lu srung skiena tsyokxta ngeyä
ulte Jesus a nerìn ayfo pamlltxe
san sutehu lu keltsun
slä Yawähu frakem tsunslu sìk.