Latex Tables
by terrylica
LaTeX tables with tabularray package. TRIGGERS - LaTeX table, tabularray, fixed-width columns, table alignment.
Skill Details
Repository Files
6 files in this skill directory
name: latex-tables description: LaTeX tables with tabularray package. TRIGGERS - LaTeX table, tabularray, fixed-width columns, table alignment. allowed-tools: Read, Edit, Bash
LaTeX Tables with tabularray
When to Use This Skill
Use this skill when:
- Creating tables with fixed-width columns
- Formatting complex table layouts
- Need precise column alignment
- Migrating from tabular/tabularx/longtable/booktabs
- Troubleshooting table overflow issues
Quick Reference
Why tabularray?
Modern LaTeX3 package (replaces old solutions):
- Fixed-width columns with proper alignment
- Clean, consistent syntax
- Replaces:
tabular,tabularx,longtable,booktabs - Better performance than legacy packages
- Part of TeX Live 2025
Installation
# Check if installed
kpsewhich tabularray.sty
# If not found, install:
sudo tlmgr install tabularray
Basic Usage
\documentclass{article}
\usepackage{tabularray} % Modern table package
\begin{document}
% Simple table
\begin{tblr}{colspec={ccc}, hlines, vlines}
Header 1 & Header 2 & Header 3 \\
Data 1 & Data 2 & Data 3 \\
\end{tblr}
\end{document}
Quick Reference Card
% Minimal table
\begin{tblr}{colspec={ccc}}
A & B & C \\
\end{tblr}
% With all lines
\begin{tblr}{colspec={ccc}, hlines, vlines}
A & B & C \\
\end{tblr}
% Fixed widths
\begin{tblr}{colspec={Q[2cm] Q[3cm] Q[2cm]}, hlines}
A & B & C \\
\end{tblr}
% Bold header
\begin{tblr}{
colspec={ccc},
row{1}={font=\bfseries}
}
Header & Header & Header \\
Data & Data & Data \\
\end{tblr}
Best Practices
- Use Q[width] for fixed columns instead of p{width}
- Specify widths explicitly when text might overflow
- Use X for flexible columns that should expand
- Style headers with row{1} instead of manual formatting
- Use colspec for column properties, not inline commands
- Check package version:
kpsewhich tabularray.sty(should be recent)
Reference Documentation
For detailed information, see:
- Table Patterns - 5 common table patterns with examples
- Column Specification - Alignment options and width control
- Lines and Borders - All lines, selective lines, thick lines
- Troubleshooting - Table too wide, text not wrapping, alignment issues
- Migration - Migrating from tabular and tabularx
Official Docs: Run texdoc tabularray for complete package documentation
See Also:
- Use
latex/setupskill for installing tabularray package - Use
latex/buildskill for compilation workflows
Troubleshooting
| Issue | Cause | Solution |
|---|---|---|
| Package not found | tabularray not installed | sudo tlmgr install tabularray |
| Table too wide | Fixed widths exceed page | Use smaller Q[width] values or X for flexible |
| Text not wrapping | Column spec missing width | Use Q[width] instead of c/l/r for wrapping |
| Alignment issues | Mixed column types | Ensure all columns have consistent spec |
| Compile error on colspec | Invalid syntax | Check for missing commas or typos in column spec |
| hlines not appearing | Missing from spec | Add hlines to the spec: {colspec={...}, hlines} |
| Row style not applied | Wrong row index | Remember row{1} is first row (1-indexed) |
| Package version too old | TeX Live outdated | sudo tlmgr update --self --all |
Related Skills
Attack Tree Construction
Build comprehensive attack trees to visualize threat paths. Use when mapping attack scenarios, identifying defense gaps, or communicating security risks to stakeholders.
Grafana Dashboards
Create and manage production Grafana dashboards for real-time visualization of system and application metrics. Use when building monitoring dashboards, visualizing metrics, or creating operational observability interfaces.
Matplotlib
Foundational plotting library. Create line plots, scatter, bar, histograms, heatmaps, 3D, subplots, export PNG/PDF/SVG, for scientific visualization and publication figures.
Scientific Visualization
Create publication figures with matplotlib/seaborn/plotly. Multi-panel layouts, error bars, significance markers, colorblind-safe, export PDF/EPS/TIFF, for journal-ready scientific plots.
Seaborn
Statistical visualization. Scatter, box, violin, heatmaps, pair plots, regression, correlation matrices, KDE, faceted plots, for exploratory analysis and publication figures.
Shap
Model interpretability and explainability using SHAP (SHapley Additive exPlanations). Use this skill when explaining machine learning model predictions, computing feature importance, generating SHAP plots (waterfall, beeswarm, bar, scatter, force, heatmap), debugging models, analyzing model bias or fairness, comparing models, or implementing explainable AI. Works with tree-based models (XGBoost, LightGBM, Random Forest), deep learning (TensorFlow, PyTorch), linear models, and any black-box model
Pydeseq2
Differential gene expression analysis (Python DESeq2). Identify DE genes from bulk RNA-seq counts, Wald tests, FDR correction, volcano/MA plots, for RNA-seq analysis.
Query Writing
For writing and executing SQL queries - from simple single-table queries to complex multi-table JOINs and aggregations
Pydeseq2
Differential gene expression analysis (Python DESeq2). Identify DE genes from bulk RNA-seq counts, Wald tests, FDR correction, volcano/MA plots, for RNA-seq analysis.
Scientific Visualization
Meta-skill for publication-ready figures. Use when creating journal submission figures requiring multi-panel layouts, significance annotations, error bars, colorblind-safe palettes, and specific journal formatting (Nature, Science, Cell). Orchestrates matplotlib/seaborn/plotly with publication styles. For quick exploration use seaborn or plotly directly.
