Latex GitHub链接显示符号

问题描述 投票:1回答:1

我有一个带有几个GitHub链接的表。我想用GitHub符号替换所有这些链接。我使用fontawesome来渲染符号:

\usepackage{fontawesome}
\faGitSquare

我不确定如何仅用这样的符号替换GitHub链接?也许修改href?但不确定如何。

latex
1个回答
1
投票
\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

© www.soinside.com 2019 - 2024. All rights reserved.