「test,abc.csv」というファイルがあり、csvsimple を使用してこのテーブルを表示したいと考えています。
\documentclass{article}
\usepackage{csvsimple}
\begin{document}
\begin{table}
\csvautotabular[respect all]{test,abc.csv}
\end{table}
\end{document}
pgfkeysエラーが発生します
Package pgfkeys Error: I do not know the key '/csv/abc.csv' and I am going to ignore it. Perhaps you misspelled it. \csvautotabular[respect all]{test,abc.csv}
ファイル名を変更せずにこの問題を解決する方法はありますか?
ファイル名に角括弧、中括弧、引用符を試してみましたが、どれも機能しません。
(ファイル名を直接変更しない理由は、別のデータベースのテーブルのリストを自動的に表示するスクリプトを作成しており、多くのファイル名にコンマが含まれているためです。これらのテーブルはすでに他のものにリンクされているため、ファイル名を変更するとエラーが発生する可能性があります)
答え1
回避策としては、ファイル名をマクロに保存し、そのマクロを引数として使用することです。
\documentclass{article}
\usepackage{csvsimple}
\begin{document}
\begin{table}
\def\myfile{test,abc.csv}
\csvautotabular[respect all]{\myfile}
\end{table}
\end{document}