table-generation

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Table Generation

表格生成

Convert experimental results into publication-ready LaTeX tables.
将实验结果转换为可直接用于出版的LaTeX表格。

Input

输入

  • $0
    — Table type:
    comparison
    ,
    ablation
    ,
    descriptive
    ,
    custom
  • $1
    — Data source: JSON file, CSV file, or inline data
  • $0
    — 表格类型:
    comparison
    (对比表)、
    ablation
    (消融实验表)、
    descriptive
    (描述性表格)、
    custom
    (自定义表格)
  • $1
    — 数据源:JSON文件、CSV文件或内嵌数据

Scripts

脚本

Generate LaTeX table from JSON/CSV

从JSON/CSV生成LaTeX表格

bash
python ~/.claude/skills/table-generation/scripts/results_to_table.py \
  --input results.json --type comparison \
  --bold-best max --caption "Performance comparison" \
  --label tab:main_results
Supports:
comparison
,
ablation
,
descriptive
,
multi-dataset
table types. Additional flags:
--type multi-dataset
for methods x datasets x metrics layout,
--significance
for p-value stars,
--underline-second
for second-best results.
bash
python ~/.claude/skills/table-generation/scripts/results_to_table.py \
  --input results.json --type comparison \
  --bold-best max --caption "Performance comparison" \
  --label tab:main_results
支持:
comparison
ablation
descriptive
multi-dataset
(多数据集)表格类型。 额外参数:
--type multi-dataset
用于方法×数据集×指标的布局,
--significance
用于添加p值星号,
--underline-second
用于标记次优结果。

References

参考资料

  • LaTeX table templates and examples:
    ~/.claude/skills/table-generation/references/table-templates.md
  • LaTeX表格模板及示例:
    ~/.claude/skills/table-generation/references/table-templates.md

Table Types

表格类型

comparison
— Main results table

comparison
— 主结果表

  • Rows = methods (baselines + ours), Columns = metrics/datasets
  • Bold the best result in each column
  • Include mean +/- std when available
  • Use
    \multirow
    for method categories (Supervised, Self-supervised, etc.)
  • 行 = 方法(基线方法+我们的方法),列 = 指标/数据集
  • 为每列中的最优结果添加加粗格式
  • 若有可用数据则包含均值±标准差
  • 对方法类别(监督学习、自监督学习等)使用
    \multirow

ablation
— Ablation study table

ablation
— 消融实验表

  • Rows = variants (full model, minus component A, minus component B, ...)
  • Columns = metrics
  • Bold the full model result
  • Use checkmarks for component presence
  • 行 = 变体(完整模型、移除组件A、移除组件B……)
  • 列 = 指标
  • 为完整模型的结果添加加粗格式
  • 用勾选标记组件是否存在

descriptive
— Dataset/statistics table

descriptive
— 数据集/统计表格

  • Dataset characteristics, hyperparameters, or summary statistics
  • Clean formatting with proper units
  • 包含数据集特征、超参数或汇总统计信息
  • 采用清晰格式并标注正确单位

custom
— Free-form table

custom
— 自由格式表格

  • User specifies layout and content
  • 由用户指定布局和内容

Required Packages

所需宏包

latex
\usepackage{booktabs}    % \toprule, \midrule, \bottomrule
\usepackage{multirow}    % \multirow
\usepackage{multicol}    % multi-column layouts
\usepackage{threeparttable}  % table notes
latex
\usepackage{booktabs}    % \toprule, \midrule, \bottomrule
\usepackage{multirow}    % \multirow
\usepackage{multicol}    % 多列布局
\usepackage{threeparttable}  % 表格注释

Output Format

输出格式

Always generate tables with:
  1. booktabs
    rules (
    \toprule
    ,
    \midrule
    ,
    \bottomrule
    )
  2. \caption{}
    and
    \label{tab:...}
  3. Bold best results using
    \textbf{}
  4. Table notes via
    threeparttable
    when needed
  5. Proper alignment (
    l
    for text,
    c
    or
    r
    for numbers)
生成的表格需始终满足以下要求:
  1. 使用
    booktabs
    规则(
    \toprule
    \midrule
    \bottomrule
  2. 包含
    \caption{}
    \label{tab:...}
  3. 使用
    \textbf{}
    为最优结果添加加粗格式
  4. 必要时通过
    threeparttable
    添加表格注释
  5. 采用合适的对齐方式(文本用
    l
    ,数字用
    c
    r

Rules

规则

  • Only include numbers from actual experimental logs — never hallucinate results
  • All numbers must match the data source exactly
  • Use
    $\pm$
    for standard deviations
  • Use
    \underline{}
    for second-best results when appropriate
  • Keep tables compact — avoid unnecessary columns
  • Use
    table*
    for wide tables spanning two columns
  • Add glossary/notes for abbreviated column headers
  • 仅包含来自实际实验日志的数值——绝不能虚构结果
  • 所有数值必须与数据源完全一致
  • 使用
    $\pm$
    表示标准差
  • 必要时用
    \underline{}
    标记次优结果
  • 保持表格紧凑——避免不必要的列
  • 跨双栏的宽表格使用
    table*
  • 为缩写的列标题添加术语表/注释

Related Skills

相关技能

  • Upstream: data-analysis, experiment-code
  • Downstream: paper-writing-section, paper-compilation
  • See also: figure-generation
  • 上游:数据分析实验代码
  • 下游:论文写作章节论文编译
  • 另见:图表生成