Intelligent Merge workflow
When you need a merge
When an agent edits only one section of a long document, its output (r0/draft.tex or r1/draft.tex) may contain just the modified fragment rather than the full file. Running latexdiff directly between a partial fragment and the full original produces a broken diff.
Intelligent Merge runs the merge agent to splice the edited fragment back into your full Base File, producing a complete .tex document that you can compile and compare cleanly with latexdiff.
The full Base File and the agent's partial Edited File both feed the merge agent, which emits a complete merged document: the valid latexdiff input.
The merge workflow
Open the merge action from the "LaTeXDiffs" section ( LaTeXDiffs) in the main TeXRA interface:
The LaTeXDiffs section: pick an Edited File, then select the highlighted Merge action in the Edited row. Merge writes into the agent panel's primary Input file.
- Select the base file: Merge uses the primary Input file selected in the agent panel (the first input file) as the document to merge changes into. The LaTeXDiffs "Base File" dropdown ( Base) is used by Diff, Compare, and Accept, not by Merge. If no input file is selected, TeXRA says "Choose both the input and edited files to merge."
- Select the edited file: Choose the document containing the suggested changes from the "Edited File" dropdown ( Edited).
- Select Merge: Select the "Merge" button () in the "Edited File" row. The merge runs on TeXRA's helper model, set from Settings → Models → Models. Models with strong reasoning (such as Claude Opus 5, GPT-6 / GPT-5.6, or Gemini 3.1 Pro) are recommended for complex merges.
There is a second entry point. In the ProgressBoard, each generated output file has a Merge edits action ("Merge edits into the workspace file") that runs the same merge agent against the corresponding workspace file, with no dropdowns to fill in.
Extension and desktop feature
The Intelligent Merge action pairs a base file with a separate Edited File, which the VS Code extension and the desktop app supply through their file pickers and the ProgressBoard. The texra run CLI command takes only --input/--context files and has no edited-file slot, so this merge workflow is not available from the CLI.
Output
The merge agent writes the combined document to run storage under the base file's name (r0/<base filename>.tex) and streams its progress in the ProgressBoard. Once the run completes, compare r0/<base filename>.tex against your original file with latexdiff (or accept the merged file back into the workspace).
Next steps
- LaTeX Diff: Learn how to use
latexdiffto compare the merged file with your original. - Built-in agents: Review the agents whose outputs you might want to merge.