TeXでテーブルを作成し、列ヘッダーを持つPDFにコンパイルして、それらをクリックすると(数値の)テーブルコンテンツがその列で並べ替えられるようにすることは可能ですか?
PDFにJavascriptを含めることができることを理解しています。これにより、このようなことが可能になる可能性があります。
誰かがそのようなことをしましたか?
私のコメントの後、それはOCGレイヤーで可能であるはずですが、ocg-p
パッケージocgtabular
がまさにあなたが望むことを実行する環境を提供することを知りました。
ocg-p
ドキュメントからの例:
\documentclass{article}
\usepackage[ocgtabular]{ocg-p}
\usepackage{datatool} % will be needed for this example
\usepackage{booktabs} % will be needed for this example
\DTLnewdb{sdata}
\DTLnewrow{sdata}
\DTLnewdbentry{sdata}{Firstname}{John}
\DTLnewdbentry{sdata}{Lastname}{Doe}
\DTLnewdbentry{sdata}{Grade}{5}
\DTLnewrow{sdata}
\DTLnewdbentry{sdata}{Firstname}{Paul}
\DTLnewdbentry{sdata}{Lastname}{Bauer}
\DTLnewdbentry{sdata}{Grade}{1}
\DTLnewrow{sdata}
\DTLnewdbentry{sdata}{Firstname}{Peggy}
\DTLnewdbentry{sdata}{Lastname}{Sue}
\DTLnewdbentry{sdata}{Grade}{3}
\DTLnewrow{sdata}
\DTLnewdbentry{sdata}{Firstname}{Ever}
\DTLnewdbentry{sdata}{Lastname}{Last}
\DTLnewdbentry{sdata}{Grade}{4}
\DTLnewrow{sdata}
\DTLnewdbentry{sdata}{Firstname}{Werner}
\DTLnewdbentry{sdata}{Lastname}{Moshammer}
\DTLnewdbentry{sdata}{Grade}{1}
\begin{document}
This table can be sorted by clicking on the headers:
\begin{ocgtabular}{llc}{sdata}{}
\toprule%
\bfseries \setocgtabularheader{Firstname}{First name}
& \bfseries \setocgtabularheader{Lastname}{Last name}
& \bfseries \setocgtabularheader{Grade}{Grade}
\DTLforeach{sdata}{\first=Firstname, \last=Lastname,\grade=Grade}{%
\DTLiffirstrow{\\ \midrule}{\\}
\first & \last & \grade
}
\\ \bottomrule%
\end{ocgtabular}
\end{document}
この記事はインターネットから収集されたものであり、転載の際にはソースを示してください。
侵害の場合は、連絡してください[email protected]
コメントを追加