Quantcast
Channel: Active questions tagged mathtools - TeX - LaTeX Stack Exchange
Viewing all articles
Browse latest Browse all 122

zref-clever: \zcref gives wrong reference type inside modified align environment

$
0
0

I have a tex file

\documentclass{amsart}\usepackage{amsthm,amssymb,zref-clever,mathtools}\zcsetup{cap=true,comp=false,sort=false}\zcRefTypeSetup{equation}{    Name-sg=,    name-sg=,}\mathtoolsset{showonlyrefs}\usepackage[hypertexnames=false]{hyperref}\hypersetup{  colorlinks=true,  linkcolor=blue,}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\newcommand{\addtheorem}[1]{%  \AddToHook{env/#1/begin}{%    \zcsetup{countertype={theorem=#1}}%  }%  \zcRefTypeSetup{#1}{Name-sg={\MakeUppercase #1}}%  \newtheorem{#1}[theorem]{\MakeUppercase #1}%}\numberwithin{equation}{section}\newtheorem{theorem}{Theorem}[section]\addtheorem{corollary}\addtheorem{proposition}%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%\makeatletter\ExplSyntaxOn\int_new:N \g__example_position_int\prop_const_from_keyval:Nn \c__example_envs_prop {    myalign = align,    myaligned = aligned,    myalign* = align*,    myaligned* = aligned*,}% Define the custom align command\cs_new_protected:Nn \__example_align: {    \int_gincr:N \g__example_position_int    \c_alignment_token    \bool_if:nT {        \prop_if_in_p:NV \c__example_envs_prop \@currenvir &&        \int_compare_p:n { \g__example_position_int > 1 }    } {        \quad    }}% Make & active globally or in a group\char_set_catcode_active:N \&\char_set_active_eq:NN \& \__example_align:\prop_map_inline:Nn \c__example_envs_prop {    \NewEnvironmentCopy { #1 } { #2 }    \hook_gput_code:nnn { env / #1 / begin } { . } {        \int_gzero:N \g__example_position_int    }}\hook_gput_code:nnn { cmd / measure@ / after } { . } {    \int_gzero:N \g__example_position_int}\ExplSyntaxOff\makeatother\begin{document}\section{Intro}\begin{proposition}We have\begin{myalign} & a \\& = \begin{myaligned}[t] \label{eq1}& b \\& + c.\end{myaligned}\end{myalign}and\begin{myalign} & a \\& = \begin{myaligned}[t] \label{eq2}& b \\& + c.\end{myaligned}\end{myalign}\end{proposition}We have \zcref{eq1} and \eqref{eq2}.\end{document}

enter image description here

Above, myalign and myaligned are modified versions of align, aligned and taken from this answer.

Could you explain why \zcref{eq1} wrongly gives Proposition 1.1. On the other hand, \eqref{eq2} works fine.


Viewing all articles
Browse latest Browse all 122

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>