0

I want equations 1 and equations 2 looks like (equation 1 and 2)

\documentclass{article}
\usepackage[colorlinks,allcolors=blue]{hyperref}
\usepackage{cleveref}
\newcommand\pcref[1]{(\cref{#1})}
\newcommand\crefpairconjunction{ and}
\newcommand{\creflastconjunction}{, and }
\newcommand{\crefrangeconjunction}{to}
\crefformat{table}{#2table~#1#3}
\crefformat{figure}{#2figure~#1#3}
\crefname{figure}{figure}{figures}
\Crefname{figure}{figure}{figures}
\crefname{table}{table}{tables}
\Crefname{table}{table}{tables}
\crefname{equation}{equation}{equations}
\Crefname{equation}{equation}{equations}
\begin{document}
\begin{table}[h!]  \caption{tabbar} \label{tab:bar}\end{table}
\begin{table}[h!]  \caption{tabbar} \label{tab:bar1}\end{table}
\begin{table}[h!]  \caption{tabbar} \label{tab:bar2}\end{table}
\begin{table}[h!]  \caption{tabbar} \label{tab:bar3}\end{table}
\begin{figure}[h!] \caption{figfoo1}\label{fig:foo}\end{figure}
\begin{figure}[h!] \caption{figfoo2}\label{fig:foo1}\end{figure}
\begin{figure}[h!] \caption{figfoo2}\label{fig:foo2}\end{figure}
\begin{figure}[h!] \caption{figfoo2}\label{fig:foo3}\end{figure}
\begin{equation} \label{eq5} 1+4=5 \end{equation}\\
\begin{equation} \label{eq6} 1+4=5 \end{equation}\\
\pcref{tab:bar,tab:bar2,tab:bar3,fig:foo3},\\ \pcref{fig:foo,fig:foo1,fig:foo2,fig:foo3,tab:bar},\\ \pcref{fig:foo,tab:bar}\\
\pcref{eq5,eq6}\\
\end{document}

enter image description here

1 Answer 1

1

You have to specify \creflabelformat{equation}. I took the opportunity to improve the spacing of conjunctions.

\documentclass{article}
\usepackage[colorlinks,allcolors=blue]{hyperref}
\usepackage{cleveref}
\newcommand\pcref[1]{(\cref{#1})}
\newcommand\crefpairconjunction{ and }
\newcommand{\creflastconjunction}{, and }
\newcommand{\crefrangeconjunction}{ to }
\crefformat{table}{#2table~#1#3}
\crefformat{figure}{#2figure~#1#3}
\crefname{figure}{figure}{figures}
\Crefname{figure}{figure}{figures}
\crefname{table}{table}{tables}
\Crefname{table}{table}{tables}
\crefname{equation}{equation}{equations}
\Crefname{equation}{equation}{equations}
\creflabelformat{equation}{#2#1#3}
\begin{document}
\begin{table}[h!] \caption{tabbar} \label{tab:bar}\end{table}
\begin{table}[h!] \caption{tabbar} \label{tab:bar1}\end{table}
\begin{table}[h!] \caption{tabbar} \label{tab:bar2}\end{table}
\begin{table}[h!] \caption{tabbar} \label{tab:bar3}\end{table}
\begin{figure}[h!] \caption{figfoo1}\label{fig:foo}\end{figure}
\begin{figure}[h!] \caption{figfoo2}\label{fig:foo1}\end{figure}
\begin{figure}[h!] \caption{figfoo2}\label{fig:foo2}\end{figure}
\begin{figure}[h!] \caption{figfoo2}\label{fig:foo3}\end{figure}
\begin{equation} \label{eq5} 1+4=5 \end{equation}\\
\begin{equation} \label{eq6} 1+4=5 \end{equation}\\
\pcref{tab:bar,tab:bar2,tab:bar3,fig:foo3},\\ \pcref{fig:foo,fig:foo1,fig:foo2,fig:foo3,tab:bar},\\ \pcref{fig:foo,tab:bar}\\
\pcref{eq5,eq6}\\
\end{document} 

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .