AgentStack
Browse Sign in
Browse Why AgentStack Sell Docs
Sign in
SKILL verified MIT Self-run

Word2latex

skill-lari-uqac-researchtools-word2latex · by LARi-UQAC

Convert a Word .docx template (Mitacs, CRSNG, FRQNT, UQAC, partner forms) into a faithful LaTeX source. Use when the user asks to translate a Word gabarit to LaTeX, when a generated .tex must match a .docx visually, or for /word2latex. Drives pandoc + applies the standard patch sequence (Arial, full-grid tables, centered sections, landscape geometry, first-page banner). Delegates the actual patch…

No reviews yet
0 installs
28 views
0.0% view→install

Install

$ agentstack add skill-lari-uqac-researchtools-word2latex

✓ scanned · ✓ verified, works with Claude Code, Cursor, and more.

Security review

✓ Passed

No issues found. Passed automated security review. · v0.1.0 How review works →

  • Prompt-injection patterns
  • Secret / credential exfiltration
  • Dangerous shell & filesystem operations
  • Untrusted network calls
  • Known-malicious package signatures

What it can access

  • Network access No
  • Filesystem access No
  • Shell / process execution No
  • Environment & secrets No
  • Dynamic code execution No

From automated source analysis of v0.1.0. “Used” means the capability is present in the source — more access means more to trust, not that it’s unsafe.

View the full security report →

Verified badge

Passed review? Show it. Paste this badge into your README, it links to the public security report.

AgentStack Verified badge Links to your public security report.
[![AgentStack Verified](https://agentstack.voostack.com/badges/verified.svg)](https://agentstack.voostack.com/security/report/skill-lari-uqac-researchtools-word2latex)

Reliability & compatibility

Security review passed
0 installs to date
no reviews yet
2mo ago

Declared compatibility

Claude CodeClaude Desktop

Compatibility is declared by the source manifest. End-to-end runtime verification is coming, see below.

Preview Execution monitoring

We're building live execution health for every listing: tool-call success rate, median latency, uptime, and last-checked timestamps, measured, not self-reported. It isn't live yet, so we don't show numbers we can't stand behind.

How agent discovery & health will work →
Are you the author of Word2latex? Claim this listing to set pricing, connect Stripe payouts, and keep 70% of every sale.
Sign up to claim

About

word2latex Skill

Prerequisites

Before running, verify:

  1. pandoc installed: pandoc --version
  2. python-docx available (used by docx_inspect.py): python -c "import docx; print('OK')" — if missing, pip install python-docx
  3. pdflatex and pdftoppm reachable from the shell (any TeX distribution + poppler)
  4. The .docx file is closed in Word (otherwise the ~$ lock file blocks reads)

Mode dispatch

$ARGUMENTS is the path to the .docx file (or a directory containing exactly one .docx).

/word2latex 

Optional flags appended after the path:

| Flag | Effect | |---|---| | --engine=pdflatex (default) | Use helvet to approximate Arial | | --engine=xelatex | Use fontspec with native Arial | | --no-banner | Skip the first-page TikZ banner block (use for plain documents without a colored header strip) | | --legal-landscape | Enable the Legal-landscape macros (14×8.5 in) — needed only if the docx has ` | | --bibliography | Manuscript mode: extract the numbered bibliography to a first-pass .bib, rewrite inline citations to \cite, then validate via /bibclean + /scopus`. Opt-in; off for form gabarits. |

Workflow

Step 1 — Inspect the .docx

Run the inspector to extract every value the LaTeX preamble needs:

cd ""
python "/.claude/skills/word2latex/scripts/docx_inspect.py" 

The script prints a structured report with:

  • Default font + size
  • Line spacing
  • Each `` (orientation, page size, margins, header/footer references)
  • Heading1 / Heading2 / Title styles (font, size, color, alignment)
  • Table border defaults
  • Image catalog (path, dimensions, dominant color, transparency stats)
  • Header and footer text per section

Save the report — every preamble decision below traces back to it.

Step 2 — Run pandoc

pandoc "" -o ".tex" --extract-media="img_"

This produces a .tex with longtables, hyperlinks, and image references in place but without the visual fidelity adjustments. Do not edit the pandoc output until step 3.

Step 3 — Delegate to the word-to-latex agent

Hand off to the agent with the inspector report as context:

Use the word-to-latex agent to patch .tex against the inspector report above.
Apply the full standard patch sequence in order. The banner uses image.png
(white wordmark) on the left; pages – are landscape .

The agent applies the 10-step patch sequence documented in .claude/skills/word2latex/references/preamble_patches.md.

Step 3b — Manuscript bibliography (optional, --bibliography only)

Skip this step for form gabarits. Run it only when the .docx is a manuscript (numbered references + inline citations) and --bibliography was passed.

  1. Second pandoc pass to markdown (keeps explicit 1. numbering):

``powershell pandoc "" -t gfm -o ".md" ``

  1. Extract the bibliography and rewrite citations:

``powershell python "/.claude/skills/word2latex/scripts/manuscript_bib.py" ".tex" --bib-source ".md" `` Produces .cited.tex (citations as \cite{...}) and .first-pass.bib`.

  1. Validate and enrich the bibliography (respects the project reference rules —

approved publishers, clickable DOI): `` /bibclean .first-pass.bib /scopus validate .first-pass.bib ``

  1. The agent (Step 3) then injects the biblatex preamble and replaces the

pandoc-rendered reference list with \printbibliography.

Full details: .claude/skills/word2latex/references/manuscript_bibliography.md.

Step 4 — Compile and render

pdflatex -interaction=nonstopmode -output-directory=out ".tex"
pdflatex -interaction=nonstopmode -output-directory=out ".tex"
Remove-Item out\page-*.png -ErrorAction SilentlyContinue
pdftoppm -png -r 120 out\.pdf out\page

Two pdflatex passes are required for \pageref{LastPage} and longtable column widths.

Step 5 — Visual verification

Read at minimum:

  • Page 1 — banner, white wordmark on left, title centered, icon on right, no duplicate header
  • Each landscape page — text + table on the same page, full grid visible
  • The last page — footer reads correctly, no orphan content from a previous section

If any page does not match, return to the agent with the specific page index and the discrepancy.

Output formatting

Final response to the user lists:

  1. The .tex file path
  2. The page count of the resulting PDF
  3. For each landscape page: dimensions in inches
  4. Any unresolved overfull \hbox ≥ 5 pt (smaller are absorbed by \hfuzz=3pt)
  5. The verification rendering folder (out/page-*.png)

Error handling

| Error | Action | |---|---| | pandoc: command not found | Ask user to install pandoc or add it to PATH | | python-docx missing | pip install python-docx then retry | | ~$.docx lock present | Ask user to close the document in Word | | ! Misplaced \noalign | A \toprule/\midrule was missed by the rule-replacement pass — re-run replace booktabs rules with \hline | | Command \endLegalLand already defined | Macro name collides with \begin{LegalLand} / \end{LegalLand} semantics — rename to \Open.../\Close... | | paperwidth not available in \newgeometry | Geometry forbids paper-size keys mid-document — set \pdfpagewidth and \paperwidth before the \newgeometry call | | Calendar table spills to a second page | Apply row-compaction: replace minipage+enumerate cells with \textbf{N) text}, set \renewcommand{\arraystretch}{0.95}, use \footnotesize | | Right header text missing | Header logo image has no width constraint and pushes the right slot off-page — set width=3.5cm,keepaspectratio on the \includegraphics in \fancyhead[L] | | Entries : 0 from manuscript_bib.py | The bibliography is not numbered as 1./2. in the source — run the -t gfm markdown pass and pass it via --bib-source | | Unresolved cites > 0 after validation | A \cite{refN} survived — the source citation number has no matching numbered reference; fix the source numbering or the reference list |

See also

  • Agent: .claude/agents/word-to-latex.md
  • Patch reference: .claude/skills/word2latex/references/preamble_patches.md
  • Manuscript bibliography reference: .claude/skills/word2latex/references/manuscript_bibliography.md
  • Inspector script: .claude/skills/word2latex/scripts/docx_inspect.py
  • Bibliography module: .claude/skills/word2latex/scripts/manuscript_bib.py

Source & license

This open-source skill is cataloged on AgentStack and links to its original source — we do not rehost the code.

Install and usage instructions live in the source repository linked above.

Reviews

No reviews yet, be the first.

Versions

  • v0.1.0 Imported from the upstream source.