Build LaTeX booktabs tables from user-provided CSV data. Ask for CSV per table need, generate .tex files, auto-insert \input{} in sections, report status.
Read the active paper's sections/ to determine which tables are needed (dataset table, baseline comparison, ablation study, results summary, etc.), prompt the user for CSV data for each table, convert CSV to LaTeX booktabs format, write sections/tables/{name}.tex, auto-insert \input{tables/{name}} at the correct location in the parent section, and report a status summary.
Must be inside an active paper project under manuscripts/[paper-name]/. Abort if sections/ or main.tex is not found.
Read sections/methodology.tex (or the appropriate section file) to identify table references. Look for patterns:
\placeholder{tab:name}
\ref{tab:name}
Table~\ref{tab:name}
Common table names:
tab:dataset — dataset / experimental setuptab:baseline — baseline comparisontab:ablation — ablation studytab:results — results summarytab:comparison — method comparisonBuild a list of table names needed.
If no table references are found, report "No tables referenced in sections — nothing to build."
For each needed table, prompt the user:
请提供 {table-name} 的 CSV 数据,格式:
header1,header2,header3
row1col1,row1col2,row1col3
row2col1,row2col2,row2col3
...
(或直接粘贴 CSV 内容)
Accept CSV as multi-line input until the user sends an empty line or a confirmation signal (e.g., "done", "ok", "生成").
placeholder, write a \placeholder{tab:name} comment in the section, do not create a fileFor each table with CSV data:
l for text columns, c for numeric/short, r for right-aligned\begin{table}[htbp]
\centering
\caption{<Caption>}
\begin{tabular}{<cols>}
\toprule
<Header1> & <Header2> & <Header3> \\
\midrule
<Row1Col1> & <Row1Col2> & <Row1Col3> \\
<Row2Col1> & <Row2Col2> & <Row2Col3> \\
\bottomrule
\end{tabular}
\label{tab:<name>}
\end{table}
sections/tables/ directory if it does not existsections/tables/{name}.texAfter generating the table file, find the appropriate section file and insert:
% --- tab:name ---
\input{tables/{name}}
near the location of \placeholder{tab:name} or the first \ref{tab:name} reference in that section. Replace \placeholder{tab:name} if found.
# Table Builder Report
| Table | Status | File |
|-------|--------|------|
| tab:dataset | ✅ Generated | sections/tables/dataset.tex |
| tab:baseline | ✅ Generated | sections/tables/baseline.tex |
| tab:ablation | ⚠️ Placeholder | (no CSV provided) |
| tab:results | ✅ Generated | sections/tables/results.tex |
Generated: 3 | Placeholder: 1 | Skipped: 0
\begin{table}[htbp]
\centering
\caption{Caption text}
\begin{tabular}{lccc}
\toprule
Header1 & Header2 & Header3 \\
\midrule
Row1 & val1 & val2 \\
Row2 & val3 & val4 \\
\bottomrule
\end{tabular}
\label{tab:name}
\end{table}
&\toprule, \midrule, \bottomrule from booktabs package| in tabular preamble)\label{tab:name}sections/tables/ → abort with error, do not update sectionMethod,PSNR (dB),SSIM,Time (s)
SRCNN,30.2,0.882,1.2
ESPCN,31.5,0.903,0.4
EDSR,32.1,0.912,8.6
Accepts:
# (comment, skipped)