Document Classes ⇒ how to use or create custom counters via another alphabet
how to use or create custom counters via another alphabet
MTURAN
http://www.turkishlanguage.co.uk/alphabet.htm link of turkish alphabet
Turkish character codes, I used in cls file
% Turkce Karakter Kodlari
\catcode240=13 \def ğ{\u g}
\catcode231=13 \def ç{\c c}
\catcode246=13 \def ö{\"o}
\catcode254=13 \def ş{\c s}
\catcode252=13 \def ü{\"u}
\catcode253=13 \def ı{{\i}}
\catcode221=13 \def İ{\.I}
\catcode199=13 \def Ç{\c C}
\catcode208=13 \def Ğ{\u G}
\catcode214=13 \def Ö{\"O}
\catcode222=13 \def Ş{\c S}
\catcode220=13 \def Ü{\"U}
NEW: TikZ book now 40% off at Amazon.com for a short time.
And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p
how to use or create custom counters via another alphabet
Code: Select all
\newcommand\alph[1]{%
\expandafter \@alph \csname c@#1\endcsname
}
\newcommand\@alph[1]{%
\ifcase #1%
\or a\or b\or c\or d\or e\or f\or g\or h\or i\or j\or
k\or l\or m \or n\or o\or p\or q\or r\or s\or t\or u\or
v\or w\or x\or y\or z\else \@ctrerr
\fi
}
Regards
Nicola Talbot
Creating a Minimal Example: http://www.dickimaw-books.com/latex/minexample/
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
how to use or create custom counters via another alphabet
Code: Select all
\documentclass[11pt,a4paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{blindtext}
\makeatletter
\newcommand*{\turkish}[1]{%
\expandafter\@turkish\csname c@#1\endcsname
}
\newcommand*{\@turkish}[1]{%
\ifcase#1\or a\or b\or c\or \c{c}\or d\or e\or f\or g\or \u{g}\or h\or i%
\or \i\or j\or k\or l\or m\or n\or o\or \"{o}\or p\or r\or s\or \c{s}%
\or t\or u\or \"{u}\or v\or y\or z%
\else\@ctrerr\fi
}
\newcommand*{\Turkish}[1]{%
\expandafter\@Turkish\csname c@#1\endcsname
}
\newcommand*{\@Turkish}[1]{%
\ifcase#1\or A\or B\or C\or \c{C}\or D\or E\or F\or G\or \u{G}\or H\or I%
\or \.{I}\or J\or K\or L\or M\or N\or O\or \"{O}\or P\or R\or S\or \c{S}%
\or T\or U\or \"{U}\or V\or Y\or Z%
\else\@ctrerr\fi%
}
\makeatother
\begin{document}
\pagenumbering{Turkish}
\Blinddocument
\end{document}
[1] View topic: greek letters as page numerals?
Best regards and welcome to the board
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
how to use or create custom counters via another alphabet

Best Regards
MTURAN
Code: Select all
\renewcommand\alph[1]{%
\expandafter \@alph \csname c@#1\endcsname
}
\renewcommand\@alph[1]{%
\ifcase #1%
\or a\or b\or c\or \c{c}\or d\or e\or f\or g\or \u{g}\or h\or i%
\or \i\or j\or k\or l\or m\or n\or o\or \"{o}\or p\or r\or s\or \c{s}%
\or t\or u\or \"{u}\or v\or y\or z%
\else \@ctrerr
\fi
}
\renewcommand\Alph[1]{%
\expandafter \@Alph \csname c@#1\endcsname
}
\renewcommand\@Alph[1]{%
\ifcase #1%
\or A\or B\or C\or \c{C}\or D\or E\or F\or G\or \u{G}\or H\or I%
\or \.{I}\or J\or K\or L\or M\or N\or O\or \"{O}\or P\or R\or S\or \c{S}%
\or T\or U\or \"{U}\or V\or Y\or Z%
\else \@ctrerr
\fi
}
Code: Select all
\AddEnumerateCounter{\arabic}{\@arabic}{0}
\AddEnumerateCounter{\alph}{\@alph}{m}
\AddEnumerateCounter{\Alph}{\@Alph}{M}
\AddEnumerateCounter{\roman}{\@roman}{viii}
\AddEnumerateCounter{\Roman}{\@Roman}{VIII}
\AddEnumerateCounter{\Turkish}{\@Alphtr}{R}
\AddEnumerateCounter{\turkish}{\@alphtr}{r}
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
how to use or create custom counters via another alphabet
It is not necessary (and anything but recommendable) to modify the package file itself. Just put those lines into the preamble of your document and it will work.mturan wrote: […] I tried the first code and it worked for me now, but the second code might be replaced in enumitem.sty in between line 225 through 229 for the second solution as a future reference for the people who want use both eng and tr alphabet selectively. […]
Code: Select all
\AddEnumerateCounter{\Turkish}{\@Turkish}{R}
\AddEnumerateCounter{\turkish}{\@turkish}{r}
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10