跳到主要内容
知仓学习社ZHICANG

sync-tex

Transfers prose edits from latex/index.tex (Overleaf) back into index.qmd. Use after pulling LaTeX edits from a collaborator.

不碰外部(只输出文字)无严重或高危命中brycewang-stanford/Auto-Empirical-Research-Skills

它会碰到什么

扫了多少1 个文本文件,3 KB
它会碰到什么不碰外部(只输出文字)
命中总数0 处
命中统计严重 0 · 高 0 · 中 0 · 低 0

这一栏是扫描器报的事实,不是结论。命中多不等于有毒(安全工具、规则库、示例脚本本来就会包含危险写法),命中少也不等于干净。它和你手上的凭据、文件、网络有什么关系,需要你自己看。

技能内容

Sync LaTeX Edits to QMD

Transfer prose changes made by collaborators in latex/index.tex (e.g., via Overleaf) back into index.qmd.

Prerequisites

  • latex/.baseline.tex must exist (auto-created by bash scripts/render.sh)
  • latex/index.tex must contain collaborator edits (pulled from Overleaf / GitHub)

Steps

  1. Read these three files:
  • latex/.baseline.tex — the LaTeX snapshot from the last render (before edits)
  • latex/index.tex — the LaTeX after collaborator edits
  • index.qmd — the current QMD manuscript source
  1. Compare latex/.baseline.tex vs latex/index.tex to identify changes.

Focus on the document body only (everything between \begin{document} and \end{document}).

Ignore the preamble (lines before \begin{document}) — these are auto-generated by Quarto.

  1. For each section (identified by \section{...}\label{...} and \subsection{...}\label{...} markers), check if the prose text changed between baseline and modified.
  1. For each changed section, apply the edits to the corresponding section in index.qmd:
  • Convert LaTeX formatting to QMD equivalents:
  • \textbf{...}...
  • \textit{...} or \emph{...}...
  • \href{url}{text}[text](url)
  • Section~\ref{sec-id}@sec-id
  • Figure~\ref{fig-id}@fig-id
  • Table~\ref{tbl-id}@tbl-id
  • \cite{key} or \citep{key}[@key]
  • \citet{key}@key
  • Footnotes: \footnote{...}^[...]
  • CRITICAL: Preserve all {{< embed >}} shortcodes exactly as they are in the QMD.

Do NOT replace them with \includegraphics, \begin{figure}, \begin{longtable}, or any LaTeX equivalents.

These shortcodes pull live outputs from notebooks and must remain intact.

  • If a collaborator edited a figure/table caption in LaTeX (\caption{...}), note the change in the summary report but do NOT modify the embed shortcodes — captions are defined in the notebook source cells.
  1. After applying all changes, show a summary:
  • List each section that was modified
  • For each, show a brief description of what changed (e.g., "Added two sentences to Introduction", "Rewrote paragraph 2 in Methods")
  • Note any changes that could NOT be transferred (e.g., caption edits, preamble changes, new LaTeX packages)
  1. Render the manuscript with bash scripts/render.sh to verify the round-trip is clean (no warnings, no errors).

Error handling

  • If latex/.baseline.tex does not exist, tell the user to run /project:render first.
  • If latex/.baseline.tex and latex/index.tex are identical, report "No changes detected" and stop.
  • If a section label in the LaTeX does not match any section in index.qmd, flag it and skip.

想直接用这个技能?

本站把开放许可(MIT / Apache 等)的技能按仓库打包整理到网盘,点一下转存到你自己的网盘,不用一个个从 GitHub 拉。许可未声明的技能只给原始仓库链接,不打包。