I use cleveref
to create customized references to theorems, e.g.
I have to reference to Theorems A1, A3 and A4.
When using tex4ebook
, the respective links to the theorems work technically fine, but the appearance is not the most beautiful one: In the example above, "A1" would be the first link, ", A3" the second link, and "and A4" would be the third link. Is there a way that only "A1", "A3" and "A4" get linked (and not the comma and the word "and", respectively)?
Here is an MWE:
\documentclass[12pt]{book}
\usepackage{enumitem}
\usepackage{cleveref}
\usepackage{amsthm}
\newtheoremstyle{Theorem}{3pt}{3pt}{\itshape}{}{\bfseries}{}{.5em}{\thmname{#1}\thmnumber{#2}}
\theoremstyle{Theorem}
\newtheorem{TheoremA}{Theorem A}
\setlist[1]{leftmargin=*, labelsep=10pt, itemsep=1pt, label=\theTheoremA.\arabic*, align=parleft}
\crefname{A}{A}{A}
\crefformat{A}{A#2#1#3}
\crefrangeformat{A}{A#3#1#4 to~A#5#2#6}
\crefmultiformat{A}{A#2#1#3}{ and~A#2#1#3}{, A#2#1#3}{ and~A#2#1#3}
\begin{document}
\begin{TheoremA} \label[A]{A1}
This is Theorem A1.
\end{TheoremA}
\begin{TheoremA} \label[A]{A2}
This is Theorem A2.
\end{TheoremA}
\begin{TheoremA} \label[A]{A3}
This is Theorem A3.
\end{TheoremA}
\begin{TheoremA} \label[A]{A4}
This is Theorem A4.
\end{TheoremA}
This is a reference to the Theorems \cref{A1,A2}.
This is a reference to the Theorems \cref{A1,A3,A4}.
\end{document}
And a simple config file:
\Preamble{xhtml}
\begin{document}
\EndPreamble
tex4ebook
conversion, please.