Tag
Macros
- How to Insert Red XXX Placeholders with a LaTeX CommandDefine a reusable LaTeX command with xcolor to insert one or more red XXX placeholders, then use the command wherever needed.
- How to Define a LaTeX Command for a Ket-BraDefine a reusable LaTeX ket-bra command for the Dirac outer product, with a minimal compilable example, spacing guidance, and a scalable-delimiter variant.
- How Can You Define a LaTeX Command with a Variable Number of Arguments?LaTeX \newcommand takes a fixed number of arguments; represent variable-length input as a list or parse repeated groups with a clear terminator.
- How to Show or Hide Optional Text in LaTeXUse a LaTeX Boolean switch to show or hide optional text, set its default state, and change the setting temporarily in a group.
- How to Wrap an enumitem List in a LaTeX MacroDefine a reusable enumerate environment with enumitem options by forwarding an optional argument and, if useful, setting a default label.
- How to Add a Short Abstract After a LaTeX Part HeadingDefine a LaTeX command that prints a part heading followed by a short, consistently formatted abstract, with a complete example you can compile.
- How to Change the Margins in a LaTeX EnvironmentUse the changepage package’s adjustwidth environment inside newenvironment to inset text locally, or use geometry to change page margins globally.
- How Are LaTeX Class Files and Style Files Structured?A LaTeX class file defines a document type, while a style file adds features. Learn the standard declarations, loading commands, and a working example.
- How to Change Line Spacing in a Shortstack-Like BoxUse a one-column tabular box instead of \shortstack, then adjust its row spacing with a local \arraystretch value or a row-specific gap.
- Fix an Extra `}` Error When Using a Custom Command in `\ul`Register your custom macro with soul using its number of mandatory arguments; this lets \ul parse the command and its argument correctly.
- How to Add a Border or Frame Around a Box in LaTeXUse \fbox for a simple LaTeX border, or frame a minipage for paragraphs; control padding and line thickness with \fboxsep and \fboxrule.