在此问题及其答案,引用显示为 1b。我希望引用显示为 1-b。我该怎么做?
答案1
参考:https://tex.stackexchange.com/a/423080/133968
\documentclass[10pt]{article}
\usepackage{caption,subcaption}
\usepackage{cleveref}
\usepackage{graphicx}
\makeatletter
\renewcommand{\p@subfigure}{\thefigure-} % <-- modify the figure number "prefix"
\makeatother
\begin{document}
\begin{figure}
\centering
\begin{subfigure}{0.5\linewidth}
\centering
A subfigure
\caption{Subfigure}
\label{subfig}
\end{subfigure}
\caption{Figure}
\label{fig}
\end{figure}
\cref{subfig}.
\end{document}