a method for "defining a theorem environment which has a custom numbering scheme" was proposed here. I'm looking for a way to automate the creation of such custom theorems, such as follows:
\documentclass{article}
%% original by esdd, posted on http://tex.stackexchange.com/questions/53978/custom-theorem-numbering/53980
%% modified to be used through a wrapper command.
%% All modifications were marked with `mod:', all additions with `new:', except for pure comment lines (like this one), or an occasional empty line.
%\usepackage{amsthm} %% uncomment to see the difference
\makeatletter% new: the wrapper command created below will use commands with `@' in their names
\newcommand*\metathmcustnum[2]{% new: the wrapper command
\newtheorem{inner@cust@#1}{#2}% mod: using the wrapper's arguments to build the `inner' theorem. Since the name for this inner theorem is now generated, I added "@cust@" to this name to prevent possible clashes with other packages---who knows, if \innersomething isn't already defined somewhere?
\newenvironment{#1}[1]% mod: the wrapper's first argument will be the name of the new environment
{\@namedef{theinner@cust@#1}{##1}% mod: the counter name for the inner theorem needs to be constructed, first. That's where \@namedef comes in handy...
% because \newenvironment is now called from within a command, the new environment's first (here only) argument is referred to as `##1' (`#1' refers to the warpper's first argument)
\@nameuse{inner@cust@#1}% mod: the name of the inner theorem needs to be constructed, before it can be called...an alternate may be `\csname inner@cust@#1\endcsname'
}
{\@nameuse{endinner@cust@#1}}% mod: same for the closing of the inner theorem
}
\makeatother% new: the closing command to \makeatletter
\metathmcustnum{customthm}{Theorem}% new: the original definition redone with the wrapper
\metathmcustnum{foo}{Foo}% new: additional definition
\begin{document}
\begin{customthm}{8}\label{eight}
Every theorem must be numbered by hand.
\end{customthm}
Here is a reference to theorem~\ref{eight}.
\begin{foo}{12}whatever\end{foo}% new: test additional environment
\end{document}