如何在latex正文中引用参考文献去掉方括号,并且以上标形式显示。
参考ChatGPT的回答得到以下代码。
\documentclass{article}
% 去掉引用中的方括号并以上标形式显示
\makeatletter
\renewcommand\@cite[1]{\textsuperscript{#1}}
\makeatother
\begin{document}
This is an example of a citation\cite{AA1}, and there is another citation\cite{BB1}.
\begin{thebibliography}{1}
\bibitem{AA1}
G. M. Amdahl, G. A. Blaauw, and F. P. Brooks, ``Architecture of the IBM System/360,'' {\it IBM J. Res. Dev}., vol. 8, no. 2, pp. 87--101, 1964. (Journal)
\bibitem{BB1}
IBM Corporation, IBM Knowledge Center - IBM Secure Service Container (Secure Service Container). [Online]. Available: {https://www.ibm.com/support/\break knowledgecenter/en/HW11R/com.ibm.hwmca.kc\_se.doc/\break introductiontotheconsole/wn2131zaci.html} (URL)
\end{thebibliography}
\end{document}
在这个代码中:
\makeatletter 和 \makeatother 命令用来允许对 LaTeX 内部命令进行重新定义。
\renewcommand@cite[1]{\textsuperscript{#1}} 重新定义了 \cite 命令的格式,使其生成的引用以上标形式显示,并去掉了默认的方括号。
这样,正文中的引用将会以上标的形式显示,并且没有方括号,最终效果图: