Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

My language (Slovenian) uses a different alphabet that starts with a, b, c, č, d. I have the correct babel settings but \alph{} numbering still gives me a, b, c, d.

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[slovene]{babel}

\renewcommand\thesection{\alph{section}}

\begin{document}

\section{}
\section{}
\section{}
\section{}

\end{document}
share|improve this question
add comment

2 Answers 2

up vote 4 down vote accepted

The following example redefines \alph/\Alph according to the Slovene alphabet. The original definition of the internals \@alph and \@Alph can be found in the LaTeX kernel (source documentation).

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[slovene]{babel}

\renewcommand\thesection{\alph{section}}

\makeatletter
\renewcommand*{\@alph}[1]{%
  \ifcase#1\or a\or b\or c\or\v 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 r\or s\or\v s\or
    t\or u\or v\or w\or x\or
    y\or z\or
    \v z\else\@ctrerr\fi
}
\renewcommand*{\@Alph}[1]{%
  \ifcase#1\or A\or B\or C\or\v 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 R\or S\or\v S\or
    T\or U\or V\or W\or X\or
    Y\or Z\or\v Z\else\@ctrerr\fi
}
\makeatother

\begin{document}

\section{\Alph{section}}
\section{\Alph{section}}
\section{\Alph{section}}
\section{\Alph{section}}

\end{document}

Result

Remarks:

  • Instead of č the definition uses the form \v c, which is called the LaTeX internal character representation (LICR). It has the advantage that it works independent on the input encoding.

  • I would recommend \usepackage[T1]{fontenc} with \usepackage{lmodern} instead of the old OT1 font encoding with Computer Modern fonts, where the accented letters are constructed of the base character with the accent. T1 encoding contains slots for the accented characters and the Latin Modern fonts extends the Computer Modern fonts with many accented characters as single glyphs.

share|improve this answer
add comment

Here is the definition of \alph (and the accompanying \@alph) in the LaTeX kernel:

\def\alph#1{\expandafter\@alph\csname c@#1\endcsname}
\def\@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}

\@alph conditions on the value of the passed counter using an \ifcase...\fi statement. You can create your own counter representation this way. I've done so using \slalph and \@slalph below (with the alphabet taken from Wikipedia's Slovene alphabet):

enter image description here

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[slovene]{babel}

\makeatletter
\def\slalph#1{\expandafter\@slalph\csname c@#1\endcsname}
\def\@slalph#1{%
  \ifcase#1\or a\or b\or c\or č\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 r\or s\or š\or t\or u\or v\or 
    z\or ž\else\@ctrerr\fi}
\makeatother

\renewcommand\thesection{\slalph{section}}

\begin{document}

\section{}
\section{}
\section{}
\section{}

\end{document}

You could do the same with the uppercase alphabet and define (say) \slAlph (and \@slAlph) accordingly.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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