\usepackage{lmodern} % better i18n Postscript version of Knuth's cm fonts
\usepackage{amsmath,amssymb} % math symbols and commands
\usepackage{amsfonts} % math fonts
\usepackage{amsthm} % for theorems
\usepackage[amsmath,thmmarks,hyperref]{ntheorem} % also for theorems
\usepackage{fixmath} % ISO conform greek letters
\usepackage{cool} % retain mathematical meaning of its expressions in addition to the typesetting instructions, easier export to mathematica etc
\usepackage[all,warning]{onlyamsmath} % show warnings for $$...$$ and eqnarrays
\usepackage[utf8]{inputenc} % support utf8
\usepackage[T1]{fontenc} % resolve some deficiencies and inconsistencies in OT1 fontencoding
\usepackage{inconsolata} % code listings font, could also use FiraMono
\usepackage{wasymsym} % more glyphs
\usepackage{nicefrac} % perhaps better fraction typesetting as 1/2
\usepackage{newtxtext,newtxmath} % modern times-like font with math support
\usepackage{newpxtext,newpxmath} % palatino-like font with math support
\usepackage{helvet} % Helvetica, `\renewcommand{\familydefault}{\sfdefault}`
\usepackage{eulervm} % Zapf's Euler fonts
\usepackage{tgpagella} % TeXGyre Pagella fonts
\usepackage{libertine} % Linux Libertine fonts (elegant, book-quality serif)
\usepackage{fourier} % Fourier fonts (Utopia-based)
\usepackage{courier} % Courier font (monospaced)
\usepackage{times} % Times Roman font
\usepackage{mathptmx} % Times font for math
\usepackage{mathpazo} % Palatino font with math support
\usepackage{color} % color support
\usepackage{xcolor} % extended colors
\usepackage{textcomp} % text companion fonts (additional symbols like ©, ®, ™)
\usepackage{lettrine} % decorative drop caps, e.g. Spongebob The
\usepackage{Typocaps} % provides decorative drop cap fonts
\usepackage{pdfcomment} % PDF Annotations & Sticky Notes
\usepackage{soul} % text decorations, so = s p a c e d o u t, small caps, underline, strikethrough
\usepackage{shadowtext} % text with shadows
\usepackage{soulutf8} % soul package with UTF-8 support
\usepackage{soulpos} % soul with position tracking
\usepackage{lua-ul} % underlining for LuaLaTeX
\usepackage{relsize} % relative font sizing (\smaller, \larger)
\usepackage{anyfontsize} % any font size without warnings
\usepackage{scalefnt} % scale current font
\usepackage{dsfont} % doublestroke fonts (for \mathds{1} indicator function)\usepackage{ellipsis} % proper spacing around ellipses
\usepackage{ragged2e} % improved ragged-right/left/center commands
\usepackage{footmisc} % customize footnote appearance and behavior
\usepackage{fnpct} % manage interaction of footnotes and punctuation
\usepackage{ftnright} % footnotes in right column
\usepackage{endnotes} % endnotes instead of footnotes
\usepackage{pagenote} % page notes
\usepackage{sidenotes} % margin notes and figures
\usepackage{leading} % adjust line spacing preciselyTypographic adjustments to make your text look better. Documented here.
For best results use pdfTeX >= 1.40. See the package documentation here.
\usepackage[
protrusion=true, activate={true,nocompatibility}, % activate protrusion and expansion
final, % enable microtype; use "draft" to disable
tracking=true, kerning=true, spacing=true, % enable these techniques
factor=1100, % add 10% to the protrusion amount (default is 1000)
stretch=10, shrink=10 % reduce stretchability/shrinkability
]{microtype}
\SetTracking{encoding={*}, shape=sc}{40}\usepackage[margins=2.5cm,a4paper]{geometry}
\usepackage{titlesec} % section title formatting
\usepackage{titling} % control over \maketitle
\usepackage{appendix}
\usepackage{fancyhdr} % stylish headers and footers
\usepackage{scrlayer-scrpage} % KOMA-Script header/footer (modern alternative)
\usepackage{extramarks} % additional marks for headers/footers
\usepackage{cmap} % Make PDF files searchable and copyable
\usepackage{richtext} % input forms and annotations from pdf spec
\usepackage{adjustbox} % scale, trim, clip, and frame content
\usepackage{balance} % Balances the columns of the last page
\usepackage{multicol} % quickly typeset multicolumn text in single column document
\usepackage{multirow} % multiple rows in tables
\usepackage{parskip} % control indentation and spaces between paragraphs
\usepackage{tabto}
\usepackage{pdflandscape} % landscape tables and figures
\usepackage{pdflscape} % also does landscape pages
\usepackage{enumitem} % easily change labels with [label=(\roman*)] or similar
\usepackage[super]{nth} % typeset 1st, 2nd, 3rd, etc.
\usepackage{upref} % upright font for all \ref and \eqref
\usepackage{emptypage} % for the book class, removes headers and footers from empty pages at end of chapters
\usepackage[subtle]{savetrees} % controversial, can help text tighter with subtle mode
\usepackage{setspace} % line spacing control (single, 1.5, double spacing)
\usepackage{indentfirst} % indent first paragraph after section headings
\usepackage{lastpage} % reference to last page number
\usepackage{afterpage} % execute command after current page is complete
\usepackage{placeins} % float barriers with \FloatBarrier
\usepackage{rotating} % rotate objects (tables, figures)
\usepackage{wrapfig} % wrap text around figures
\usepackage{marginnote} % better margin notes than \marginpar
\usepackage{mparhack} % fixes margin paragraph placement
\usepackage{marginfix} % fixes margin note positioning
\usepackage{ifoddpage} % conditionals for odd/even pages
\usepackage{typearea} % KOMA-Script page layout (alternative to geometry)
\usepackage{crop} % crop marks for printing
\usepackage{needspace} % ensure minimum space on page
\usepackage{nextpage} % issue page breaks to next odd/even page
\usepackage{floatpag} % different page styles for float pages
\usepackage{everypage} % hooks for every page\usepackage{paralist} % compact lists, inline lists
\usepackage{outlines} % easy nested lists
\usepackage{easylist} % easy list creation
\usepackage{tasks} % horizontal lists (like multiple choice)
\usepackage{shortlst} % compact lists across columns\usepackage{epigraph} % epigraphs (quotes before chapters)
\usepackage{quotchap} % decorative chapter quotes
\usepackage{quoting} % advanced quotation environments
\usepackage{dirtytalk} % simple quotation marks\usepackage{gb4e} % linguistic examples
\usepackage{linguex} % linguistic examples (alternative)
\usepackage{expex} % linguistic examples (another alternative)
\usepackage{cgloss4e} % interlinear glosses
\usepackage{covington} % linguistics macros
\usepackage{phonetic} % phonetic symbols
\usepackage{tipa} % IPA symbols
\usepackage{vowel} % vowel charts\usepackage{chngcntr} % change counter dependencies
\usepackage{remreset} % remove counter resets
\usepackage{fmtcount} % format counter output (text, roman, etc.)
\usepackage{moreenum} % additional enumeration styles
\usepackage{alphalph} % extended alphabetic counters\usepackage{substr} % substring operations
\usepackage{stringstrings} % string manipulation
\usepackage{xstring} % advanced string operations
\usepackage{datatool} % database/CSV tools
\usepackage{forloop} % for loops in LaTeX
\usepackage{pgffor} % advanced loops (part of TikZ but standalone)
\usepackage{multido} % repeated operations
\usepackage{coolstr} % string manipulation
\usepackage{coollist} % list operations\usepackage{steinmetz} % electrical engineering notation
\usepackage{braket} % dirac notation
\usepackage{simplewick} % simple wick contractions
\usepackage{bm} % bold math symbols
\usepackage{physics} % typing of physics equations faster, simpler and equations easier to read
\usepackage[\arc-separator = \,, retain-explicit-plus, inter-unit-product =\cdot, detect-weight=true, detect-family=true, range-phrase=--, range-units=single]{siunitx} % typeset SI units
\usepackage{units} % typeset units (older alternative to siunitx)
\usepackage{numprint} % format numbers with spacing
\usepackage{ziffer} % European-style number formatting
\usepackage[version=4]{mhchem} % typeset chemical symbols and equations
\usepackage{nicematrix} % enhanced matrix environments
\usepackage[makeroom]{cancel} % cancel terms in equations
\usepackage{circledsteps} % circled numbers for step-by-step explanations
\usepackage{algpseudocodex} % beautiful pseudocode
\usepackage{systeme} % typeset systems of linear equations and inequalities
\usepackage{acronym} % Expand acronyms at least once
\usepackage{asymptote} % 2D and 3D TeX-Aware Vector Graphics Language, useful for the computationally complex
\usepackage{sagetex} % Embed Sage code and plots
\usepackage{polynom} % Macros for manipulating polynomials
\usepackage{blochsphere} % Draw pseudo-3D diagrams of Bloch spheres
\usepackage[normalem]{ulem} % strikethrough text
\usepackage{censor} % censor text like the CIA
\usepackage{verse} % typeset poetry
\usepackage{fancyvrb} % specify font, box, and use external files for verbatim environments
\usepackage{chemfig,chemmacros} % drawing chemical structures and reaction schemes
\usepackage{bohr} % atomic models
\usepackage{babel} % better localization and multilingual support
\usepackage{polyglossia} % modern replacement for babel (XeLaTeX/LuaLaTeX)
\RequirePackage[ngerman=ngerman-x-latest]{hyphsubst} % better hyphenation for other languages
\usepackage[retainorgcmds]{IEEEtrantools} % sophisticated equation arrays
\usepackage{csquotes} % easier quotations with \enquote{}
\usepackage{mathtools} % mathclap for long summations, extends amsmath
\usepackage{listings} % code blocks
\usepackage{minted} % code blocks with syntax highlighting (requires Pygments)
\usepackage{upquote} % typeset quotes as straight vertical quotes in verbatim environments (like code)\usepackage{algorithm} % algorithm float environment
\usepackage{algorithmicx} % base package for algpseudocode
\usepackage{algorithmic} % pseudocode formatting (older style)
\usepackage{algpseudocode} % part of algorithmicx (modern alternative)
\usepackage{algcompatible} % compatibility with algorithmic
\usepackage{algorithm2e} % alternative algorithm package with different syntax
\usepackage{syntax} % BNF grammar notation
\usepackage{rail} % railway diagrams for syntax
\usepackage{ebnf} % EBNF notation
\usepackage{bytefield} % packet/bitfield diagrams
\usepackage{binhex} % binary and hexadecimal numbers\usepackage{fp} % fixed-point arithmetic
\usepackage{calculator} % perform calculations
\usepackage{spreadtab} % spreadsheet-like calculations in tables\usepackage{cases} % enhanced cases environment
\usepackage{empheq} % emphasize equations with boxes, colors
\usepackage{witharrows} % arrows with explanations in math
\usepackage{tensor} % tensor notation
\usepackage{diffcoeff} % derivatives and differentials
\usepackage{derivative} % alternative derivative notation
\usepackage{esint} % extended integral symbols
\usepackage{commath} % common math notation shortcuts
\usepackage{intervals} % interval notation
\usepackage{mleftright} % better spacing for \left \right
\usepackage{stmaryrd} % St Mary Road symbols
\usepackage{esvect} % vector arrows
\usepackage{xfrac} % nice-looking inline fractions like ¹/₂
\usepackage{thmtools} % enhanced theorem styling and management\usepackage[table,dvipsnames]{xcolor}
\usepackage{graphicx} % including figures, rotating or scaling text
\usepackage{float} % allows you to use `H` to specify where floats go stronger
\usepackage{tikz,tikz-3dplot} % 2d and 3d figures
\usepackage{pgfplots} % 2d and 3d plotting
\usepackage{getmap} % Download OpenStreetMap maps for use in documents
\usepackage{pdfpages} % include entire PDF pages
\usepackage[justification=centering, labelfont={small,bf}, font={small}]{caption}
\usepackage{capt-of} % captions outside float environments
\usepackage{subcaption} % subfigures and subtables (modern approach)
\usepackage{subfig} % subfigures (older alternative to subcaption)
\usepackage[outline]{contour} % outlined text
\usepackage{overpic} % overlay text/graphics on included images
\usepackage{eso-pic} % add picture commands to every page
\usepackage{wallpaper} % add watermarks/backgrounds
\usepackage{background} % page backgrounds
\usepackage{draftwatermark} % watermark for drafts
\usepackage{pict2e} % improved picture environment
\usepackage{curves} % curved lines in picture environment
\usepackage{epic} % extended picture commands
\usepackage{eepic} % extension to epic
\usepackage{transparent} % transparent graphics
\usepackage{trimclip} % trim and clip graphics inline\usepackage{array} % create custom columns for formatting tabular material on a per-column basis
\usepackage{colortbl} % colored tables
\usepackage{booktabs} % nicer looking tables with professional rules
\usepackage{longtable} % multi-page tables
\usepackage{threeparttable} % tables with notes
\usepackage{dcolumn} % decimal-aligned columns
\usepackage{tabularx} % greater dynamism in column widths
\usepackage{tabulary} % auto-sizing columns like tabularx but better
\usepackage{tabularray} % modern, powerful alternative to tabular
\usepackage{arydshln} % dashed lines in arrays/tables
\usepackage{makecell} % line breaks and formatting in table cells
\usepackage{diagbox} % diagonal lines in table cells
\usepackage{hhline} % fine control over table lines
\usepackage{ltablex} % combines longtable and tabularx
\usepackage{xltabular} % combination of longtable and tabularx
\usepackage{ltxtable} % another longtable + tabularx combo\usepackage{tcolorbox} % highly customizable colored boxes
\usepackage{mdframed} % framed environments that can break across pages
\usepackage{framed} % simple framed environments
\usepackage{fancybox} % various box styles
\usepackage{dashbox} % dashed border boxes
\usepackage{environ} % create custom environments more easily
\usepackage{boxedminipage} % boxed minipages
\usepackage{bclogo} % boxes with logos/icons
\usepackage{awesomebox} % boxes with FontAwesome icons
\usepackage{varwidth} % variable-width minipage\usetikzlibrary{calc, arrows, arrows.meta, positioning, decorations.pathreplacing, decorations.markings, decorations.text, calligraphy, pgfplots.dateplot}
\usepackage{circuitikz} % circuit diagrams using TikZ
\usepackage{tikzpeople} % stick figure people
\usepackage{tikz-cd} % Commutative Diagrams
\usepackage{tikzmark} % mark positions in text for later tikz use
\usepackage{forest} % draw trees (linguistic, decision, etc.)
\usepackage{tikz-qtree} % quick tree drawing
\usepackage{tree-dvips} % linguistic trees
\usepackage{dirtree} % directory tree structures\usepackage{hyperref} % pdf metadata and to create links within the document and to URLs
\usepackage{bookmark} % improved PDF bookmarks (better than hyperref alone)
\usepackage{url} % typesets URLS
\usepackage[noadjust]{cite} % [1,2,3,4,5] --> [1-5] useful in hep-th!
\usepackage{natbib} % natural sciences citation styles
\usepackage{biblatex} % modern bibliography system
\usepackage{apacite} % APA citation style
\usepackage[notref,notcite]{showkeys} % useful when writing the paper
\usepackage[noabbrev]{cleveref} % load after hyperref for nice commands to reference within document
\usepackage{varioref} % variable page references ("on the next page", etc.)
\usepackage{nameref} % reference by section name
\usepackage{titleref} % reference section titles
\usepackage{xr} % cross-reference between documents
\usepackage{xr-hyper} % xr with hyperref support
\usepackage{zref} % extended referencing system
\usepackage{refcount} % access reference counters
\usepackage{fncylab} % format labels and references
\usepackage{prettyref} % pretty formatting for references
\usepackage{refstyle} % reference style customization
\usepackage{smartref} % context-aware references
\usepackage[nottoc,numbib]{tocbibind}
\usepackage{glossaries} % glossary and acronym support
\usepackage{glossaries-extra} % easier abbreviations and enhanced glossaries
\usepackage{notoccite} % prevent citations in TOC from appearing in bibliography\usepackage{makeidx} % index generation
\usepackage{imakeidx} % improved index creation with multiple indices
\usepackage{crossreftools} % tools for cross-referencing
\usepackage{nomencl} % nomenclature lists\RequirePackage[l2tabu, orthodox]{nag} % warns when you accidentally use deprecated LaTeX constructs from l2tabu, use before document class
\RequirePackage{snapshot} % Automatically creates a .dep file listing all packages and versions used
\usepackage{refcheck} % Warns about unused \label commands or undefined \ref commands
\usepackage{showlabels} % Displays all \label, \ref, \cite in the margins for easy reference
\usepackage{chktex} % LaTeX linter, checks for common errors
\usepackage{lacheck} % syntax checker for LaTeX documents
\usepackage{strict} % turns LaTeX warnings into errors for stricter checking
\usepackage{silence} % selectively suppress specific warnings
\usepackage{prelim2e} % mark document as preliminary/draft with timestamps
\usepackage{fixme} % insert fixme notes with different severity levels
\usepackage[draft]{changes} % track document changes and revisions
\usepackage{lineno} % line numbers for drafts/reviews\usepackage{datetime2} % set datetime formats
\usepackage{datetime} % format dates and times
\usepackage{advdate} % date calculations
\usepackage[english]{isodate} % ISO formatted dates
\usepackage{pdfcrypt} % pdf encryption
\usepackage{iftex,expl3} % engine detection and LaTeX3 programming
\usepackage{etoolbox} % if-then and programming tools
\usepackage{xparse} % more flexible macros (LaTeX3 command parser)
\usepackage{xspace} % smart spacing after macros
\usepackage{ifthen} % conditional commands
\usepackage{calc} % infix notation for length calculations
\usepackage{lipsum} % lorem ipsum dummy text
\usepackage{blindtext} % more dummy text options
\usepackage{todonotes} % todo notes in margins\usepackage{comment} % comment out large sections
\usepackage{version} % include/exclude document versions
\usepackage{versions} % similar to version package
\usepackage{optional} % optional document parts
\usepackage{ifdraft} % conditionals for draft/final mode
\usepackage{ifpdf} % conditionals for PDF vs DVI output
\usepackage{ifxetex} % detect XeTeX engine
\usepackage{ifluatex} % detect LuaTeX engine\usepackage{regexpatch} % patch commands with regex
\usepackage{xpatch} % extend and patch macros
\usepackage{letltxmacro} % safe \let for LaTeX macros\usepackage{currfile} % access current file name
\usepackage{filecontents} % write external files from document
\usepackage{catchfile} % read external file contents into macro
\usepackage{newfile} % read/write to multiple external files
\usepackage{import} % better \input with relative paths
\usepackage{vc} % version control integration
\usepackage{gitinfo2} % git repository information in document\usepackage{pythontex} % execute Python code in LaTeX
\usepackage{pythonhighlight} % Python syntax highlighting
\usepackage{gnuplottex} % embed gnuplot code
\usepackage{auto-pst-pdf} % automatic conversion of PSTricks to PDF\usepackage{pdfx} % create PDF/A and PDF/X compliant documents
\usepackage{embedfile} % embed arbitrary files in PDF
\usepackage{attachfile2} % attach files to PDF
\usepackage{ocgx2} % PDF layers (optional content groups)
\usepackage{hyperxmp} % embed XMP metadata in PDF
\usepackage{pdfprivacy} % remove metadata for privacy
\usepackage{pageslts} % page count for last page in different counters
\usepackage{totpages} % total page count
\usepackage{navigator} % presentation navigation\usepackage{authoraftertitle} % access \MyTitle, \MyAuthor after \maketitle
\usepackage{authblk} % multiple authors with affiliations% These are document classes, not packages, but included for reference:
% \documentclass{beamer} % presentations
% \documentclass{memoir} % book class with extensive features
% \documentclass{article} % standard article class
% \documentclass{book} % standard book class
% \documentclass{report} % standard report classAutomultiplechoice for typesetting exams.
\usepackage{verbatim} % enhanced verbatim environment
\usepackage{abstract} % abstract customization
\usepackage{musixtex} % musical scores
\usepackage{skak} % chess notation and boards
\usepackage{crossword} % crosswords
\usepackage{sudoku} % sudoku puzzles
\usepackage{qrcode}
\usepackage{barcode}
\usepackage{menukeys} % keyboard shortcutsHad Claude generate these, need to verify them. Do not take these as gospel.
- Use only ONE main font package to avoid conflicts. Choose between:
newtxtext,newtxmath(Times-like)newpxtext,newpxmath(Palatino-like)mathptmx(Times for math, older)mathpazo(Palatino for math, older)fourier(Utopia-based)libertine(Linux Libertine)
- Font encoding: Always load
fontencwith[T1]option before font packages - Input encoding:
inputencwith[utf8]is default in modern LaTeX but explicit for compatibility - Microtype: Load AFTER all font packages for best results (requires pdfTeX ≥ 1.40)
- pdfLaTeX only:
microtype(full features),pdflandscape,pdflscape,pdfpages - XeLaTeX/LuaLaTeX: Use
polyglossiainstead ofbabel,fontspecfor system fonts - LuaLaTeX specific:
lua-ul(better underlining),luacode(Lua integration) - Engine detection: Use
iftex,ifxetex,ifluatex, orifpdffor conditional compilation
- Choose ONE citation system:
- Modern:
biblatex(with biber backend) - Traditional:
natbib(with BibTeX) - Simple:
cite(basic citation compression)
- Modern:
- DO NOT mix
natbibandbiblatex - Load order: Bibliography packages →
hyperref→cleveref
- Choose ONE subfigure package:
- Modern (recommended):
subcaption - Older:
subfig - Ancient (deprecated):
subfigure
- Modern (recommended):
- DO NOT load multiple subfigure packages together
- Modern approach (recommended):
tabularray- replaces most table packages - Traditional approach:
- Basic:
tabularx(dynamic width) ortabulary(auto-sizing) - Multi-page:
longtableorxltabular/ltxtable(combines features) - Never use
tabu- it's deprecated and buggy
- Basic:
- Before
\documentclass:nag(if using\RequirePackage) - Early in preamble:
inputenc,fontenc(encoding)- Font packages
microtypebabelorpolyglossia
- Mid preamble: Most packages (amsmath, graphics, etc.)
- Late in preamble (near end):
hyperref(almost last)bookmark(after hyperref, enhances it)cleveref(MUST be after hyperref)glossaries(after hyperref)
- After
\begin{document}: Some packages likebiblatexneed setup commands
- Load hyperref LATE (but not absolutely last)
- Before hyperref: Most packages, especially those defining floats/counters
- After hyperref:
bookmark,cleveref,glossaries,algorithm(if conflicts occur) - Hyperref options: Pass
[hidelinks]to remove colored boxes,[unicode]for Unicode support
- Draft mode indicators:
ifdraft,prelim2e,draftwatermark,lineno,showlabels - Disable in draft:
microtype(usedraftoption), expensive graphics rendering - Enable in final: Full
microtype, all graphics, removeshowkeys,fixme,todonotes
- Essential order:
amsmath→mathtools(extends amsmath) → other math packages - Theorem packages: Use EITHER
amsthmORntheorem, not both - Bold math: Load
bmafter math fonts for proper bold symbols - Physics:
physicspackage conflicts with some journals - check guidelines
- TikZ libraries: Load after
\usepackage{tikz}via\usetikzlibrary{...} - PGFPlots: Requires TikZ, specify version with
\pgfplotsset{compat=1.18} - External graphics:
graphicxis the modern version (use overgraphics) - Circuit diagrams:
circuitikzis built on TikZ
- Choose ONE:
listings(traditional, works everywhere)minted(modern, requires Python Pygments and-shell-escape)
- With minted: Compile with
pdflatex -shell-escape(security risk - use carefully) - Verbatim:
fancyvrbfor enhanced features,upquotefor straight quotes in code
- Linting workflow:
nagbefore\documentclass- catches deprecated commandsrefcheckduring writing - finds unused labelsshowlabelsduring review - see all labels in marginsfixme/todonotes- track needed changeschktex(external tool) - comprehensive linting
- Version tracking:
snapshotauto-creates.depfile with all package versions
- Modern:
algorithmicx+algpseudocode(flexible) - Alternative:
algorithm2e(different syntax, more features) - Float environment:
algorithmprovides the float wrapper - Old style:
algorithmic(legacy, use algorithmicx instead)
- Use
xcolor(extended features) rather than basiccolor - Load early if using
tableoption:\usepackage[table,dvipsnames]{xcolor} - For colored tables: Load before
colortbl
- Margin notes: Use
marginnote(modern) over\marginpar(basic) - Line spacing:
setspacefor document-wide,leadingfor fine control - Page breaks:
needspaceensures minimum space,afterpagedelays commands
- Use
csquoteswith\enquote{}for proper quotation marks in any language - Babel integration:
csquotesauto-adjusts to babel language - Avoid: Manual `` and '' - not language-aware
- Modern:
siunitx(comprehensive SI units and number formatting) - Older alternatives:
units(deprecated),SIunits(obsolete) - Number formatting:
numprintfor separators without full siunitx
- Phonetics:
tipa(IPA symbols) requires T3 encoding - Glosses: Choose ONE -
gb4e,linguex, orexpex - Trees:
forest(modern, powerful) ortikz-qtree(simple)
- Version control:
comment,version,versions,optional - Build modes:
ifdraft,ifpdf(PDF vs DVI) - Engine detection:
ifxetex,ifluatex,iftex
- Archival PDFs:
pdfxfor PDF/A or PDF/X compliance (strict requirements) - Metadata:
hyperxmpfor XMP metadata,pdfprivacyto remove metadata - Layers:
ocgx2for optional content groups (interactive PDFs) - Attachments:
attachfile2(modern) overattachfile(older)
- Modern comprehensive:
tcolorbox(highly customizable, can break pages) - Simple frames:
framedormdframed(page-breaking frames) - Fixed boxes:
fancybox,dashbox(simple, don't break pages) - Environments:
environhelps create custom environments using any box package
- Modern:
xstring(most powerful) - Alternatives:
stringstrings,substr(simpler operations) - Data handling:
datatoolfor CSV and database-like operations
- Best:
pgffor(part of TikZ, very flexible) - Alternatives:
forloop(simple),multido(repetition) - In math: Use LaTeX3's
expl3for advanced programming
- Basic:
\ref,\pageref - Smart:
varioref(page-aware),cleveref(type-aware) - External:
xrfor cross-document references,xr-hyperwith hyperref - Extended:
zreffor custom reference properties
- Index:
imakeidx(modern, multiple indices) overmakeidx(basic) - Glossary:
glossaries-extra(modern) overglossaries(older) - Acronyms: Both glossaries packages handle acronyms
- Nomenclature:
nomenclfor symbol lists
- Multi-author:
authblkfor author/affiliation formatting - Metadata access:
authoraftertitleto reuse title/author after\maketitle - Change tracking:
changespackage for collaborative editing - Version control:
gitinfo2(Git),vc(general VCS)
- Python:
pythontex(full execution) orpythonhighlight(syntax only) - Gnuplot:
gnuplottexrequires-shell-escape - Sage:
sagetexrequires Sage installation and-shell-escape - Security: All
-shell-escapepackages pose security risks - use carefully
- Include files:
import(better paths) over basic\input - File info:
currfilefor current filename - Write files:
filecontents(single file) ornewfile(multiple streams) - Read files:
catchfileto capture file contents into macro
babelvspolyglossia: Use babel for pdfLaTeX, polyglossia for XeLaTeX/LuaLaTeXinputencwith XeLaTeX/LuaLaTeX: Not needed, causes errors (these engines are UTF-8 native)timesvsmathptmx: Use mathptmx (includes math support)algorithm+hyperref: Load algorithm before hyperref or use\usepackage[algo2e]{algorithm2e}
- Slow compilation:
microtype,minted, TikZ externalization,sagetex,pythontex - Speed up: Use draft mode, externalize TikZ pictures, cache minted output
- Large documents: Use
\includeonlyfor partial compilation, considerstandalonefor figures
- Journal submissions: Many journals ban certain packages (physics, minted, etc.) - check guidelines
- arXiv: Supports most packages but no
-shell-escape(minted, pythontex won't work) - Overleaf: Full TeX Live, supports most packages, minted works (shell-escape enabled)
- MiKTeX vs TeX Live: Feature parity, but package names may differ slightly
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc} % Optional in modern LaTeX
\usepackage{lmodern} % Better fonts
\usepackage{microtype} % Better typography
\usepackage{amsmath,amssymb} % Math
\usepackage{graphicx} % Graphics
\usepackage{booktabs} % Tables
\usepackage{hyperref} % Hyperlinks (late)
\usepackage[noabbrev]{cleveref} % Smart references (after hyperref)- Package conflicts: Load packages one at a time to identify conflicts
- Load order errors: Check
.logfile for "Option clash" or "Command already defined" - Missing packages: Use TeX Live/MiKTeX package manager, not manual installation
- Version issues:
\listfilesbefore\begin{document}lists all package versions in log