Working with AI
Draw figures with AI
Describe a diagram, preview editable TikZ or CeTZ, and refine it in your paper.
本頁內容尚未翻譯。
Describe the figure in the assistant chat, alongside the paper it belongs to. In a LaTeX project the assistant writes TikZ or PGFPlots. In a Typst project it writes CeTZ, fletcher, or plain Typst. Either way it renders the figure on its own before anything goes into your document.
Draw a three-stage pipeline: collect samples, estimate uncertainty, and compare predictions. Use the notation in methods.tex. Preview it before inserting it.
Start with a brief
Section titled “Start with a brief”Say what the reader should understand, which labels matter, and where the figure will go. Mention relevant project files with @. If you already have a sketch, add it to the project and ask the assistant to use it as a reference.
In a Typst project, Prompts has a CeTZ figure starter that fills in the request for you to finish. In a LaTeX project the same starter is called TikZ figure.
Preview and refine
Section titled “Preview and refine”The assistant writes the figure source, renders a standalone preview, and uses the errors to repair it. A vision-capable model also looks at the rendered picture and keeps adjusting until labels stop overlapping and the spacing looks right. Ask for a change in the same conversation: shorter labels, a wider layout, or consistent notation.
A Typst preview uses the project’s own Typst version. Packages such as CeTZ and fletcher load the way they do in a normal Typst compile, so a package the project hasn’t used before is downloaded from Typst Universe the first time.
The figure tools are available in Typst projects and in LaTeX projects whose engine can compile a figure on its own. They aren’t offered in Markdown projects. You can turn them off in the chat’s Tools popover, where they are grouped under Figure. Choose a connected model in AI setup.
Insert editable source
Section titled “Insert editable source”Once the preview reads well, ask the assistant to insert it with a caption and label. When edits need your approval, the approval card shows the rendered figure, so you see what you are accepting. Then compile the complete paper to check how it fits.
- In LaTeX, the code goes inside a
figureenvironment with\captionand\label. - In Typst, the code goes inside
#figurewith the caption, the label follows as<label>, and any#importlines the figure needs and the file lacks are placed above it.
A PNG copy is also saved to figures/. The source stays in your document, where you can edit it directly or ask for another revision. Supported TikZ and fletcher diagrams can also be imported into the diagram composer and edited on its canvas.
Plot research data
Section titled “Plot research data”Use the analysis workflow when the figure depends on a dataset. Ask the assistant to save the script and the data selection behind the plot so you can reproduce it.
For a recurring figure workflow, invoke /oleafly-figure-prep from Skills.