本文へ移動
cccskills
無料GitHub で公開

latex-to-word

Convert between LaTeX and Microsoft Word for academic manuscripts in either direction, and assemble .tex from mixed sources. Fires on: converting .tex/LaTeX to Word/.docx ("tex to docx", "latex to word", "tex2docx", "convert to word", "pandoc convert"); converting .docx manuscripts to LaTeX for editing and back ("convert to latex", "manuscript", "footnotes", "reference doc", the docx-to-tex-to-docx round-trip / academic paper editing pipeline); high-fidelity delivery where plain pandoc loses tables, mangles cross-references, or fails on custom macros — booktabs/regression tables, OMML equations, cleveref, \estauto, \@@input, \thanks, TikZ, native Word tables, longtable, siunitx; and building .tex from mixed PDF/docx/LLM-generated sources. Replaces and reroutes the retired skills manuscript-editing-template-latex, latex-to-docx-fidelity, tex2docx, and latex-from-mixed-sources.

インストール方法を見る

含まれるファイル(90)

  • SKILL.md6.6 KB
  • convert_bracket_footnotes.py4.3 KB
  • gui.py24.6 KB
  • README.md10.8 KB
  • references/mixed-sources.md4.4 KB
  • references/roundtrip.md11.6 KB
  • references/tex-to-docx-engine.md20.3 KB
  • scripts/assemble.py334 B
  • scripts/build_all_estout.py364 B
  • scripts/build_fulltabular.py3.9 KB
  • scripts/cleanup_tex.py1.8 KB
  • scripts/combine_sections.py3.3 KB
  • scripts/convert.py173.6 KB
  • scripts/crop_white.py599 B
  • scripts/detect_rules.py1.3 KB
  • scripts/docx_to_tex.py1.8 KB
  • scripts/extract_tables.py1.0 KB
  • scripts/fix_quotes.py3.1 KB
  • scripts/full_tabular_to_docx.py31.9 KB
  • scripts/gen_reference.py4.9 KB
  • scripts/gen_test_docx.py16.1 KB
  • scripts/inspect_lastrow.py742 B
  • scripts/mhchem_unicode.py5.8 KB
  • scripts/pdf_to_png.py441 B
  • scripts/postprocess_docx.py4.3 KB
  • scripts/reference.docx10.7 KB
  • scripts/render_all_pages.py461 B
  • scripts/render_latex_env.py8.0 KB
  • scripts/render_ref.py1.1 KB
  • scripts/siunitx_expand.py7.2 KB
  • scripts/tex_table_to_docx.py13.9 KB
  • scripts/tex_to_docx.py3.9 KB
  • scripts/toolcheck.py3.4 KB
  • tests/qa_metrics.py14.9 KB
  • tests/run_tests.py11.3 KB
  • tests/t01_booktabs/t01_booktabs.tex1.5 KB
  • tests/t02_longtable/t02_longtable.tex5.5 KB
  • tests/t03_tabularx_multirow/t03_tabularx_multirow.tex1.5 KB
  • tests/t04_threeparttable/t04_threeparttable.tex1.0 KB
  • tests/t05_siunitx/t05_siunitx.tex1.1 KB
  • tests/t06_math/t06_math.tex1.4 KB
  • tests/t07_lists/t07_lists.tex1.5 KB
  • tests/t08_subfigures/t08_subfigures.tex937 B
  • tests/t09_natbib_cite/refs.bib725 B
  • tests/t09_natbib_cite/t09_natbib_cite.tex1.1 KB
  • tests/t10_biblatex/refs.bib956 B
  • tests/t10_biblatex/t10_biblatex.tex832 B
  • tests/t11_twocolumn/t11_twocolumn.tex2.0 KB
  • tests/t12_mixed/refs.bib706 B
  • tests/t12_mixed/t12_mixed.tex7.2 KB
  • tests/t13_wrapfig/s13_wrapfig.tex2.5 KB
  • tests/t14_multicol/s14_multicol.tex2.1 KB
  • tests/t15_listings/s15_listings.tex2.2 KB
  • tests/t16_hyperref/s16_hyperref.tex2.2 KB
  • tests/t17_frontmatter/s17_frontmatter.tex2.4 KB
  • tests/t18_resizebox_wide/s18_resizebox_wide.tex1.7 KB
  • tests/t19_complex_merge/s19_complex_merge.tex1.7 KB
  • tests/t20_enumitem/s20_enumitem.tex1.8 KB
  • tests/t21_acronyms/s21_acronyms.tex1.6 KB
  • tests/t22_tcolorbox/s22_tcolorbox.tex1.6 KB
  • tests/t23_tikz/paper.tex3.4 KB
  • tests/t24_algorithm/paper.tex2.5 KB
  • tests/t25_glossaries/paper.tex2.2 KB
  • tests/t26_table_footnote/paper.tex2.0 KB
  • tests/t27_longtable_math/paper.tex3.0 KB
  • tests/t28_integration/paper.tex12.5 KB
  • tests/t28_integration/u28_refs.bib785 B
  • tests/t29_subfig/paper.tex4.0 KB
  • tests/t30_booktabs_span/paper.tex4.3 KB
  • tests/t31_siunitx_S/paper.tex4.7 KB
  • tests/t32_links_color/paper.tex4.5 KB
  • tests/t33_math_matrix/paper.tex6.4 KB
  • tests/t34_nested_lists/paper.tex6.5 KB
  • tests/t35_tikzcd/paper.tex5.6 KB
  • tests/t36_chem_mhchem/paper.tex5.8 KB
  • tests/t37_colortbl/paper.tex3.2 KB
  • tests/t38_multifile_input/paper.tex414 B
  • tests/t38_multifile_input/parts/intro.tex1.1 KB
  • tests/t38_multifile_input/parts/methods.tex1.2 KB
  • tests/t38_multifile_input/parts/results.tex1.1 KB
  • tests/t39_verbatim_fancyvrb/paper.tex3.9 KB
  • tests/t40_bibitem_numeric/paper.tex3.2 KB
  • tests/t41_amsmath_adv/paper.tex6.5 KB
  • tests/t42_rotating/paper.tex5.7 KB
  • tests/t43_spancells/paper.tex4.8 KB
  • tests/t44_biblatex_style/paper.bib1.4 KB
  • tests/t44_biblatex_style/paper.tex3.3 KB
  • tests/t45_listings_input/code/sample.py466 B
  • tests/t45_listings_input/paper.tex5.6 KB
  • tests/t46_margin_notes/paper.tex4.7 KB

SKILL.md(原文)

インストールする前に、エージェントに与えられる指示の中身を確認できます。

LaTeX ↔ Word

This skill moves academic manuscripts between LaTeX and Microsoft Word and assembles .tex from heterogeneous sources. It consolidates four former skills into three workflows: a footnote-preserving round-trip for co-author editing cycles, a high-fidelity one-way .tex → .docx engine for delivering finished papers to Word-only journals or coauthors, and a set of knowledge patterns for building a single .tex from PDF/docx/LLM-generated content. Read the deep doc for the workflow you need before running anything.

Routing

User intentWorkflowEntry pointDeep doc
Deliver a finished LaTeX paper as high-fidelity Word (regression tables, math, cross-references must survive)B — one-way tex→docxscripts/convert.pyreferences/tex-to-docx-engine.md
Iterate on a manuscript with Word-based co-authors while editing in LaTeX (docx→tex→docx, footnotes preserved)A — round-tripgui.py, or scripts/docx_to_tex.py + scripts/tex_to_docx.pyreferences/roundtrip.md
Build a .tex from PDF / .docx / LLM-generated textC — assemble from mixed sourcesknowledge patterns (no scripts)references/mixed-sources.md

Which workflow

  • B is the default for "deliver my LaTeX paper as Word." The fidelity engine builds native Word tables, OMML equations, real footnotes, embedded figures, and resolves \cref/\Cref/\eqref from the .aux. Use B whenever the paper has regression/booktabs tables, math, or cross-references that must survive — plain pandoc drops or mangles all of these.
  • A is for iterating with Word-based co-authors while you edit in LaTeX. Its tex → docx step is plain pandoc plus a style-templated scripts/reference.docx (fast, formatting-only), so it does not build native tables or resolve crefs. Choose A when the exchange is prose and footnotes and speed matters; switch to B once the document depends on tables/math/cross-references.
  • C is knowledge-only — patterns for a pipeline that emits .tex, applied when you author the pipeline. No script to invoke.

Quick start

Workflow B (one-way, high fidelity) — compile the source once so a current .aux exists, then:

python scripts/convert.py path/to/main.tex --out main.docx
# optional: --aux main.aux --tables-dir tables --figures-dir figures \
#           --font "Linux Libertine G" --no-render

Workflow A (round-trip) — either launch the GUI:

python gui.py

or drive the two version-aware helpers (they wrap pandoc + reference.docx and run the footnote-count sanity check), using the input/ intermediate/ output/ layout:

python scripts/docx_to_tex.py v1     # input/input_v1.docx  -> intermediate/intermediate_v1.tex
# edit intermediate/intermediate_v2.tex ...
python scripts/tex_to_docx.py v2     # intermediate/intermediate_v2.tex -> output/output_v2.docx

Workflow C — no command; read references/mixed-sources.md and apply the two-track escaping / code-fence-stripping / \DeclareUnicodeCharacter patterns in your own generator.

Tool requirements

  • pandoc (3.x for the engine; ≥ 2.11 for the round-trip).
  • xelatex / latexmk (TeX Live or MiKTeX) — required to produce the .aux the engine reads, and for TikZ/PGFPlots/algorithm rendering.
  • python-docx, lxml — native table and OOXML construction.
  • Optional PyMuPDF (fitz) + Pillow — QA rasterization and image rendering.
  • Optional Microsoft Word (COM, via win32com) or LibreOffice (soffice) — final render-to-PDF check.
  • scripts/toolcheck.py resolves the pandoc / latexmk / xelatex executable locations for scripts/convert.py, scripts/render_latex_env.py, and scripts/gen_reference.py; gui.py, the round-trip helpers, and tests/run_tests.py still call bare pandoc/xelatex/latexmk from PATH.

Consolidation notes

This skill merges four predecessors; their old names route here via the description above:

  • manuscript-editing-template-latex → workflow A (references/roundtrip.md).
  • latex-to-docx-fidelity → workflow B (references/tex-to-docx-engine.md).
  • latex-from-mixed-sources → workflow C (references/mixed-sources.md).
  • tex2docx (retired). Its pandoc-postprocessing fix registry was diffed against the fidelity engine: six of seven fixes were already subsumed architecturally, because the engine prevents upstream what tex2docx patched after the fact — tables, figures, and captions never pass through pandoc, so the damage tex2docx repaired downstream never occurs. The two genuine gaps were ported INTO the engine: the notes-punctuation normalizer (normalize_note_text, applied to table-notes text in both table engines) and \include{} expansion (in expand_latex_inputs). See the "Ported from tex2docx" section of references/tex-to-docx-engine.md.

tests/ holds the 46-fixture (t01–t46) regression harness driven by tests/run_tests.py and scored by tests/qa_metrics.py. It ships source .tex fixtures only — compiled PDFs, rendered PNGs, and .docx artifacts regenerate on each run. Fix the converter under scripts/, never the fixtures.

Caution: gui.py bypasses permission prompts

gui.py invokes the Claude CLI with --dangerously-skip-permissions for its auto-edit and auto-fix loops (the "Edits" box and the automatic XeLaTeX-error repair). This bypasses the normal permission prompts, so any tool call Claude makes in those loops runs without confirmation. Review gui.py (see the two --dangerously-skip-permissions invocations) and understand what the auto loops can do before enabling that path.

レビュー

まだレビューはありません。使ってみた感想をお寄せください。

同じリポジトリのスキル

概要と使いどころ

Build human adjudication / hand-labeling sheets from LLM-pipeline data without evidence truncation. Use when: (1) preparing a CSV/Excel sheet for a human to rule on cases an LLM classifier or rater panel judged, (2) a labeler reports "there is no information to label from" or cells look empty in Excel, (3) excerpt columns cluster at one exact length (e.g. all 1,500 chars — a hard truncation cap). Covers: full rating-basis recovery, Excel 32,767-char cell cap, multi-line CSV mangling, ruling dropdowns, companion text files.

日本語の概要は準備中です。原文の説明を表示しています。

kennethkhoocy/applied-micro-skills222026年9月5日 更新

N-round adversarial review pipeline for empirical research output — the chain from data to LaTeX tables to a manuscript that cites them. A Claude drafter proposes minimal diffs, a deterministic mechanical battery gates every diff from a clean state with a regression gate, a Codex reviewer files check-backed critiques, and a blind judge panel decides residual disputes. Manual-invoke ONLY: trigger when the user explicitly runs /adversarial-empirical-review or names 'adversarial-empirical-review' / 'adversarial empirical review'. Do NOT auto-trigger on generic 'review my results', 'check my tables', or manuscript-editing requests. For prose-style refinement use style-emulation instead; this skill AUDITS WHETHER THE TABLES ARE CORRECT — that each number in the tables is what the analysis code computes, reproduces from the data, and is internally consistent. It is an empirical + code review: the manuscript is read only to resolve table numbering, and prose is not examined.

日本語の概要は準備中です。原文の説明を表示しています。

kennethkhoocy/applied-micro-skills222026年9月5日 更新

Before designing, training, or auditing ANY model that replicates human-annotated labels, audit the annotation protocol's INPUT — the exact document/evidence the human labelers consulted — and give the model that same input. Use when: (1) designing a classifier/LLM extractor whose target is a hand-coded label set, (2) a label-replication model shows low recall concentrated in a label subset and the diagnosis on offer is "the label's information is not in the features", (3) reviewers propose construct splits (e.g. "designation vs record-evident"), adjudication sittings, or per-domain stop rules to explain residual disagreement with gold, (4) validating an extraction pipeline against labels transcribed from a source document. Symptom of the underlying failure: elaborate theory accumulates to explain why gold is "partially unpredictable" when the model was simply never shown the document the annotators read.

日本語の概要は準備中です。原文の説明を表示しています。

kennethkhoocy/applied-micro-skills222026年9月5日 更新

Raise real concurrency in asyncio LLM batch scorers built on the OpenAI SDK (AsyncOpenAI, including OpenAI-compatible providers like DeepSeek). Use when: (1) raising an asyncio.Semaphore above ~100 produces no throughput gain, (2) a batch pipeline saturates near 100 in-flight requests despite a larger semaphore, (3) planning a high-concurrency campaign against a provider with no hard rate limit (DeepSeek v4-flash tolerates 2000+ in flight). Root cause: AsyncOpenAI's default httpx pool caps max_connections at 100, silently bottlenecking any larger semaphore — you must pass a custom http_client with httpx.Limits sized to the semaphore.

日本語の概要は準備中です。原文の説明を表示しています。

kennethkhoocy/applied-micro-skills222026年9月5日 更新

Place pre-screened literature citations into a LaTeX or Word manuscript, or restyle the citations already in one. Three modes: (1) inline placement — inline \cite{}/\citet{}/\citep{} with a compiled references.bib, for author-date journals (APA, MLA, Harvard, Chicago author-date, IEEE, Vancouver); (2) footnote placement — full formatted \footnote{} or OOXML footnotes for legal and notes styles (Bluebook, OSCOLA, Chicago, APA, McGill) with Id./supra short forms; (3) restyle — convert existing footnote citations from one style to another. This skill is manual-invoke ONLY — trigger ONLY when the user explicitly runs /cite-placement or explicitly names the "cite-placement" skill. Do NOT auto-trigger on general citation, footnote, or reference requests.

日本語の概要は準備中です。原文の説明を表示しています。

kennethkhoocy/applied-micro-skills222026年9月5日 更新

Download the actual PDF binary from bot-gated sites (taxpolicycenter.org, urban.org, SSRN-hosted mirrors, think-tank/publisher sites) via the Wayback Machine id_ URL form. Use when: (1) curl/WebFetch of a .pdf URL returns HTML instead of a PDF even with a browser User-Agent, (2) pypdf fails with "invalid pdf header: b'<!DOC'" or "EOF marker not found" on a freshly downloaded file, (3) Firecrawl can parse the PDF to markdown but you need the original file on disk (e.g., filing a reference copy).

日本語の概要は準備中です。原文の説明を表示しています。

kennethkhoocy/applied-micro-skills222026年9月5日 更新

kennethkhoocy のスキルをすべて見る

このスキルの問題を報告する