Thanks to duodecimal page number I don't have to ask how to get duodecimal page numbers and I managed to get duodecimal chapter numbers with that method too. But how do I change the sections, subsections, … to be also shown in duodecimal values?

  { \duodec_convert:n { #1 } }

\tl_new:N \l_duodec_string_tl
\cs_new_protected:Npn \duodec_convert:n #1
   \tl_set:Nx \l_duodec_string_tl { \int_to_base:nn { #1 } { 12 } }
   \tl_replace_all:Nnn \l_duodec_string_tl { a } { ↊ } %I use XeLaTex, so these sings are no problem at all ;)
   \tl_replace_all:Nnn \l_duodec_string_tl { b } { ↋ }
   \tl_use:N \l_duodec_string_tl


This leads to sections numbered without the chapter number (1,2,3 instead of 5.1,5.2,5.3...). How do I get the standard numbering just with duodecimal values? I tried it with


to maintain parenting but with no results.

To be clear, I want all automatic numbering (pages, chapters etc, pictures, tables…) to be in duodecimal values in the end, without changing the format. Thank you!

  • 3
    \renewcommand{\thesection}{\thechapter.\basetwelve{\arabic{section}}} – David Carlisle Dec 23 '18 at 9:51
  • Wow! That was too easy, thank you! I kind of tried the same but because the "." turned blue like it combined with \thechapter, I inserted a space (\thechapter .) which seemed to corrupt everything and a huge load of errors appeared. Now that I deleted the space it works! Thanks a lot!!! – DonMeles Dec 23 '18 at 10:56
  • \thechapter. and \thechapter . are identical input to TeX (the space is not tokenised so the definitions would be identical whether or not there is a space, not just act the same way – David Carlisle Dec 23 '18 at 11:09
  • Per haps for future readers - For the sub- and subsubsection it is NOT \renewcommand{\thesubsection}{\thechapter.\thesection.\basetwelve{\arabic{subsection}}} But just \renewcommand{\thesubsection}{\thesection.\basetwelve{\arabic{subsection}}} otherwise the number of the chapter will appear twice because it is in the section AND subsectioncode wich results in a very long and redundant numbering xD – DonMeles Dec 23 '18 at 11:10
  • 1
    feel free to post a full working answer:-) – David Carlisle Dec 23 '18 at 11:11

Thank you, David, for your Help! The solution is way easier than I thought.

To get the solution I was looking for you need the following code:

\usepackage{graphicx} % I need this to rotate my numbers...
\usepackage{xparse} % this is the magic package...
\ExplSyntaxOn % for the missing numbers after 9 the package uses "a" and "b",
              % but I want to use "↊" and "↋" as defined by the Dozenal
              % Society of Great Britain. The following lines do that for me:

  { \duodec_convert:n { #1 } }

\tl_new:N \l_duodec_string_tl
\cs_new_protected:Npn \duodec_convert:n #1
   \tl_set:Nx \l_duodec_string_tl { \int_to_base:nn { #1 } { 12 } }
   \tl_replace_all:Nnn \l_duodec_string_tl { a } { \rotatebox[origin=c]{180}{2} }
    % I rotate the numbers, because standard fonts don't contain ↊ and ↋.
   \tl_replace_all:Nnn \l_duodec_string_tl { b } { \rotatebox[origin=c]{180}{3} }
   \tl_use:N \l_duodec_string_tl
\ExplSyntaxOff % I got this code from the related question linked above.

 % No problems so far...
 % This is how you get numbering formatted as chapter.section:
 % Dont put \thechapter here, it is already contained in \thesection!!!
 % As I told you, I wanted to change the figcaptions too. 
 % But I don't need the chapter's number here.
 % And this is my first dozenal enumeration with a dot behind the number.

 %let's see, if it works:
\part{Quick demonstration}
\chapter{Here we go!}
Just scroll down...
Whoops, nearly there...
On this and on the following page you see the dozenal page numbers!
See? It works!
This is the dozenal number  \rotatebox[origin=c]{180}{2}, equal to $ 10_{(10)} $.
This is the second dozenal number: \rotatebox[origin=c]{180}{3}, it is just a turned 3 and equal to $ 11_{(10)} $.
\section{What are these symbols?!}
I use fonts like Times New Roman, they have symbols like \rotatebox[origin=c]{180}{2} and \rotatebox[origin=c]{180}{3} integrated as Unicode glyphs U+218A and U+218B. They are just rotated numbers too, basicly. These numbers are defined by the Dozenal Society of Great Britain and I like them. If you complie with XeLaTeX you can just copy and paste these signs: ↊ and ↋ (in this font they will probably be invisible).

\section{Why so many chapters?}
I need more than 12 pages and chapters for the numbers  \rotatebox[origin=c]{180}{2} and \rotatebox[origin=c]{180}{3} to appear.

\item Just
\item a
\item very
\item short
\item demonstration
\item of
\item a
\item dozenal
\item enumeration
\item for
\item you
\item to
\item admire.
\section{Just a random section}
\subsection{with a subsection}
\subsubsection{and a subsubsection}
These all work just finde with dozenal numbers aswell but I think the code is already long enough. And as you see, subsubsections usually don't have numbers at all.

Now my entire document uses the duodecimal system and I feel like it's already Christmas. Thanks!!!

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.