![可点击区域](https://linux22.com/image/437496/%E5%8F%AF%E7%82%B9%E5%87%BB%E5%8C%BA%E5%9F%9F.png)
有没有更优雅的方法在 LaTeX 中创建可点击区域?
\documentclass{article}
\usepackage[papersize={123pt,103pt},textheight=1cm]{geometry}
\usepackage{hyperref}
\usepackage{xcolor}
\begin{document}
\setlength{\unitlength}{1cm}
\begin{picture}(2.5,1)
\multiput(0,0)(0,.2){5}{\multiput(0,0)(.2,0){5}{\textcolor{white}{\nameref{sec:alpha}}}}
\put(0,0){\framebox(1,1){}}
\put(.39,.43){\textcolor{black}{$\alpha$}}
\multiput(1.5,0)(0,.186){5}{\multiput(0,0)(.186,0){5}{\textcolor{white}{\nameref{sec:Omega}}}}
\put(1.88,.378){$\Omega$}
\put(1.5,0){\framebox(1,1){}}
\end{picture}
\section*{$\alpha$\label{sec:alpha}}
\pagebreak
\section*{$\Omega$\label{sec:Omega}}
\end{document}
此代码产生 3 个页面,如下所示:
第一页有两个方块:一个在左边,一个在右边。你可以把它们称为按钮。当你点击左边的方块时,你会转到第二页,当你点击右边的方块时,你会转到第三页。
答案1
根据 Marijn 的建议,解决方案可能如下:
\documentclass{article}
\usepackage[papersize={123pt,103pt},textheight=1cm]{geometry}
\usepackage{hyperref}
\usepackage{xcolor}
\begin{document}
\setlength{\unitlength}{1cm}
\begin{picture}(2.5,1)
\put(0,0){\hyperlink{alpha}{\phantom{\rule{1cm}{1cm}}}}
\put(0,0){\framebox(1,1){}}
\put(.39,.43){\textcolor{black}{$\alpha$}}
\put(1.5,0){\hyperlink{Omega}{\framebox(1,1){}}}
\put(1.88,.378){$\Omega$}
\end{picture}
\section*{$\alpha$}
\hypertarget{alpha}{}
\pagebreak
\section*{$\Omega$}
\hypertarget{Omega}{}
\end{document}
'''