.STY

STY File

LaTeX Style / Package File
Ask a question
QUICK ANSWER

A STY file is a LaTeX package (style) file - plain-text TeX macros that add features or formatting to a LaTeX document, loaded with \usepackage{name}. Any text editor opens it to read or edit the code; to use it, place it next to your .tex file and compile with pdflatex. Most common packages already ship with TeX Live and MiKTeX.

Developer: LaTeX Project (Leslie Lamport; built on Donald Knuth's TeX) Category: Developer Files Open standard MIME: text/x-tex
OPENS ON Windows macOS Linux Web
Related: .DO · .MD · .HEX · .XSD

On this page

19k+ extensions indexed
Last reviewed Aug 20, 2026

Not sure what your file is?

Drop any file into our identifier - we read just the first bytes to name the format.

Identify a file

What is the STY file format?

A .sty file is a plain-text file that contains style definitions used for formatting LaTeX documents. Commands are introduced with a backslash (` \ ), while comments are marked with a percentage sign (%). .sty files are loaded by .tex or .ltx documents via the \usepackage{name}` command to apply their formatting to the given document.

.sty files can be reused across any number of documents. Style definitions can also be set directly in a document's preamble; packaging them in .sty form makes them shareable. A modern .sty opens with a \ProvidesPackage declaration that stamps the package name, date, and version.

LaTeX is very popular in scientific and academic publishing, where .sty files are commonly used to standardize document layouts and formatting. Packages are distributed through CTAN and bundled in TeX distributions such as TeX Live and MiKTeX. Many .sty files are generated from a .dtx source using a .ins script; the .cls format serves the same role for overall document structure.

Security & safety

RISK: MEDIUM

A .sty is executable TeX code that runs when LaTeX compiles your document. TeX can read and (with \write18/shell-escape enabled) even run external commands, so a malicious style file could in principle write files or execute programs during compilation. Most distributions ship with shell-escape restricted by default, which limits this. Treat .sty files from unknown sources like any downloaded code: prefer packages from CTAN/your distribution, read an unfamiliar one before compiling with it, and don't enable unrestricted shell-escape for files you don't trust. Viewing a .sty in a text editor is harmless.

Format details

in a nutshell
FULL NAMELaTeX Style / Package Fileaka LaTeX style file, LaTeX package
DEVELOPERLaTeX Project (Leslie Lamport; built on Donald Knuth's TeX)since 1985 (LaTeX); package mechanism formalised in LaTeX2e, 1994
MIME TYPEtext/x-tex
TYPEPlain-text LaTeX/TeX macro source defining a package or style
STANDARDOpen · royalty-free

Programs that open STY files

Windows4 apps
MiKTeX Open-source The TeX distribution that supplies thousands of .sty files; install missing ones via its Package Manager. \usepackage finds them automatically.
Texmaker Open-source Open and edit the .sty as source; compile the parent .tex with the bundled tools.
TeXstudio Open-source Open the .sty to read/edit it. To use it: keep it beside your .tex or in a local texmf tree, then compile. (Pairs with a MiKTeX/TeX Live backend.)
Notepad / VS Code Open-source Open as plain text to read or quickly edit the macros; no TeX install needed just to view.
macOS3 apps
TeXworks Open-source Open and edit the style file; compile documents that \usepackage it.
TeX Live / MacTeX Open-source Install MacTeX (TeX Live for macOS); it ships the standard packages and finds new .sty in the local texmf tree.
TeXShop Open-source Open the .sty in this macOS LaTeX editor to read/edit; typesets via MacTeX.
Linux3 apps
TeX Live Open-source Install via your distro or upstream; 'tlmgr install <pkg>' adds missing .sty files, found automatically by \usepackage.
Texmaker / TeXstudio Open-source Open the .sty to edit; build the parent document with the TeX Live backend.
Any text editor (gedit, vim, Emacs) Open-source Open as plain text; AUCTeX (Emacs) gives full LaTeX editing support.
Web1 app
Overleaf Freemium Upload the .sty into your project alongside the .tex; \usepackage it and compile in the browser - no local install.

Technical details

deep spec
File typePlain-text TeX macro source file
MIME typetext/x-tex (also accepted: application/x-tex, text/plain)
Character encodingASCII or UTF-8; UTF-8 is the default input encoding since the LaTeX 2018 release
Load command\usepackage{name} in the document preamble; options passed as \usepackage[opt1,opt2]{name}
Package self-declaration\ProvidesPackage{name}[YYYY/MM/DD vX.Y description] stamps identity and version in the compilation log
Option handling\DeclareOption{key}{code} defines accepted options; \ProcessOptions executes those chosen by the user
Dependency declaration\RequirePackage{name}[min-date] declares dependencies, equivalent to \usepackage but safe inside package code
Binary signatureNone - plain text; modern files conventionally start with % comment lines followed by \NeedsTeXFormat{LaTeX2e}
Typical file size1 KB - 200 KB depending on package complexity
Companion format.cls document class - same TeX macro language but loaded with \documentclass and governs overall document structure
Source formatMany .sty files are extracted from a .dtx documented source file using a .ins install driver script
DistributionPublished on CTAN; bundled in TeX Live (cross-platform) and MiKTeX (Windows)
Platform supportAny operating system with a TeX distribution installed: Windows, macOS, Linux, BSD
Syntax markersBackslash (\) introduces every command; percent (%) starts a comment extending to end of line
Modern programming layerPackages may use the LaTeX3 / expl3 layer (\ExplSyntaxOn...\ExplSyntaxOff) for structured macro programming
Released1985 (LaTeX); package mechanism formalised in LaTeX2e, 1994
Latest versionN/A (no version number on the format itself; tracked per package and by LaTeX2e/LaTeX3 releases)
Open standardYes · royalty-free
Specificationwww.latex-project.org

STY conversions

Community Q&A

asked by users
Ask a quick question
Get help from people who work with STY files. Be specific - include your system and software version.
No account needed · answers usually within a day

No questions yet - be the first to ask about STY files.

Frequently asked questions

How do I install a .sty file for LaTeX?
Simplest: put the .sty in the same folder as your .tex and compile - LaTeX finds it. For permanent use, place it in your local texmf tree (e.g. ~/texmf/tex/latex/<name>/) and run 'texhash'/'mktexlsr', or install the package via MiKTeX Package Manager or 'tlmgr'.
What is a .sty file used for?
It's a LaTeX package: reusable macros that add features or formatting (math, graphics, hyperlinks, page layout). You load it in your document with \usepackage{name}.
What's the difference between a .sty and a .cls file?
Both are LaTeX macro source. A .sty (package) is loaded with \usepackage and adds features to any document; a .cls (class) is loaded with \documentclass and defines the whole document type (article, report, a journal template).
How do I open a .sty file?
It's plain text - open it in any editor (Notepad++, VS Code, vim) or a LaTeX IDE (TeXstudio, TeXmaker, Overleaf). You read/edit the macros there; you don't 'run' it on its own.
LaTeX says 'File name.sty not found' - what do I do?
The package isn't where LaTeX searches. Install it (MiKTeX Package Manager, or 'tlmgr install name'), or drop the .sty next to your .tex. On MiKTeX, on-the-fly install usually offers to fetch it automatically.
Can I convert a .sty to PDF?
No - it's not a document. Compile a small .tex that uses the package to PDF instead, or read the package's own documentation PDF (built from its .dtx).

References

1The LaTeX Project - Documentationwww.latex-project.org
2CTAN - Comprehensive TeX Archive Networkctan.org

Keep exploring

across the database

Top extensions this week

1.AQQAQQ Instant Messenger File
2.MDMarkdown Document
3.CRDOWNLOADChrome Partial Download File
4.BINCD/DVD Disc Image (BIN/CUE)
5.PARTPartial Download File
6.RPMSGRestricted Permission Message
7.NOMEDIAAndroid No-Media Marker File
8.EXEWindows Executable (Portable Executable)
9.AVIFAV1 Image File Format (AVIF)
10.ICSiCalendar data file

Related extensions

.DOStata Do-File
.MDMarkdown Document
.HEXIntel HEX File
.XSDXML Schema Definition
.MAPSource Map (JavaScript / CSS)
.CONFIGConfiguration File

Free file tools

An in-browser file identifier and image converter - everything runs on your device.

Open the toolbox

Browse file extensions A-Z