
私は参照がたくさんある TEX ドキュメントを扱っています。使用しているのは次のものです:
\usepackage{hyperref}
\usepackage{varioref}
\usepackage{cleveref}
\hypersetup{colorlinks=true,citecolor=title,linkcolor=title,urlcolor = title}
それでも、すべての参考文献には番号の前に図や表などが付けられていますが、私の教授は参考文献があまりにも似すぎていると考えています。参考文献をカスタマイズする方法はありますか?\cref{fig:1}
図1.1のようにすることはできますか?青、表の参照は赤アルゴリズムは大胆なアルゴリズム1.1式は [ ] となり、最終的な参照では異なる**textsize/style**
?が使用されます。
参照するものに応じて参照をカスタマイズするにはどうすればよいですか?
答え1
\creflabelformat
および定義を使用することをお勧めします\crefname
:
\documentclass{article}
\usepackage[hidelinks]{hyperref}
\usepackage{cleveref}
\usepackage{xcolor}
\usepackage{lipsum}
\usepackage{graphicx}
\creflabelformat{figure}{\color{red} \textbf{#1#2#3}}
\crefname{figure}{\color{blue} figure}{figures}
\creflabelformat{equation}{[#1#2#3]}
\crefname{equation}{equation}{equations}
\crefrangeformat{equation}{eqs. #3[#1]#4--#5[#2]#6}
\begin{document}
\lipsum[1]
\begin{figure}[h]
\centering\includegraphics[width=0.5\textwidth]{example-image-a}
\caption{Example image A\label{fig:fig1}}
\end{figure}
\lipsum[2]
\cref{fig:fig1}
\begin{equation}\label{eq:eq1}
a^2 + b^2 = c^2
\end{equation}
\cref{eq:eq1}
\end{document}
ここでは図と方程式だけを変更しました。表とアルゴリズムは皆さんの練習問題として残しておきます:)。これについてはcleverref ユーザーガイドのセクション 4。