0

In following MWE, the \ref command returns the actual numbering of the subsection it refers to (here "a" -- cf. red box on the picture below). How to make it to return "1.a"?

In more generic terms : how to make \ref return the number of current (sub)section, but also the ones of higher hierarchical levels?

\documentclass{scrartcl}

    \renewcommand{\thesubsection}{\alph{subsection}}

\begin{document}
    As we will see in §\ref{sec:interesting-subsection}, our work is amazing.
    \section{Section title}
            \subsection{Sub-section title} 
            \label{sec:interesting-subsection}
                    Trust me, I'm engineer.
\end{document}

I want the 'a' become '1.a'

(Of course, I don't want nor to change the subsection numbering style (with \renewcommand{\thesubsection}{\thesection.\alph{subsection}}), neither to add a label to the parent section and call §\ref{sec:parent-section}\ref{sec:interesting-subsection}.)

1
  • You should have a look at scrjura.
    – Johannes_B
    Oct 22, 2015 at 15:33

1 Answer 1

3

With a current scrartcl you can format the number independently from \thesubsection:

\documentclass{scrartcl}

\renewcommand{\thesubsection}{\thesection.\alph{subsection}}
\renewcommand\subsectionformat{\alph{subsection}\autodot\enskip}
\begin{document}
    As we will see in §\ref{sec:interesting-subsection}, our work is amazing.
    \section{Section title}
            \subsection{Sub-section title}
            \label{sec:interesting-subsection}
                    Trust me, I'm engineer.
\end{document}

enter image description here

1
  • That is the trick I couldn't find, but was looking for. Thank you!
    – ebosi
    Oct 22, 2015 at 15:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .