\documentclass[5p]{elsarticle}
\begin{filecontents*}{mybibfile.bib}
@article{allik_hughes_1,
title = "Finite element method for piezoelectric vibration",
journal = "Int J Numer Meth Engng",
year="1970",
volume="2",
number="1--2",
pages = "151--157",
doi = "10.1002/nme.1620020202",
author = "{Allik H, Hughes TJR}"
}
@article{allik_hughes_2,
title = {Vibrational response of sonar transducer using piezoelectric finite elements},
journal = "J Acoust Soc Am ;",
year="1970",
volume="2",
number="1--2",
pages = "151--157",
doi = "10.1121/1.1903513",
author = "{Allik H, Kenneth MW, John TH}"
}
@article{Fish,
title = "Modeling and simulation of piezocomposites",
journal = "Comput Meth Appl Mech and Engng",
year="1970",
volume="2",
number="1--2",
pages = "151--157",
pages = ":3211 -- 3232",
doi = "10.1016/S0045-7825(03)00343-8",
author = "{Fish J, Chen W }"
}
\end{filecontents*}
\usepackage{hyperref}
\hypersetup{colorlinks = true, allcolors = cyan}
\usepackage[nameinlink,noabbrev]{cleveref}
\Crefformat{figure}{#2Fig.~#1#3}
\Crefmultiformat{figure}{Figs.~#2#1#3}{ and~#2#1#3}{, #2#1#3}{ and~#2#1#3}
\usepackage{lineno}
\modulolinenumbers[5]
\journal{Journal of \LaTeX\ Templates}
\usepackage{subfig}
\usepackage{float}
\usepackage{graphicx}
\usepackage{color}
\usepackage{pgf,tikz}
\usepackage{multirow}
\usepackage{amsmath,amsfonts,amsthm,bm}
\bibliographystyle{elsarticle-num}
\begin{document}
\hypersetup{allcolors = cyan}
\captionsetup[figure]{labelfont={bf},labelformat={default},labelsep=period,name={Fig.}}%used to ref Figure 1: to Fig.1.
\section{Introduction}
In \Cref{figure}, in ref \cite{allik_hughes_1,allik_hughes_2,Fish}, in \Cref{table} and in equation Eq. \ref{equation}
\begin{align}
M=\frac{a{b}c}{2}. dE, \label{equation}
\end{align}
\begin{figure}[H]
\centering
\includegraphics[height=1.0 in, width=2.0 in]{bimorph.png}
\caption{Static deflection of the bimorph actuator: Accuracy analysis} \label{figure}.
\end{figure}
\begin{table}[H]
%\begin{table}[H]
\caption{Accuracy : Static } \label{table}
\centering
\begin{tabular}{c c c c c c}
\hline
\multirow{3}{*}{none} &\multicolumn{2}{c}{none}\\ \cline{2-3}&a($\mu$m)&relative error[\%]\\ \cline{2-3} \cline{4-5}
&b&b\\
\hline
1000&1000&100& \\
\hline
\end{tabular}
%\end{table}
\end{table}
\section*{References}
\bibliography{mybibfile}
\end{document}
当我引用这些参考文献时,我希望得到彩色括号。
为什么 doi 没有出现在参考文献列表中。我该如何包含 doi 的 URL?
另外,可以使用吗\Cref{equation}
?我试过\Cref{equation}
,但对我不起作用。因此,我正在使用Eq.\ref{equation}
。
答案1
关于您的问题\cref{equation}
:
cleverref
应该最后加载,特别是必须在之后加载amsmath
。
\documentclass[5p]{elsarticle}
\usepackage{amsmath,amsfonts,amsthm,bm}
\usepackage{hyperref}
\hypersetup{colorlinks = true, allcolors = cyan}
\usepackage[nameinlink,noabbrev]{cleveref}
\begin{document}
\hypersetup{allcolors = cyan}
\Cref{nameequation}
\begin{align}
M=\frac{a{b}c}{2}. dE, \label{nameequation}
\end{align}
\end{document}
为引文括号着色
基于Biblatex 方括号颜色你可以这样做:
\documentclass[5p]{elsarticle}
\usepackage{filecontents}
\begin{filecontents*}{mybibfile.bib}
@article{allik_hughes_1,
title = "Finite element method for piezoelectric vibration",
journal = "Int J Numer Meth Engng",
year="1970",
volume="2",
number="1--2",
pages = "151--157",
doi = "10.1002/nme.1620020202",
author = "{Allik, H and Hughes, T J R}"
}
@article{allik_hughes_2,
title = {Vibrational response of sonar transducer using piezoelectric finite elements},
journal = "J Acoust Soc Am",
year="1970",
volume="2",
number="1--2",
pages = "151--157",
doi = "10.1121/1.1903513",
author = "{Allik, H and Kenneth, M W and John, T H}"
}
@article{Fish,
title = "Modeling and simulation of piezocomposites",
journal = "Comput Meth Appl Mech and Engng",
year="1970",
volume="2",
number="1--2",
pages = "151--157",
pages = "3211 -- 3232",
doi = "10.1016/S0045-7825(03)00343-8",
author = "{Fish, J and Chen, W}"
}
\end{filecontents*}
\usepackage{hyperref}
\hypersetup{colorlinks = true, allcolors = cyan}
\usepackage[nameinlink,noabbrev]{cleveref}
\usepackage{color}
\bibliographystyle{elsarticle-num}
\bibpunct{\color{cyan}[}{\color{cyan}]}{,}{n}{}{;}
\begin{document}
\hypersetup{allcolors = cyan}
\cite{allik_hughes_1,allik_hughes_2,Fish},
\bibliography{mybibfile}
\end{document}