乳胶可点击整个图像
latex clickable The whole image
在 HTML 中,我们可以有这样一个可点击的图像:
<!DOCTYPE html>
<html>
<head>
<title>HTML Image as link</title>
</head>
<body>
<a href="https://www.google.com"><img src="https://www.w3schools.com/html/pic_trulli.jpg"></a>
</body>
</html>
你可以点击任何地方并重定向到网站。同样在 LaTeX 中,我们可以有一个像这样的可点击图像
\documentclass[10pt,a4paper]{article}
\usepackage{hyperref,graphicx}
\begin{document}
\href{http://www.blog.com}{\includegraphics{blog}}
\end{document}
但问题是整张图点不开,左边有个小点,很小。
我希望图片可以像字体和文字一样可以点击整个图片
\href{http://www.blog.com}{Hello}
\Huge\href{http://www.blog.com}{\faGithub}
我的编辑器是:TeXstudio 4.1.2 (git n/a)
使用 Qt 版本 5.12.8,使用 Qt 5.12.8 R
编译
latex 编译器是:XeLaTeX
谢谢
xelatex 不支持非文本超链接。最简单的解决方案是使用另一个引擎。例如 lualatex 几乎可以做 xelatex 可以做的所有事情。
(对于无法更改引擎的奇怪情况,有使非文本元素可点击的解决方法,例如参见 [=10=])
在 HTML 中,我们可以有这样一个可点击的图像:
<!DOCTYPE html>
<html>
<head>
<title>HTML Image as link</title>
</head>
<body>
<a href="https://www.google.com"><img src="https://www.w3schools.com/html/pic_trulli.jpg"></a>
</body>
</html>
你可以点击任何地方并重定向到网站。同样在 LaTeX 中,我们可以有一个像这样的可点击图像
\documentclass[10pt,a4paper]{article}
\usepackage{hyperref,graphicx}
\begin{document}
\href{http://www.blog.com}{\includegraphics{blog}}
\end{document}
但问题是整张图点不开,左边有个小点,很小。
我希望图片可以像字体和文字一样可以点击整个图片
\href{http://www.blog.com}{Hello}
\Huge\href{http://www.blog.com}{\faGithub}
我的编辑器是:TeXstudio 4.1.2 (git n/a) 使用 Qt 版本 5.12.8,使用 Qt 5.12.8 R
编译latex 编译器是:XeLaTeX
谢谢
xelatex 不支持非文本超链接。最简单的解决方案是使用另一个引擎。例如 lualatex 几乎可以做 xelatex 可以做的所有事情。
(对于无法更改引擎的奇怪情况,有使非文本元素可点击的解决方法,例如参见 [=10=])