| name | latex-template-switch |
| description | Convert LaTeX papers between journal/conference templates for journal resubmission or template switching (e.g., Springer → MDPI, IEEE → Nature, IPOL → CVPR) through a privacy-preserving anonymized workflow. Use when the user provides a LaTeX .tex/project plus a target template directory or .tex file. Assume the input is not anonymized unless the user explicitly says it is already anonymized. Preserve privacy sentinels exactly; never open mapping.private.json except as a local script argument. |
| user-invocable | true |
| disable-model-invocation | true |
| allowed-tools | ["AskUserQuestion","Read","Edit","Glob","Grep","Bash(python3 *)","Bash(pdflatex *)","Bash(bibtex *)","Bash(ls *)","Bash(wc *)","Bash(diff *)"] |
LaTeX Template Switch
Convert an anonymized LaTeX paper from one journal/conference template to another while preserving all privacy sentinels.
Privacy Boundary
This section defines all privacy constraints. They apply throughout the entire task.
Original content protection
When the input is an original (non-anonymized) project, do not inspect any original .tex file before running scripts/anonymize.py. This means:
- Do not use
Read, Glob, Grep, cat, head, sed, rg, Search, or any tool that would display original .tex content — including the root file.
- If you need information to proceed (root filename, project structure, template choice), use
AskUserQuestion instead of inspecting the original files.
scripts/anonymize.py may be run freely — the script handles root inference, include discovery, and figure references locally without printing original text to the conversation.
- If root inference fails or is ambiguous, ask the user for
--root. Do not manually inspect files to determine it.
After scripts/anonymize.py finishes, inspect only the anonymized output directory.
mapping.private.json protection
Never read, request, summarize, upload, or print mapping.private.json. It may only be passed as a local --mapping argument to scripts/check_integrity.py and scripts/restore.py.
Already-anonymized input
Do not ask whether the input has already been anonymized. By default, assume the input is an original, non-anonymized project and run scripts/anonymize.py before inspecting any source file.
Only skip anonymization when the user explicitly states that the provided project is already anonymized and contains \qS{id}/\qE{id} sentinels. In that explicit case, inspect it normally and do not re-run scripts/anonymize.py.
How this skill works
The user provides:
- A LaTeX project/root
.tex file. Treat it as original, non-anonymized input by default; only treat it as already anonymized if the user explicitly says so.
- A target template directory or target template
.tex file
Your job is to reformat the anonymized .tex file or anonymized project directory to match the target template's structure. You only modify LaTeX formatting commands — never touch the text content (which appears as XxXx placeholders wrapped in \qS{id}/\qE{id} sentinels).
Start-of-task Input Check
At the start of every template-switching task, before anonymization or conversion, use AskUserQuestion to collect missing required decisions:
- target template format, directory, or
.tex file
- input path
- root
.tex when the user knows it or when the script reports ambiguous root inference
- whether multimodal/visual layout review is available and enabled; this only controls layout review, not figure anonymization
Always use the full delivery workflow by default: anonymize locally, migrate the anonymized paper to the target template, run integrity checks, restore with mapping.private.json, and deliver the final restored LaTeX project.
Keep the formatted anonymized project directory after final restore. Deliver it alongside the final restored project so the user can later request layout edits against the anonymized files without exposing original content.
Multimodal visual layout review
Multimodal visual review is optional. It is controlled by the user's choice at task start.
When disabled (or not requested): Task 6 uses only .log analysis and anonymized source structure inspection. Do not compile or inspect PDFs for visual review.
When enabled by the user, it becomes a required restore gate:
- Compile the converted anonymized project.
- Inspect only the anonymized PDF or rendered anonymized page images.
- Check for: blank pages, figure/table overflow or clipping, author-block overflow, incorrect float spans, overlapping text, abnormal whitespace, misplaced floats, tables/figures crossing the page edge or center line incorrectly.
- Apply only layout-preserving fixes (outer float wrappers, package fixes, page style). Do not modify content between
\qS{id} and \qE{id}, figure/table internals, or image files.
- Re-run compile and integrity checks before proceeding to restore.
Hard constraints (when enabled):
- Inspect only the anonymized PDF/page images or equivalent anonymized render outputs.
- Do not inspect the original project, restored
.tex, or restored PDF (unless the user explicitly approves restored-PDF inspection).
- Enabling multimodal review does not enable figure anonymization — the scripts do not redact images. If figure contents are sensitive, ask the user whether to disable multimodal review or provide a separately redacted figure set.
- If a visual fix would require changing content, table data, figure scale/crop, or image files, report the issue and request user approval instead of applying the prohibited change.
- Do not run restore until the anonymized PDF inspection is complete or the user explicitly approves skipping it.
Task List Setup (Required)
Before beginning any work on this task, create a fixed task list to track progress using TaskCreate. This gives the user visibility into what's being done and what's remaining. Create these 8 tasks in order:
- Collect inputs and parameters - Gather target template, input path, root
.tex if needed, and multimodal options; do not ask whether the input is already anonymized
- Analyze source and target templates - Read anonymized file and target template, identify differences
- Plan conversion edits - Use a deterministic conversion script for broad template migration; small localized fixes may be edited directly
- Execute conversion and validate - Run script, check integrity
- Compile and fix errors (loop) - Loop until the anonymized project compiles with no fatal errors and produces a PDF
- Layout/log review and repair - Review anonymized logs/source for warnings and layout issues; include multimodal PDF/page-image review if enabled; route required fixes back to Agent 2
- Restore gate checks - Verify all required conditions are met before restore
- Deliver final project, anonymized layout project, and report - Restore original content, keep the formatted anonymized project, output the final project, and write a layout-change report
Task status updates
- Mark a task as
in_progress when you start working on it
- Mark a task as
completed when finished
- If a task fails, keep it as
in_progress and note the issue
- Task 6 is always used for anonymized layout/log QA; multimodal PDF/page-image review is included only if the user enabled it
Agent Dispatch Policy
Use the main agent as the orchestrator. Helper agents are used for conversion and layout review, but they are not a privacy boundary. Privacy is enforced by the anonymized file workflow and local scripts. Agent 2 and Agent 3 are the final agents in the workflow; they do not spawn additional subagents.
Task ownership:
- Task 1: Agent 1
- Tasks 2-5: Agent 2
- Task 6: Agent 3 for layout/log QA; include multimodal PDF/page-image review only if enabled
- Tasks 7-8: Agent 1
Agent dispatch triggers
- Agent 2 is spawned after Task 1 (Collect inputs and parameters) completes. Agent 1 uses the Agent tool to spawn Agent 2, which then executes Tasks 2-5 sequentially.
- Agent 3 is spawned after Agent 2 completes Task 5 and before Task 7 begins. If multimodal visual layout review is enabled, Agent 3 also inspects the anonymized PDF/page images; otherwise Agent 3 reviews only anonymized logs and source structure.
- User visibility: The task list created in Task List Setup tracks all 8 tasks. When Agent 2 or Agent 3 is working on a task, that task is marked as
in_progress in the user's task list view. The user sees the same progress indicators regardless of which agent is executing.
How agents are dispatched
Agent 1 manages the task list and coordinates the overall workflow:
Task 1 → TaskUpdate(in_progress) → work → TaskUpdate(completed)
Agent 2 completes Tasks 2-5 → Agent 1 receives completion report
Agent 3 completes Task 6 → Agent 1 receives layout report
Task 7 → TaskUpdate(in_progress) → work → TaskUpdate(completed)
Task 8 → TaskUpdate(in_progress) → work → TaskUpdate(completed)
Agent 2 executes Tasks 2-5 directly (no further agent spawning):
Task 2 → TaskUpdate(in_progress) → analyze → TaskUpdate(completed)
Task 3 → TaskUpdate(in_progress) → write script → TaskUpdate(completed)
Task 4 → TaskUpdate(in_progress) → execute + validate → TaskUpdate(completed)
Task 5 → TaskUpdate(in_progress) → compile until no fatal errors and PDF exists → TaskUpdate(completed)
Agent 3 executes Task 6 directly (no further agent spawning):
Task 6 → TaskUpdate(in_progress) → review anonymized log/source → optional multimodal review → report required fixes → Agent 2 applies fixes → recompile/recheck → TaskUpdate(completed)
Result handoff
Agent 2 → Agent 1:
After completing Tasks 2-5, Agent 2 returns a task completion report containing:
- Conversion script execution status (success/failure)
- Integrity check results (pass/fail with details)
- Compilation results (errors fixed, remaining issues)
- Structural formatting changes applied, such as template shell changes, package changes, author-wrapper changes, section wrapper changes, bibliography/citation wrapper changes, and
table/figure wrapper changes
- Author-block restore-survival status: whether target author wrappers were placed outside sentinels, whether author sentinels were granular enough for safe migration, or whether author migration was intentionally deferred
- Potentially risky formatting changes that need user awareness
- Formatting changes that were intentionally not made because they would require prohibited content, table-data, figure-scaling/cropping, or image-file edits
- Any sentinel loss issues encountered and how they were resolved
- Task completion status for Tasks 2-5
Agent 3 → Agent 1:
After completing Task 6, Agent 3 returns a layout review report containing:
- Layout issues identified (blank pages, overflow, author-block problems, float placement, etc.)
- Required warning fixes, especially any
Overfull \hbox horizontal overflow warnings
- Suggested layout-preserving fixes (not applied directly)
- Overall visual quality assessment (acceptable/unacceptable with details)
- Whether the document is ready for restore
- Remaining issues, if any, that were not fixed because they require user approval or content-level edits
Agent 1 after receiving reports:
- Review Agent 2's completion report for any issues that need attention
- Review Agent 3's layout report
- If Agent 3 identified fixable layout issues or
Overfull \hbox warnings, Agent 1 must ask Agent 2 to apply accepted fixes to the anonymized project and re-run compile and integrity checks
- If Agent 3 identified issues that require prohibited content edits, Agent 1 must:
- Ask the user for explicit approval to relax the relevant restriction, or
- Report issues to the user for manual resolution
- Proceed to Task 7 (Restore gate checks) only after required Task 6 fixes have been handled
Integrity Check Ownership
Agent 2 runs check_integrity.py iteratively during conversion and compile-fix loops.
Agent 1 runs check_integrity.py once more as the final restore gate before restore.py.
Both agents may pass mapping.private.json only as a local script argument and must not open or print it.
Only Agent 2 should edit anonymized LaTeX files during conversion and layout repair. Agent 3 reports issues; Agent 1 decides whether fixes should be applied and asks Agent 2 to apply accepted fixes to avoid conflicting edits.
Agent 1: Orchestrator
Responsibilities:
- Collect inputs and decisions using
AskUserQuestion
- Run
scripts/anonymize.py for original input before any inspection
- Maintain the task list and gate status
- Run the final
check_integrity.py before restore
- Run
scripts/restore.py only after all required gates pass
- Write the final layout-change report as a Markdown file without original private text or
mapping.private.json content
- Deliver the final project
- Coordinate Agent 2 and Agent 3 execution
- Review Agent 3's reports and ask Agent 2 to apply accepted fixes
Restrictions:
- Do not read original
.tex files before anonymization
- Do not open
mapping.private.json; pass it only as a local script argument
- Do not inspect restored
.tex or restored PDF unless the user explicitly approves
Agent 2: Template Converter
Responsibilities:
- Analyze only the anonymized project and target template
- Generate and execute a conversion script for broad or repeated structural migration
- Apply small localized fixes directly only when scripting would add unnecessary overhead
- Ensure target-template structures that must survive restore are placed outside
\qS{id}...\qE{id} sentinel pairs
- Run the Task 5 compile-fix loop on the anonymized project until it compiles with no fatal errors and produces a PDF
- Apply accepted Task 6 layout/log fixes from Agent 3, then re-run compile and
check_integrity.py
- Run
check_integrity.py after conversion and after every broad structural edit
- Fix sentinel loss by recovering from the previous anonymized version, never from
mapping.private.json
- Report compilation errors and fixes in the completion report
Restrictions:
- May edit only the anonymized project and conversion script
- Must not read the original project,
mapping.private.json, or restored outputs
- Must not modify sentinel commands or sentinel-wrapped content
Agent 3: Layout Reviewer
Responsibilities:
- Log analysis: Analyze the
.log file from compilation to identify:
- Compilation errors not caught by Agent 2
- Package warnings that may indicate issues
Overfull \hbox warnings indicating horizontal overflow; these must be fixed before restore
- Other overfull/underfull box warnings indicating layout problems
- Missing references, undefined commands, or other LaTeX issues
- Visual review (when multimodal enabled): Follow the rules in "Multimodal visual layout review" above — use
Read on the anonymized PDF/page images to identify layout issues (blank pages, overflow, clipping, incorrect float spans, etc.).
- Produce a combined issue report containing:
- Log analysis findings (compilation warnings and potential issues)
- Visual layout issues (if multimodal review enabled)
- Suggested layout-preserving fixes for each issue
- A clear pass/fail statement for
Overfull \hbox warnings and visually unacceptable layout states
- Return the report to Agent 1, who coordinates with Agent 2 to apply accepted fixes
Restrictions:
- Does not directly edit files; Agent 2 applies accepted fixes after Agent 1 reviews the report
- Must not inspect original files,
mapping.private.json, restored .tex, or restored PDF
- Must not infer original content from placeholders
- Must not suggest content edits, table-data edits, figure scaling/cropping, or image-file edits unless the user explicitly approves
- May read only anonymized project files and logs; must not access original project or restored outputs
Agent 3 prompt requirements
When Agent 1 dispatches Agent 3, the prompt must explicitly say:
- Task 5 only proves the anonymized project compiles and produces a PDF; Task 6 is responsible for warning and visual layout quality.
- Any
Overfull \hbox horizontal overflow warning must be treated as a required fix, not an optional warning.
- If multimodal review is enabled, follow the "Multimodal visual layout review" rules and inspect only anonymized PDF/page-image render outputs.
- Agent 3 reports issues and layout-preserving fix suggestions; Agent 2 applies fixes and recompiles.
- If eliminating an overflow would require prohibited content edits, table data edits, figure scaling/cropping, or image-file edits, report that constraint and request explicit user approval instead of applying or suggesting the prohibited change as if it were allowed.
Step-by-step workflow
Step 1: Confirm inputs
Use AskUserQuestion for any missing target template format, target template directory, target template .tex file, input path, root .tex, or multimodal decision. Do not ask whether the input has already been anonymized. Always run the full conversion and restore workflow. Assume the input is original and non-anonymized unless the user explicitly states in their request that it is already anonymized. Do not begin anonymization or conversion until the target template is known. For default/original input, run only scripts/anonymize.py before inspecting any source file, including the root file. For explicitly already-anonymized input, inspect it normally.
After the target template is provided, inspect only the target template files. If the target contains a complete skeleton/root .tex file with \documentclass, \begin{document}, \title, abstract, sample sections, or sample bibliography, ask the user whether to use that file as the output skeleton. If the user agrees, copy the target skeleton into the output project and replace its demo content with anonymized source content. If the user declines, adapt the anonymized source root to the target template instead.
If the input is an original project, run scripts/anonymize.py locally first and continue only with the anonymized output.
If the user attached, selected, pasted, or linked an original .tex file in a way that exposes its contents to the model before anonymization, do not use that content for conversion. Use AskUserQuestion to ask the user to provide only a filesystem path, then run anonymization from the path.
Step 2: Analyze both files
Read the anonymized .tex or anonymized project directory and the target template. Identify:
| Source | Target |
|---|
documentclass | Required documentclass |
| Required packages | Required packages |
| Section commands and environments | Required section commands and environments |
| Abstract format (structured / unstructured) | Required abstract format |
| Author and affiliation format | Required author block structure |
| Table environments used | Template-supported table environments |
| Float placement style | Template float style |
Column layout: one-column / two-column, class options such as onecolumn/twocolumn, explicit \onecolumn/\twocolumn commands, and source float width assumptions such as \columnwidth or \textwidth | Required column layout, column-width constraints, and whether full-width floats (table*, figure*) are supported |
| Citation style | Required citation style |
Step 3: Plan and apply conversion edits
Prefer writing a deterministic Python script (e.g., convert_format.py) for broad template migration. This includes documentclass/package changes, author-block migration, section/environment migrations, citation/bibliography migrations, repeated float changes, and any edit that must be replayed after compile failures.
Small localized fixes may be applied directly to anonymized .tex files when scripting would add unnecessary overhead, such as adding one missing package, changing one float wrapper, or fixing a single target-template compatibility command. Direct edits must still preserve sentinels, avoid sentinel-wrapped content, be recorded in layout_change_report.md, and be followed by check_integrity.py and recompilation.
The conversion implementation should:
- Replace
documentclass — swap to target template's class
- Update packages — add missing ones, remove incompatible ones
- Migrate the author block — treat author/affiliation layout as template structure; adapt wrappers such as
\And, \AND, \thanks, \author, \affil, \IEEEauthorblockN, and \IEEEauthorblockA as needed, but preserve every sentinel-wrapped name, affiliation, and email block exactly. Target-template author wrappers must be outside sentinel pairs so they survive restore.py.
- Adapt section commands/environments — change wrappers only; do not rename or rewrite sentinel-wrapped headings
- Adjust table and figure environments — use
references/table-migration.md when tables or figures require conversion; scan every table, table*, figure, and figure*, not only the first one; use the Step 2 column-layout analysis to determine whether the migration changes one-column/two-column assumptions. When migrating from a single-column template to a two-column template, any table or figure that overflows a column, or was authored against full-page single-column width assumptions, should be converted to the corresponding full-width float (table* or figure*) before considering any internal changes
- Adjust float parameters —
[!t] → [H] or [htbp] only when supported by the target template
- Convert citation commands — adjust command names when needed, but preserve citation keys
- Update page layout — margins, column layout, font size; preserve or introduce only the target template's supported one-column/two-column controls
Step 4: Execute the script
Run the conversion script on the anonymized project or root .tex when broad scripted conversion is used:
python3 convert_format.py <anonymized-project-or-root.tex> --output <formatted-anonymized-project-or-root.tex>
Immediately run the integrity checker on the anonymized output. Re-run it after any broad scripted conversion and after any direct edit that removes or rewrites packages, comments, author blocks, template demo content, tables, or figures.
python scripts/check_integrity.py <formatted-anonymized-project-or-root.tex> --mapping <mapping.private.json>
If sentinels are missing, recover the lost sentinel blocks from the previous anonymized version. Do not read mapping.private.json to reconstruct text, and do not invent replacement sentinels.
scripts/anonymize.py performs structure-aware author anonymization for normal \author{...} blocks: author names, affiliations, emails, and notes are anonymized as leaf text while author-layout commands remain outside sentinels. Before or immediately after generating the conversion script, still perform an author-block sentinel-granularity check, especially for legacy anonymized inputs or unusual author macros:
- If author names, affiliations, emails, and notes are individually sentinel-wrapped, the conversion script may place target-template wrappers such as
\IEEEauthorblockN{...} and \IEEEauthorblockA{...} outside those sentinels.
- If the whole author block, or a large author macro body, is one coarse sentinel pair, do not insert target-template author commands inside that sentinel. Those commands will be discarded by
restore.py and the restored paper will revert to the original author syntax.
- If a coarse author sentinel prevents safe author-template migration, report this as an unresolved high-risk author-block issue and ask Agent 1 to request user approval for a manual/restored-author fix or a more granular local anonymization strategy. Do not claim author migration is complete merely because the anonymized PDF compiles.
Step 5: Compile and fix fatal errors (loop)
Task 5 is only the compile-success gate. Its goal is to produce a PDF from the formatted anonymized project with no fatal LaTeX errors. Warning cleanup and visual layout quality are handled in Task 6.
LaTeX fatal-error compilation must be done in a loop because:
- A fix in one location may introduce errors in another
- Complex documents often require multiple rounds of adjustments
- Package conflicts may emerge only after multiple compilation cycles
The workflow is: compile → check for fatal errors → fix fatal errors → recompile. Continue this cycle until the document compiles with no fatal errors and produces a PDF, or until reaching a maximum number of iterations. If fatal errors persist after the maximum iterations, report them to the user with detailed diagnostics.
Run the LaTeX compilation chain to verify:
cd <output-directory>
pdflatex -interaction=nonstopmode <formatted-root.tex>
bibtex <formatted-root-basename> || true
pdflatex -interaction=nonstopmode <formatted-root.tex>
pdflatex -interaction=nonstopmode <formatted-root.tex>
Check the .log file for fatal errors:
grep -n "^!" <formatted-root.log>
grep -n "Undefined control sequence" <formatted-root.log>
grep -n "Missing" <formatted-root.log>
Fix fatal compilation errors by updating the conversion script and re-running when the issue belongs to broad/repeated conversion logic. Small localized compile fixes may be applied directly to anonymized .tex files, but must be recorded and followed by integrity check and recompilation. Common fixes:
- Missing package → add
\usepackage{...}
- Undefined command → define or replace the command
- Author block compile/layout errors → adjust only the target-template author/affiliation wrappers; do not edit sentinel-wrapped names, affiliations, emails, or notes
- Table/figure width overflow → scan all floats; if the overflow is caused by single-column to two-column migration, convert the outer float to a full-width float first (
table → table*, figure → figure*); do not change internal widths, font sizes, column specs, image scaling/cropping, or content unless the user explicitly approves
Do not mark Task 5 complete until the anonymized PDF exists. Do not treat Task 5 completion as layout approval; continue to Task 6 for warnings and visual review.
Step 5.1: Layout/log review and repair
Task 6 handles warning cleanup and layout quality. Agent 3 reviews the anonymized .log and source structure. When multimodal review is enabled, Agent 3 also inspects the anonymized PDF/page images per the "Multimodal visual layout review" rules above.
Required Task 6 outcomes:
- No unresolved
Overfull \hbox warnings remain. Horizontal overflow must be fixed before restore.
- Other overfull/underfull warnings are reviewed and either fixed or explicitly reported with a reason.
- If multimodal review is enabled, the anonymized PDF must pass the visual layout checks listed in "Multimodal visual layout review" above.
- Reuse the Step 2 column-layout analysis during layout repair. If the source and target differ in one-column/two-column layout, inspect all tables and figures for column-width assumptions before changing internals.
- For table or figure overflow introduced by single-column to two-column migration, the required first fix is to convert the outer float to a full-width float (
table* or figure*) when the target template supports it.
- Agent 3 reports issues; Agent 2 applies accepted layout-preserving fixes, recompiles, and re-runs
check_integrity.py.
- Repeat Agent 3 review and Agent 2 repair until Task 6 passes, reaches the iteration limit, or requires user approval for otherwise prohibited edits.
Step 5.5: Restore gate
Before running restore.py, verify all required gates:
check_integrity.py passes on the formatted anonymized project.
- The formatted anonymized project compiles to PDF, or unresolved compile errors have been reported to the user.
- Task 6 layout/log review passes, including no unresolved
Overfull \hbox warnings.
- If multimodal visual layout review was enabled, the anonymized PDF or anonymized page images were inspected by the multimodal model.
- Any visual issues requiring content edits, table data edits, figure scaling/cropping, or image-file edits were reported instead of silently changed.
- For project input or any paper with external assets, restore will use directory-to-directory mode so figures, bibliography files, class/style files, and other support files can be verified and copied.
If any enabled gate is incomplete, stop and use AskUserQuestion to ask whether to complete the missing gate now or explicitly continue without it. Record the user's decision in the final report.
Step 6: Output full delivery
Run:
python scripts/check_integrity.py <formatted-anonymized-project-or-root.tex> --mapping <mapping.private.json>
python scripts/restore.py <formatted-anonymized-project-or-root.tex> --mapping <mapping.private.json> --output <paper_final_project-or-root.tex>
Use directory-to-directory restore for any project input or any paper that uses external figures, bibliography files, class/style files, or included .tex files:
python scripts/restore.py <formatted-anonymized-project-dir> --mapping <mapping.private.json> --output <paper_final_project-dir>
Single-file restore is allowed only for a standalone .tex document with no external assets. During directory restore, restore.py verifies expected support files from the original project and the formatted anonymized project, copies missing files into the final output directory when possible, and reports only counts for copied, restored, compensated, or still-missing support files.
Keep the formatted anonymized project directory as an explicit deliverable. Do not delete or overwrite it during restore. Tell the user its path in the final response and note that future layout edits should be made against that anonymized project while preserving all \qS{id}/\qE{id} blocks.
At the end of every task, write a Markdown report named layout_change_report.md in the delivered final output directory. The report must not include original paper text, private mapping values, restored prose excerpts, or sensitive figure/table contents. It may reference anonymized file paths, sentinel ids, environment names, line hints, warning summaries, and short structural descriptions.
The report must include:
- Workflow summary: target template, full delivery workflow, formatted anonymized project path, final restored project path, whether multimodal visual review was enabled, and which gates passed.
- Formatting changes applied: documentclass/template shell, package changes, author/affiliation wrapper migration, section/environment wrapper changes, citation/bibliography wrapper changes, float placement changes, and
table/figure to table*/figure* conversions.
- Compile and layout fixes: fatal errors fixed, warning fixes,
Overfull \hbox status, and visual layout fixes when multimodal review was enabled.
- Support file completeness: whether directory-to-directory restore was used, support-file copy/restore/compensation counts, and any still-missing support files by short relative path only.
- Potentially risky changes: any package removal/replacement, author block restructuring, bibliography style change, macro compatibility change, float wrapper conversion, or layout workaround that could affect the final PDF even though it preserves content.
- Changes intentionally not made: items skipped because they would require changing table data, caption/text content, figure scale/crop, image files, sentinel-wrapped content, or other prohibited content-level edits.
- Remaining issues and user approvals: unresolved warnings, unresolved visual issues, iteration limits reached, and any user-approved exceptions.
Why these constraints exist
The XxXx placeholders in the anonymized paper represent the user's private content. These rules exist to ensure the privacy-preserving workflow functions correctly and the restore process can recover the original content. Violating these rules would corrupt the restored paper.
Protecting content integrity
- Do not modify
\qS{id} or \qE{id} commands — These are restore anchors that the restore script uses to locate and replace anonymized content. Changing them breaks the mapping.
- Do not modify content between
\qS and \qE — This content is anonymized private text that will be replaced during restore. Modifying it would cause restore to fail or produce corrupted output.
- Do not insert target-template structure inside a sentinel pair —
restore.py replaces the entire region between matching \qS{id} and \qE{id} with the original text. Any wrapper inserted inside that region, such as \IEEEauthorblockN{...} inside a coarse author sentinel, will disappear after restore.
- Do not guess what placeholders mean — You cannot interpret the anonymized text and don't need to. Let the restore process handle all content restoration.
- Do not read or request
mapping.private.json — This file contains the original paper text and must remain private. It can only be passed as a local script argument to the restore scripts.
Preserving structure and metadata
- Do not add text content beyond what the target template requires structurally — adding content would create conflicts during restore or produce an invalid final document.
- Do not merge or split paragraphs containing sentinel pairs — this would break the sentinel pairing and cause restore failures.
- Do not modify table cell data — numbers, method names, and metrics are content, not formatting. The restore process needs them unchanged.
- Do not rename headings or change title/abstract/keyword wording — these are content elements protected by sentinels, even if the target template has different style preferences.
- Do not modify figure/table internals — changing
\includegraphics parameters, table font sizes, column specs, or cell contents would alter the paper's content. Only change outer float wrappers when needed.
- Do not delete sentinel blocks — even if they appear in comments, disabled packages, or demo content, they must remain for restore to work.
What you should do instead
- Preserve all
\qS{id}...placeholder...\qE{id} blocks exactly as they are throughout the conversion process.
- Place restore-surviving wrappers outside sentinels — author wrappers, section wrappers, float wrappers, and template shell commands that must remain after restore must sit outside sentinel pairs. If the required wrapper cannot be placed outside a coarse sentinel, stop and report the limitation.
- Preserve sentinels in removed material as comments when template migration drops old wrappers — keep sentinel-containing text blocks in commented form so restore can still find them.
- Keep
\qS/\qE preamble definitions — do not remove \newcommand{\qS}[1]{} or similar definitions.
- Use strict layout-preserving mode — change only the template shell and outer float wrappers; keep figure/table content, dimensions, font sizes, and column settings unchanged.
- Treat tables and figures as atomic blocks — only change outer float environments (
table ↔ table*, figure ↔ figure*) when needed for single-column/two-column migration. If a single-column source float overflows after moving to a two-column target, prefer the full-width table* or figure* wrapper before any internal table/figure change.
- Leave math environments untouched —
$...$, \begin{equation}, etc. are content, not formatting.
- Preserve all
\label{} and \ref{} cross-references — these are structural anchors that must not break.
- Report unresolved layout problems instead of optimizing content — if a fix would require changing figure/table internals, document the issue for the user to address.
References
- Read
references/table-migration.md only when a table conversion is required.
File reference
| File | Purpose |
|---|
scripts/anonymize.py | Run locally before inspecting original input; accepts a root .tex file or project directory, injects sentinels, replaces text, and copies support files unchanged |
scripts/check_integrity.py | Run locally after conversion and before restore; validates sentinel pairs using mapping.private.json without printing original text |
scripts/restore.py | Run locally last; restores original text and original support files using mapping.private.json |
The user's full pipeline:
① python scripts/anonymize.py paper_project/ -o paper_project_anon/ -m paper_project_anon.mapping.private.json
② /latex-template-switch ← reformat paper_project_anon/ only
③ python scripts/check_integrity.py paper_project_anon_formatted/ -m paper_project_anon.mapping.private.json
④ python scripts/restore.py paper_project_anon_formatted/ -m paper_project_anon.mapping.private.json -o paper_final/
⑤ cd paper_final/ && pdflatex <restored-root>.tex