# Using non-numeric ((sub)sub)sections changes the way of how \ref is displayed

I have some issue with LaTeX and I haven’t found a solution yet. So hopefully some of you can help me.

I'm writing a big article with four levels of sectioning (so I'm using paragraph for the lowest level). Furthermore in my faculty it is common to have the sections in Alph, subsections in Roman, subsubsections in arabic and paragraphs in alph. This didn't seem to be a problem by redefining \thesection, etc.

But now I'm struggling with a problem, when referencing. In the subsequent example I have a reference and if I don't redefine \the..., then the last sentence in the PDF will be You find some information about it in 1.1.1.. So I expected to have the same structure after redefining: You find some information about it in A.I.1., but instead I get You find some information about it in 1. How can I achieve my desired output?

I faced the same problem with fancy, but I could fix it by redefining \sectionmark, \subsectionmark and \subsubsectionmark. Maybe there is some similar solution for my \ref problem? I'm using the hyperref package, if this is of any importance.

\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[ngermanb]{babel}

\renewcommand \thesection {\Alph{section}}
\renewcommand \thesubsection {\Roman{subsection}}
\renewcommand \thesubsubsection {\arabic{subsubsection}}

\begin{document}
\section{My first Section}\label{sec:s1}
\subsection{My first Subsection}\label{sec:s1-ss1}
\subsubsection{My first Subsubsection}\label{sec:s1-ss1-sss1}
This is some text, pretty similar to \emph{lorem ipsum}.

\section{My first Section}\label{sec:s2}
Have you ever heard about \emph{lorem ipsum}? You find some information about it
in \ref{sec:s1-ss1-sss1}.
\end{document}

-

The following redefinition will work. It is also the way the standard \the... defined.

\renewcommand \thesection {\Alph{section}}
\renewcommand \thesubsection {\thesection.\Roman{subsection}}
\renewcommand \thesubsubsection {\thesubsection.\arabic{subsubsection}}

-
Thanks! This is so easy, that I feel kind of dumb now :-) –  Alex Jun 19 '11 at 10:15

In addition to Yan Zhous answer: According to your question (though not shown in your example), you also want to use alph-numbered \paragraph sections. To do so, redefining \theparagraph is not sufficient -- you also have to set the secnumdepth counter to the appropriate value.

\documentclass{scrartcl}
\usepackage[utf8]{inputenc}
\usepackage[ngermanb]{babel}

\setcounter{secnumdepth}{4}

\renewcommand*{\thesection}{\Alph{section}}
\renewcommand*{\thesubsection}{\thesection.\Roman{subsection}}
\renewcommand*{\thesubsubsection}{\thesubsection.\arabic{subsubsection}}
\renewcommand*{\theparagraph}{\thesubsubsection.\alph{paragraph}}

\begin{document}
\section{My first Section}\label{sec:s1}
\subsection{My first Subsection}\label{sec:s1-ss1}
\subsubsection{My first Subsubsection}\label{sec:s1-ss1-sss1}
\paragraph{My first paragraph section}\label{sec:s1-ss1-sss1-p1}
This is some text, pretty similar to \emph{lorem ipsum}.

\section{My second Section}\label{sec:s2}
Have you ever heard about \emph{lorem ipsum}? You find some information about it
in \ref{sec:s1-ss1-sss1-p1}.
\end{document}

-
You are right. I was confused since I seldom use \newcommand etc (still used to \def...). I deleted my comment -:) –  Yan Zhou Jun 20 '11 at 17:15