0

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?

Mina
  • 103

1 Answers1

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}

enter image description here

Zxcvasdf
  • 1,735