Document tools
Packages
Search CTAN for LaTeX packages and Typst Universe for Typst packages, then add one to your document from the editor toolbar.
Цей контент ще не доступний вашою мовою.
LaTeX and Typst documents get most of their extra features from packages. The packages button at the right end of the editor toolbar opens a searchable list for the project’s language and writes the line that loads a package for you. Markdown projects have no packages button.
You can also open the list from the ⌘K palette with Browse LaTeX packages or Browse Typst packages.
LaTeX packages
Section titled “LaTeX packages”In a LaTeX project, choose LaTeX packages. Search CTAN by package name or description. If CTAN can’t be reached, or you’re offline, the dialog says so and shows Oleafly’s built-in list instead. A list that couldn’t be refreshed shows the date it was downloaded.
Each row can show these labels:
- In document: the main file already loads this package.
- Document class: the entry is a class, not a package. Classes are set with
\documentclass, so the row lets you copy that line but not add it. - Installed: your TeX distribution already has the package.
Each row also has these controls:
- Options, a field for package options such as
margin=2cm. Braces must match, and]or%can’t be used. - Add to preamble, which writes
\usepackage[options]{name}into the preamble of the main file. If the file already loads the package, nothing changes and the dialog tells you. - Copy line, which copies the same
\usepackageline, or the\documentclassline for a class. - CTAN, which opens the package’s page on CTAN.
- Install, for a package your TeX distribution is missing. See below.
Installing LaTeX packages
Section titled “Installing LaTeX packages”What “installed” means depends on how the project compiles:
- Tectonic, the built-in compiler, downloads a package the first time your document uses it. There’s nothing to install, and the dialog says so at the top.
- latexmk with TeX Live: when your TeX distribution has
tlmgr, Oleafly checks which packages you have, marks them Installed, and offers Install for the rest. Install runstlmgrfor that one package. - Other TeX setups: Oleafly can’t tell which packages are present, so rows show no install state.
Pick the compiler from the arrow beside Recompile. See LaTeX engines.
Typst packages
Section titled “Typst packages”In a Typst project, choose Typst packages to browse Typst Universe. Search by name, keyword, or category, or narrow the list with a category chip. The dialog shows up to 100 packages at a time, so search when the list is long.
Each row shows the package name, its latest version, a Template badge for template packages, and a short description. When a package needs a newer Typst than the project uses, the row says which version it needs.
- Insert import adds
#import "@preview/name:version": *after the imports at the top of the open.typfile. If the file already imports that package, only the version number changes. A Typst file has to be open in the editor. - Copy import copies the same line.
Update hints
Section titled “Update hints”When an @preview import in your file is older than the latest release on Typst Universe, the editor marks the version with a hint such as “cetz 0.4.2 is available. This import uses 0.3.4.” The hint’s Update to 0.4.2 action changes the number in place.
Keep packages with the project
Section titled “Keep packages with the project”Typst downloads packages into a shared cache the first time a project imports them. To make a project carry its own copies, use Project packages at the bottom of the dialog:
- Use packages from the project folder makes Typst look in the project’s
typst-packagesfolder first. A project set up this way compiles offline and on other computers. - Vendor packages into project copies every package the project imports from the cache into
typst-packages. If a package isn’t in the cache yet, compile once while online, then vendor again.
The section also shows how many packages the project holds.
Offline
Section titled “Offline”With offline mode on, the dialog uses the package list it downloaded last time and shows its date. If no list has ever been downloaded, it can’t show one until you go online.
Related pages
Section titled “Related pages”- The editor: the rest of the editor toolbar
- Compiling: how packages are fetched during a build
- Document settings: paper size, margins, and fonts without writing package code