我有一个带有几个GitHub链接的表。我想用GitHub符号替换所有这些链接。我使用fontawesome来渲染符号:
\usepackage{fontawesome}
\faGitSquare
我不确定如何仅用这样的符号替换GitHub链接?也许修改href?但不确定如何。
\documentclass{article}
\usepackage{fontawesome5}
\usepackage{hyperref}
\makeatletter
\newcommand{\github}[1]{%
\href{#1}{\faGithubSquare}%
}
\makeatother
\begin{document}
\href{https://github.com/samcarter/tikzducks}{\faGitSquare}
\href{https://github.com/samcarter/tikzducks}{\faGithubSquare}
\github{https://github.com/samcarter/tikzducks}
\end{document}
注意:这不适用于包含#的评论URL