The document below, with a chapter/section scheme in a memoir class document, uses a custom \secref command. This command allows reference to a section in the shorter form "section s" that would normally appear in the full form "section c.s". Here c is the chapter number and s is the section number.
The \secref command is as kindly provided by Christian Hupfer, from his "trickier" code answer in Reference with just part of section number after decimal point.
This document used to compile without error.
But now instead it gives this error:
./secref-try.tex:40: Use of \@stripdot doesn't match its definition.
<argument> 1
.2
l.40 In section \secref{sec:more}
%% ERROR WITH \@stripdot here
Here is the document:
\documentclass[12pt]{memoir}
%% NOTATION INDEX
\usepackage[nocfg]{nomencl}
%%%%%%%% BEGIN CROSS-REFERENCING COMMANDS %%%%%%%%
\RequirePackage{hyperref}
\hypersetup{colorlinks,linkcolor=red}
% Added to allow ref to section n, not section m.n
% ``trickier' 'code by Christian Hupfer, from
% https://tex.stackexchange.com/questions/383606/reference-with-just-part-of-section-number-after-decimal-point
\makeatletter
\let\@xp\expandafter
% Stripping the dot from the 1.2 -like reference
\def\@@stripdot#1.#2\@nil{#2}
% Stripping the memoir stuff from the reference,
% i.e. \M@TitleReference {1.2}{FOO} and handing #1 (1.2) over to the \@@stripdot macro
\def\@stripdot\M@TitleReference #1#2\@nil{\@@stripdot#1\@nil}
% Macro, second level of expansion
\newcommand{\stripdot}[1]{%
\@xp\@stripdot#1\@nil
}
\newcommand{\secref}[1]{%
% Expand the argument first
\IfRefUndefinedExpandable{#1}{%
% Do nothing if #1 is not defined
}{%
\hyperlink{\getrefbykeydefault{#1}{anchor}{}}{\@xp\stripdot\@xp{\getrefnumber{#1}}}%
}%
}
\makeatother
\usepackage[nameinlink,capitalize]{cleveref}
%%%%%%%% END CROSS-REFERENCING COMMANDS %%%%%%%%
\begin{document}
In section \secref{sec:more} %% ERROR WITH \@stripdot here
of \cref{chap:one} \dots .
And in \cref{sec:one} \dots .
\chapter{One}\label{chap:one}
\section{About one}\label{sec:one}
\section{More about one}\label{sec:more}
\chapter{Two}
In section \ref{sec:more}
\end{document}
The error does not occur if \usepackage[nocfg]{nomencl} is commented out! Instead, it produces the expected output, including the following first page:
Question:
What's wrong?
Did something change recently in nomencl (which does have changes in version 5.1 dated 2019/02/08), cleveref, hyperref, or even memoir?


\xassoccnt, which did not get along with\calc(and I do need\calc). Or was that package conflict fixed? – murray Feb 17 '19 at 22:12xassoccnt, thecalcpackage -- and any packages, such asmathtools, which depend oncalc-- should be loaded before xasoccnt. Since the code insertion is slated to occur between loading thehyperrefandcleveref` packages, this shouldn't be a meaningful restriction on your coding ambitions. – Mico Feb 17 '19 at 22:17\@stripdotis not by me and we 'talked' about this already, thatxassoccntshould be loaded after any package that makes use ofcalc– Feb 18 '19 at 15:03