First off, I realise there are a lot of questions on this topic, and I've had an extensive look at finding an answer to my question, but haven't found one; if there is a duplicate on this site, my sincere apologies. Now for the actual question...
I would like to create an enumerated list in a way that I can choose the label and then have a hyperref reference to this label. The accepted answer on this SE question here almost does exactly what I want. The answer gives the following MWE.
\documentclass{article}
\usepackage{enumitem}
\begin{document}
\begin{enumerate}[label=\textbf{S.\arabic*}]
\item a
\item \label{l} b
\item c. goto \ref{l}
\end{enumerate}
\end{document}
Now, I would like to do exactly this, but I don't want to have to write label=... each time. Previously, I had used something like
\newcommand{\alphanumbering}{\renewcommand{\labelenumi}{(\textit{\alph{enumi}})}}
and then just prior to typing begin{enumerate} I would type \alphanumbering. When I use \ref, however, I just get the counter (which is enumi?), and I can't even use something like \alph{\ref{1}}.
I'd then like to extend this further, to write something like \alphaarabicnumbering before enumerate, where
\newcommand{\alphaarabicnumbering}{
\renewcommand{\labelenumi} {(\textit{\alph{enumi}})}
\renewcommand{\labelenumii}{\arabic{enumii}.} }
This then gives a list with first level (a), (b), ... and second level 1., 2., .... For example,
(a) foo
1. bar
2. foobar
I'd like to reference "foobar" as (a.2), and other lines similarly. (Note that a naive reference would be (a)2, which is not what I want.)
For reference, see also this SE question.
\setlistto change the default behaviour of the list, and\newlistto define your own list types. See the documentation. – Ulrike Fischer Jun 26 '17 at 14:28(a.2)referencing, but has now deleted their comment; I've added clarification anyway. – Sam OT Jun 26 '17 at 14:39label=...material), and (b) posting a separate, new query in which you bring up the remaining material from the original query. – Mico Jun 26 '17 at 14:40