Skip to content

Commit 6e5214a

Browse files
JihaoXinclaude
andcommitted
Add smart figure placement rules for multi-column LaTeX templates
- Visualizer prompt: guide for figure vs figure* selection based on content complexity (concept diagrams → figure*, simple charts → figure) - Writer prompt: instruction to match \includegraphics width to environment - Plot style guide: figure placement table with figsize mappings - Rules are content-aware, not hardcoded — agent decides based on figure type, information density, and number of panels Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent d319089 commit 6e5214a

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

ark/execution.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -880,6 +880,7 @@ def _run_writing_phase(self, action_plan: dict, prior_context: str = ""):
880880
1. Ensure LaTeX syntax is correct after each modification
881881
2. Keep the paper's core contributions unchanged
882882
3. Reference the high-quality paper style in paper_example/ directory
883+
4. For multi-column templates: use `\\begin{{figure*}}` (full width) for complex figures, multi-panel plots, and architecture diagrams. Use `\\begin{{figure}}` (single column) only for simple single charts. Match `\\includegraphics[width=]` to the environment (\\textwidth vs \\columnwidth).
883884
884885
## Reference Files
885886
- auto_research/state/latest_review.md - Review report

ark/templates/agents/visualizer.prompt

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,31 @@ Flag these issues IMMEDIATELY if found:
8282
- Re-run the script to generate new figures
8383
5. **Verify**: Ensure the modified files have correct syntax
8484

85+
## Figure Placement in LaTeX (for multi-column templates)
86+
87+
For templates with 2+ columns, each figure must use the correct LaTeX environment:
88+
- `\begin{figure}` (single-column) vs `\begin{figure*}` (span all columns)
89+
90+
Determine placement by the figure's content and information density:
91+
92+
**Use `figure*` (full width) when:**
93+
- The figure is a system overview, architecture, or pipeline diagram
94+
- The figure has many components that need horizontal space to be readable
95+
- The figure contains multi-panel subplots (e.g., (a) and (b) side by side)
96+
- The figure would have illegibly small text if squeezed into one column
97+
98+
**Use `figure` (single column) when:**
99+
- The figure is a simple bar chart, line chart, or scatter plot with few data points
100+
- The figure has minimal text labels that remain readable at column width
101+
- The figure naturally fits a portrait or square aspect ratio
102+
103+
When fixing figures, also verify:
104+
- `figure*` figures use `figsize=(textwidth_in, ...)` not `columnwidth_in`
105+
- `figure` figures use `figsize=(columnwidth_in, ...)`
106+
- The LaTeX `\includegraphics[width=...]` matches the environment
107+
108+
If you find a complex figure squeezed into `\begin{figure}` that should be `\begin{figure*}`, change the LaTeX environment AND regenerate the figure at full width.
109+
85110
## Important Rules
86111

87112
1. You must actually modify Python scripts and run them (do not just output suggestions)

ark/templates/style_guides/academic_plot_style.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,24 @@ ax2.set_yticklabels([]) # remove duplicate y labels
215215

216216
---
217217

218+
## Figure Placement in Multi-Column LaTeX Templates
219+
220+
Choose the correct LaTeX environment based on figure complexity:
221+
222+
| Figure Type | Environment | Width | When |
223+
|-------------|------------|-------|------|
224+
| Simple single chart | `\begin{figure}` | `\columnwidth` | One bar/line/scatter plot, few labels |
225+
| Complex/dense chart | `\begin{figure*}` | `\textwidth` | Many bars, dense annotations, dual-axis |
226+
| Multi-panel (a)(b) | `\begin{figure*}` | `\textwidth` | Side-by-side subplots |
227+
| Concept/architecture | `\begin{figure*}` | `\textwidth` | Pipeline, system overview, flowchart |
228+
229+
When generating matplotlib figures:
230+
- Single-column: `figsize=(columnwidth_in, columnwidth_in * 0.7)`
231+
- Full-width: `figsize=(textwidth_in, textwidth_in * 0.35)` or taller if needed
232+
- Read both values from `figure_config.json`
233+
234+
---
235+
218236
## Anti-Patterns (NEVER do these)
219237

220238
- No 3D effects (no 3D bar charts, no 3D scatter unless truly 3D data)

0 commit comments

Comments
 (0)