In this question and its answer, the reference is shown like 1b. I want the reference to be shown like 1-b. How can I do this?
Asked
Active
Viewed 41 times
1 Answers
3
Reference: 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}
Zxcvasdf
- 1,735

\crefname{subfigure}{}{}in the preamble (see section 8.1.2 ofcleverefmanual). However, personally I feel removing it would only make your work tougher, unless you have a very strong reason to do so. – Zxcvasdf Jun 09 '22 at 09:59