### LaTeX: Custom Font Configuration for Microtype Source: https://context7.com/schlcht/microtype/llms.txt Provides an example of a microtype configuration file (mt-myfont.cfg) for a custom font. It includes settings for character inheritance, protrusion, and expansion. ```latex % File: mt-myfont.cfg % Configuration for MyCustomFont family \ProvidesFile{mt-myfont.cfg}[2024/01/01 v1.0 microtype config for MyCustomFont] % Character inheritance \DeclareCharacterInheritance { encoding = TU, family = MyCustomFont } { A = {\`A, \'A}, O = {\`O, \'O}, } % Protrusion settings \SetProtrusion { encoding = TU, family = MyCustomFont } { A = {50,50}, T = {70,70}, V = {50,50}, W = {50,50}, . = { ,70}, , = { ,70}, } % Expansion settings (if using selected expansion) \SetExpansion { encoding = TU, family = MyCustomFont } { A = 500, O = 500, I = 1000, L = 1000, } % In your document, the file loads automatically when using the font: % \usepackage{microtype} % \usepackage{fontspec} % \setmainfont{MyCustomFont} ``` -------------------------------- ### Configure Font Expansion with \SetExpansion Source: https://context7.com/schlcht/microtype/llms.txt Define expansion settings for fonts to control glyph stretching/shrinking. Basic settings allow a maximum expansion percentage for characters. Selected expansion allows different amounts per character, with specific considerations for round or thin characters. ```latex \documentclass{article} \usepackage{microtype} % Basic expansion settings \SetExpansion { encoding = T1, family = cmr } { A = 500, % allow 500/1000 = 50% of max expansion I = 1000, % allow full expansion O = 500, % round characters more sensitive W = 600, } % Selected expansion (different amounts per character) \usepackage[expansion,selected]{microtype} \SetExpansion [ name = selected-cmr ] { encoding = T1, family = cmr } { A = 500, B = 700, C = 800, I = 1000, L = 1000, % thin chars can expand more M = 500, O = 400, % round chars expand less W = 600, } \begin{document} Text with custom expansion settings. \end{document} ``` -------------------------------- ### LaTeX: Using the letterspace Package Source: https://context7.com/schlcht/microtype/llms.txt Illustrates the usage of the standalone letterspace package for lightweight letter spacing. It provides commands similar to microtype's \textls. Do not use with microtype. ```latex % Works with plain TeX, eplain, or LaTeX \documentclass{article} \usepackage{letterspace} % Don't use with microtype! % Or with eplain: % \begin{packages} % \usepackage{letterspace} % \end{packages} % Or with miniltx (plain TeX): % \input miniltx % \input letterspace.sty \begin{document} % Same commands as microtype \textls{Letterspaced text} \textls[150]{Custom amount} \textls*{No outer kerning} {\lsstyle Letterspaced block} % Protect ligatures \textls{e\lslig{ff}ects} \end{document} ``` -------------------------------- ### Configure Letterspacing with \SetTracking Source: https://context7.com/schlcht/microtype/llms.txt Set up systematic tracking (letterspacing) for font sets. Basic tracking applies a default spacing to small capitals. Advanced options include controlling ligatures, inner and outer spacing, and outer kerning. Different tracking can be applied based on font size. ```latex \documentclass{article} \usepackage[tracking=true]{microtype} % Basic tracking for small capitals \SetTracking { encoding = *, shape = sc } { 50 } % 50/1000 em = 0.05em spacing % Tracking with advanced options \SetTracking [ no ligatures = {f}, % break f-ligatures (ff, fi, fl, etc.) spacing = {600*,-100*,}, % inner space: 60% more, 10% less stretch outer spacing = {450,250,150}, % space before/after letterspaced text outer kerning = {*,*} ] % default outer kern (half letterspace amount) { encoding = T1, family = cmr } { 120 } % 120/1000 em tracking % Different tracking for different sizes \SetTracking{ encoding = *, size = -small }{ 20 } % small text: slight expansion \SetTracking{ encoding = *, size = Large- }{ -20 } % large text: slight compression % Track all fonts (not recommended, but possible) \DeclareMicrotypeSet*[tracking]{all}{ encoding = * } \SetTracking{ encoding = * }{ 30 } \begin{document} \textsc{Small Caps Are Tracked} Normal text is also tracked if configured. \end{document} ``` -------------------------------- ### LaTeX: Debugging Protrusion with microtype-show Source: https://context7.com/schlcht/microtype/llms.txt Demonstrates how to use the microtype-show package for visual debugging of protrusion settings. Includes options to show missing glyphs, glyph indices, and scale glyphs. ```latex \documentclass{article} \usepackage{microtype} \usepackage{microtype-show} % Show more information \ShowMissingGlyphstrue \ShowGlyphIndextrue \renewcommand{\GlyphScaleFactor}{3} % larger glyphs \begin{document} % Show inheritance settings for current font \ShowCharacterInheritance % Show protrusion settings \ShowProtrusion % Show all glyphs with protrusion at margins \ShowProtrusionAll % Show only glyphs with defined protrusion \ShowProtrusionDefined % Show glyphs without protrusion settings \ShowProtrusionMissing \end{document} ``` -------------------------------- ### Configuration Files Source: https://context7.com/schlcht/microtype/llms.txt Creating custom configuration files for fonts not natively supported by microtype. ```APIDOC ## mt-[fontname].cfg ### Description Define character inheritance, protrusion, and expansion settings for custom fonts. ### Usage - `\DeclareCharacterInheritance`: Define glyph inheritance. - `\SetProtrusion`: Define protrusion values for specific glyphs. - `\SetExpansion`: Define expansion values for specific glyphs. ``` -------------------------------- ### LaTeX: Context-Sensitive Typography with microtype Source: https://context7.com/schlcht/microtype/llms.txt Demonstrates how to apply different typographic settings based on context like language or document section using \microtypecontext. Requires \usepackage[babel=true]{microtype} and \usepackage[french,english]{babel}. ```latex \documentclass{article} \usepackage[babel=true]{microtype} \usepackage[french,english]{babel} % Define protrusion for footnote markers \SetProtrusion [ context = footnote ] { font = */*/*/*/scriptsize } { 1 = { ,650}, 2 = { ,400}, 3 = { ,400} } \begin{document} % Switch context manually \microtypecontext{protrusion=footnote} Footnote-style protrusion active. % Reset context \microtypecontext{protrusion=} % Environment form \begin{microtypecontext}{kerning=french} Texte avec espacement français : comme ça ! \end{microtypecontext} % Inline context change \textmicrotypecontext{kerning=french}{Question ?} % With babel option, context changes automatically with language \selectlanguage{french} L'espacement est automatiquement ajusté ! \selectlanguage{english} Back to English spacing rules. \end{document} ``` -------------------------------- ### Dynamically Change microtype Settings with \microtypesetup Source: https://context7.com/schlcht/microtype/llms.txt Modify micro-typographic settings dynamically within the document using the \microtypesetup command. This allows for temporary adjustments to features like expansion and protrusion, or complete deactivation. ```latex \documentclass{article} \usepackage{microtype} \begin{document} Normal text with protrusion enabled. % Temporarily disable expansion for this section \microtypesetup{expansion=false} This section will not have font expansion applied. % Re-enable expansion \microtypesetup{expansion=true} % Disable all features temporarily \microtypesetup{activate=false} No micro-typography here. % Enable with compatibility mode (preserves line breaks) \microtypesetup{protrusion=compatibility} \end{document} ``` -------------------------------- ### microtype-show Package Source: https://context7.com/schlcht/microtype/llms.txt Visual debugging tools to inspect protrusion and inheritance settings. ```APIDOC ## microtype-show ### Description Companion package for visual debugging of protrusion settings. ### Usage - `\ShowCharacterInheritance`: Display inheritance settings. - `\ShowProtrusion`: Display current protrusion settings. - `\ShowProtrusionAll`: Show all glyphs with protrusion at margins. - `\ShowProtrusionDefined`: Show only glyphs with defined protrusion. - `\ShowProtrusionMissing`: Show glyphs without protrusion settings. ``` -------------------------------- ### Activate Font Sets with \UseMicrotypeSet Source: https://context7.com/schlcht/microtype/llms.txt Activate previously declared font sets for specific micro-typographic features using \UseMicrotypeSet. Predefined sets like 'alltext', 'basictext', 'allmath', and 'all' are available. ```latex \documentclass{article} \usepackage{microtype} % Use predefined font set for protrusion \UseMicrotypeSet[protrusion]{basictext} % Use for all features \UseMicrotypeSet{alltext} % Predefined sets available: % - alltext: all text encodings % - basictext: common text fonts (rm, sf, md series) % - allmath: math fonts % - all: everything \begin{document} Text will use the activated font set. \end{document} ``` -------------------------------- ### Configure microtype Package Options Source: https://context7.com/schlcht/microtype/llms.txt Control which micro-typographic features are enabled using package options. Options include enabling specific features, tracking for small capitals, using specific font sets, kerning and spacing, disabling features, verbose logging, and automatic language adjustments. ```latex % Enable all default features (protrusion + expansion) \usepackage{microtype} ``` ```latex % Enable specific features \usepackage[protrusion=true,expansion=true]{microtype} ``` ```latex % Enable tracking for small capitals \usepackage[tracking=true]{microtype} ``` ```latex % Enable with specific font set \usepackage[protrusion=alltext]{microtype} ``` ```latex % Enable kerning (pdfTeX only) and spacing features \usepackage[kerning=true,spacing=true]{microtype} ``` ```latex % Disable all features temporarily for draft mode \usepackage[disable=ifdraft]{microtype} ``` ```latex % Enable verbose logging for debugging \usepackage[verbose=true]{microtype} ``` ```latex % Enable automatic language-based adjustments with babel \usepackage[babel=true]{microtype} ``` ```latex % Set global expansion limits (stretch/shrink in 1000ths) \usepackage[stretch=20,shrink=20]{microtype} ``` ```latex % Set global letterspace amount (in 1000ths of 1em) \usepackage[letterspace=100]{microtype} ``` -------------------------------- ### \SetTracking - Configure Letterspacing Source: https://context7.com/schlcht/microtype/llms.txt Sets up systematic tracking (letterspacing) for font sets based on encoding, shape, or size. ```APIDOC ## \SetTracking ### Description Set up systematic tracking (letterspacing) for font sets. ### Parameters - **options** (optional) - Advanced settings like no ligatures, spacing, outer spacing, and outer kerning. - **font_selection** (required) - Font criteria (encoding, shape, size). - **tracking_amount** (required) - Tracking value in 1000ths of 1em. ``` -------------------------------- ### \SetExpansion - Configure Font Expansion Source: https://context7.com/schlcht/microtype/llms.txt Defines expansion settings for fonts to control glyph stretching or shrinking for better justification. ```APIDOC ## \SetExpansion ### Description Define expansion settings for fonts to control glyph stretching/shrinking. ### Parameters - **options** (optional) - Configuration settings like name. - **font_selection** (required) - Font criteria (encoding, family). - **expansion_settings** (required) - Expansion values for specific characters. ``` -------------------------------- ### Set Up Character Inheritance with \DeclareCharacterInheritance Source: https://context7.com/schlcht/microtype/llms.txt Define which characters inherit protrusion and expansion settings from base characters. Useful for accented characters or specific font encodings. ```latex \documentclass{article} \usepackage{microtype} % Accented characters inherit from base character \DeclareCharacterInheritance { encoding = T1 } { A = {`A,\'A,\^A,\~A,\"A,\r{A},\u{A}}, E = {`E,\'E,\^E,\"E}, I = {`I,\'I,\^I,\"I}, O = {`O,\'O,\^O,\~O,\"O}, U = {`U,\'U,\^U,\"U}, a = {`a,\'a,\^a,\~a,\"a,\r{a}}, e = {`e,\'e,\^e,\"e}, i = {`i,\'i,\^i,\"i}, o = {`o,\'o,\^o,\~o,\"o}, u = {`u,\'u,\^u,\"u}, } % Feature-specific inheritance \DeclareCharacterInheritance [protrusion] { encoding = TU, family = {EB Garamond} } { A = {\`A, \'A, \^A}, } % Width-adjusted inheritance for Greek typography \DeclareCharacterInheritance { encoding = TU } { (l)H = {\textEta}, % left-protrude by width difference (lr)I = {T}, % center by splitting width difference } \begin{document} \"Accented characters will have same protrusion as base characters. \end{document} ``` -------------------------------- ### Define Custom Font Sets with \DeclareMicrotypeSet Source: https://context7.com/schlcht/microtype/llms.txt Create custom sets of fonts for micro-typographic treatment based on NFSS attributes using \DeclareMicrotypeSet. This allows for fine-grained control over which fonts and features are applied. ```latex \documentclass{article} \usepackage{microtype} % Declare a custom font set for protrusion \DeclareMicrotypeSet{myset} { encoding = {OT1,T1,LY1,TU}, family = {rm*,sf*}, % rm* = \rmdefault, sf* = \sfdefault series = {md*}, % md* = \mddefault (medium weight) size = {normalsize,footnotesize,small,large} } % Declare and activate simultaneously with starred version \DeclareMicrotypeSet*[protrusion]{textonly} { encoding = T1, family = rm*, shape = {n,it,sc} % normal, italic, small caps } % Restrict to specific features \DeclareMicrotypeSet[protrusion,expansion]{basicfonts} { encoding = {T1,TU}, size = {-footnotesize,Large-} % ranges: smaller than footnotesize, larger than Large } \begin{document} Text using the custom font set configuration. \end{document} ``` -------------------------------- ### \DeclareCharacterInheritance - Set Up Character Inheritance Source: https://context7.com/schlcht/microtype/llms.txt Defines which characters inherit protrusion and expansion settings from base characters. ```APIDOC ## \DeclareCharacterInheritance - Set Up Character Inheritance ### Description Define which characters inherit protrusion/expansion settings from base characters. ### Method LaTeX Command ### Endpoint N/A (LaTeX Package Configuration) ### Parameters #### Arguments - **protrusion** (boolean) - Optional - Specifies that inheritance is for protrusion settings. - **encoding** (string) - Required - The character encoding. - **family** (string) - Optional - The font family. ### Request Example ```latex \DeclareCharacterInheritance { encoding = T1 } { A = {`A,\'A,\^A,\~A,\"A,\r{A},\u{A}}, E = {`E,\'E,\^E,\"E}, I = {`I,\'I,\^I,\"I}, O = {`O,\'O,\^O,\~O,\"O}, U = {`U,\'U,\^U,\"U}, a = {`a,\'a,\^a,\~a,\"a,\r{a}}, e = {`e,\'e,\^e,\"e}, i = {`i,\'i,\^i,\"i}, o = {`o,\'o,\^o,\~o,\"o}, u = {`u,\'u,\^u,\"u}, } ``` ### Response N/A (Configuration applied directly in LaTeX document) ### Error Handling N/A (Errors typically reported by LaTeX compiler) ``` -------------------------------- ### Configure Interword Spacing with \SetExtraSpacing Source: https://context7.com/schlcht/microtype/llms.txt Adjust interword glue based on surrounding characters. This is experimental and primarily for pdfTeX. Spacing can be defined relative to font space or character width. ```latex \documentclass{article} \usepackage[spacing=true]{microtype} % Adjust space after punctuation \SetExtraSpacing [ unit = space ] % measure relative to font's space dimensions { font = */*/*/*/* } % all fonts { . = {1000,1000,1000}, % double space after period (space, stretch, shrink) , = {500,500,500}, % 1.5x space after comma ; = {500,300,300}, % more space after semicolon : = {500,300,300}, } % Character-based unit \SetExtraSpacing [ unit = character ] { encoding = T1 } { r = {-50,,}, % slightly less space after 'r' m = {50,,}, % slightly more space after 'm' } \begin{document} Text with adjusted interword spacing based on ending characters. \end{document} ``` -------------------------------- ### Load microtype Package with Default Settings Source: https://context7.com/schlcht/microtype/llms.txt Load the microtype package in your document preamble to enable default micro-typographic features such as character protrusion and font expansion. ```latex \documentclass{article} \usepackage{microtype} \begin{document} This text will automatically benefit from character protrusion and font expansion, resulting in improved margin appearance and more uniform text color. \end{document} ``` -------------------------------- ### Create Font Aliases with \DeclareMicrotypeAlias Source: https://context7.com/schlcht/microtype/llms.txt Map one font family to another's settings to reuse existing configurations. Useful for custom or less common fonts. ```latex \documentclass{article} \usepackage{microtype} % Latin Modern uses Computer Modern settings \DeclareMicrotypeAlias{lmr}{cmr} % TeX Gyre Pagella uses Palatino settings \DeclareMicrotypeAlias{qpl}{ppl} % TeX Gyre Termes uses Times settings \DeclareMicrotypeAlias{qtm}{ptm} % For OpenType fonts with limited glyph sets, use basic settings \DeclareMicrotypeAlias{MyCustomFont}{TU-basic} % For symbol fonts, use empty settings (no protrusion) \DeclareMicrotypeAlias{MySymbolFont}{TU-empty} \begin{document} Fonts will use aliased configuration files. \end{document} ``` -------------------------------- ### \DeclareMicrotypeAlias - Create Font Aliases Source: https://context7.com/schlcht/microtype/llms.txt Maps one font family to another's settings, allowing reuse of existing configurations. ```APIDOC ## \DeclareMicrotypeAlias - Create Font Aliases ### Description Map one font family to another's settings. ### Method LaTeX Command ### Endpoint N/A (LaTeX Package Configuration) ### Parameters #### Arguments - **alias_name** (string) - Required - The name of the new alias. - **target_name** (string) - Required - The name of the font family to alias to. ### Request Example ```latex \DeclareMicrotypeAlias{lmr}{cmr} ``` ### Response N/A (Configuration applied directly in LaTeX document) ### Error Handling N/A (Errors typically reported by LaTeX compiler) ``` -------------------------------- ### \SetExtraSpacing - Configure Interword Spacing Source: https://context7.com/schlcht/microtype/llms.txt Adjusts interword glue based on surrounding characters. This is an experimental feature for pdfTeX. ```APIDOC ## \SetExtraSpacing - Configure Interword Spacing ### Description Adjust interword glue based on surrounding characters (pdfTeX only, experimental). ### Method LaTeX Command ### Endpoint N/A (LaTeX Package Configuration) ### Parameters #### Arguments - **unit** (string) - Required - The unit of measurement for spacing (e.g., 'space', 'character'). - **font** (string) - Optional - Specifies the font(s) to which this spacing applies. - **encoding** (string) - Optional - The character encoding. ### Request Example ```latex \SetExtraSpacing [ unit = space ] % measure relative to font's space dimensions { font = */*/*/*/* } % all fonts { . = {1000,1000,1000}, % double space after period (space, stretch, shrink) , = {500,500,500}, % 1.5x space after comma ; = {500,300,300}, % more space after semicolon : = {500,300,300}, } ``` ### Response N/A (Configuration applied directly in LaTeX document) ### Error Handling N/A (Errors typically reported by LaTeX compiler) ``` -------------------------------- ### Letterspace Package Source: https://context7.com/schlcht/microtype/llms.txt Standalone package for letterspacing when full microtype features are not required. ```APIDOC ## letterspace Package ### Description Provides lightweight letterspacing commands. Do not use simultaneously with the microtype package. ### Usage - `\textls[amount]{text}`: Apply letterspacing to text. - `\textls*{text}`: Apply letterspacing without outer kerning. - `\lsstyle`: Enable letterspacing for a block. - `\lslig{ligature}`: Protect ligatures during letterspacing. ``` -------------------------------- ### Configure Additional Kerning with \SetExtraKerning Source: https://context7.com/schlcht/microtype/llms.txt Add character-specific kerning independent of font's built-in pair kerning. Supports custom units like space or character width. ```latex \documentclass{article} \usepackage[kerning=true]{microtype} % French-style kerning (space before punctuation) \SetExtraKerning [ name = french-default, context = french, unit = space ] % measure in terms of space width { encoding = {OT1,T1,LY1} } { : = {1000, }, % full space before colon ; = {500, }, % thin space before semicolon ! = {500, }, % thin space before exclamation ? = {500, }, % thin space before question mark } % Custom kerning with em-based units \SetExtraKerning [ unit = character ] % measure in 1000ths of character width { encoding = T1, family = cmr } { _ = {100,100}, % space around underscores } \begin{document} % Activate French kerning context \begin{microtypecontext}{kerning=french} Voici du texte en francais : avec des espaces ! \end{microtypecontext} \end{document} ``` -------------------------------- ### Configure Character Protrusion with \SetProtrusion Source: https://context7.com/schlcht/microtype/llms.txt Define protrusion amounts for individual characters in specific fonts. Basic settings specify protrusion for characters like 'A', 'V', 'W', and punctuation. Advanced options allow naming, inheriting, and scaling settings. Context-sensitive protrusion can be applied to specific document elements like footnotes. ```latex \documentclass{article} \usepackage{microtype} % Basic protrusion settings for a font family \SetProtrusion { encoding = T1, family = ppl } % Palatino { A = {50,50}, % protrude 50/1000 of char width on each side V = {50,50}, W = {50,50}, . = { ,70}, % protrude right side only , = { ,70}, : = { ,50}, ; = { ,30}, ! = { ,100}, ? = { ,100}, - = {,50}, % hyphen {-} = {,30}, % en-dash (use braces for special chars) {--} = {,20} % em-dash } % With options \SetProtrusion [ name = my-palatino, % name for later reference load = ppl-default, % inherit from existing settings factor = 900 ] % scale all values to 90% { encoding = T1, family = ppl } { T = {70, } } % override T protrusion % Context-sensitive protrusion \SetProtrusion [ context = footnote ] { font = */*/*/*/scriptsize } { 1 = { ,650}, 2 = { ,400}, 3 = { ,400} } \begin{document} Text with custom protrusion settings. \end{document} ``` -------------------------------- ### Context-Sensitive Typography Source: https://context7.com/schlcht/microtype/llms.txt Commands to apply different typographic settings based on document context, such as language or specific sections. ```APIDOC ## \microtypecontext ### Description Apply different microtype settings based on context (language, document section, etc.). ### Usage - `\microtypecontext{key=value}`: Switch context manually. - `\begin{microtypecontext}{key=value} ... \end{microtypecontext}`: Environment form for context changes. - `\textmicrotypecontext{key=value}{text}`: Inline context change. ### Request Example \microtypecontext{protrusion=footnote} \begin{microtypecontext}{kerning=french} Texte avec espacement français : comme ça ! \end{microtypecontext} ``` -------------------------------- ### LaTeX: Manual Protrusion with \leftprotrusion and \rightprotrusion Source: https://context7.com/schlcht/microtype/llms.txt Shows how to manually add protrusion at inner margins for elements like table cells or quoted text using \leftprotrusion and \rightprotrusion. Includes \noprotrusion and \noprotrusionifhmode for disabling protrusion. ```latex \documentclass{article} \usepackage{microtype} \usepackage{array} \begin{document} % In table cells \begin{tabular}{l>{\leftprotrusion}p{8cm}r} Left & \leftprotrusion A paragraph cell where the first character is protruded & Right \\ \end{tabular} % Protrusion for specific text \leftprotrusion{``Quoted text''} starts with proper margin alignment. % Right protrusion (text must be in argument) \rightprotrusion{Text ending with punctuation.} % Prevent protrusion \noprotrusion This line will not protrude. % Prevent protrusion only if in horizontal mode \noprotrusionifhmode Some text. \end{document} ``` -------------------------------- ### \SetExtraKerning - Configure Additional Kerning Source: https://context7.com/schlcht/microtype/llms.txt Allows adding character-specific kerning independent of the font's built-in pair kerning. This feature is available for pdfTeX. ```APIDOC ## \SetExtraKerning - Configure Additional Kerning ### Description Add character-specific kerning independent of font's built-in pair kerning (pdfTeX only). ### Method LaTeX Command ### Endpoint N/A (LaTeX Package Configuration) ### Parameters #### Arguments - **name** (string) - Optional - A name for the kerning configuration. - **context** (string) - Optional - A context in which this kerning applies. - **unit** (string) - Required - The unit of measurement for kerning (e.g., 'space', 'character'). - **encoding** (list of strings) - Required - The character encodings to which this applies. - **family** (string) - Optional - The font family to which this applies. ### Request Example ```latex \SetExtraKerning [ name = french-default, context = french, unit = space ] % measure in terms of space width { encoding = {OT1,T1,LY1} } { : = {1000, }, % full space before colon ; = {500, }, % thin space before semicolon ! = {500, }, % thin space before exclamation ? = {500, }, % thin space before question mark } ``` ### Response N/A (Configuration applied directly in LaTeX document) ### Error Handling N/A (Errors typically reported by LaTeX compiler) ``` -------------------------------- ### \SetProtrusion - Configure Character Protrusion Source: https://context7.com/schlcht/microtype/llms.txt Defines protrusion amounts for individual characters in specific fonts to improve margin alignment. ```APIDOC ## \SetProtrusion ### Description Define protrusion amounts for individual characters in specific fonts. ### Parameters - **options** (optional) - Key-value pairs for configuration (e.g., name, load, factor, context). - **font_selection** (required) - Font criteria (encoding, family, etc.). - **protrusion_settings** (required) - Character-specific protrusion values in 1000ths of character width. ``` -------------------------------- ### \textls and \lsstyle - Ad-hoc Letterspacing Source: https://context7.com/schlcht/microtype/llms.txt Applies letterspacing to specific text passages or groups regardless of global font configuration. ```APIDOC ## \textls and \lsstyle ### Description Apply letterspacing to specific text passages. ### Parameters - **amount** (optional) - Tracking amount in 1000ths of 1em. - **text** (required) - The text to be letterspaced. ``` -------------------------------- ### Ad-hoc Letterspacing with \textls and \lsstyle Source: https://context7.com/schlcht/microtype/llms.txt Apply letterspacing to specific text passages regardless of font configuration. \textls applies letterspacing with a default or custom amount, and its starred version prevents outer kerning. \lsstyle enables letterspacing for a group of text. Ligatures can be protected during letterspacing. ```latex \documentclass{article} \usepackage{microtype} \begin{document} % Basic letterspacing with default amount \textls{LETTERSPACED TEXT} % Custom letterspace amount (1000ths of 1em) \textls[200]{More widely spaced} \textls[-50]{Slightly compressed} % No outer kerning (starred version) - useful for titles \textls*{SECTION TITLE} % Switch on letterspacing for rest of group {\lsstyle This entire text is letterspaced until the group ends.} % Combine with other formatting \textls{\textsc{Letterspaced Small Caps}} % In section titles (no outer kern preferred) \section{\textls*{INTRODUCTION}} % Protect specific ligatures while letterspacing \textls{e\lslig{ff}ects} % keeps ff ligature intact \end{document} ``` -------------------------------- ### Manual Protrusion Source: https://context7.com/schlcht/microtype/llms.txt Commands to manually control character protrusion at inner margins for tables, lists, or specific text blocks. ```APIDOC ## \leftprotrusion and \rightprotrusion ### Description Add or prevent protrusion at inner margins for specific elements. ### Usage - `\leftprotrusion{text}`: Protrude text at the left margin. - `\rightprotrusion{text}`: Protrude text at the right margin. - `\noprotrusion`: Disable protrusion for the current line. - `\noprotrusionifhmode`: Disable protrusion only if in horizontal mode. ``` -------------------------------- ### \DisableLigatures - Control Ligatures Source: https://context7.com/schlcht/microtype/llms.txt Allows disabling ligatures for specific fonts or characters. ```APIDOC ## \DisableLigatures - Control Ligatures ### Description Disable ligatures for specific fonts or characters. ### Method LaTeX Command ### Endpoint N/A (LaTeX Package Configuration) ### Parameters #### Arguments - **ligatures** (list of strings) - Optional - Specific ligatures to disable (e.g., '?', '!'). - **encoding** (string) - Required - The character encoding. - **family** (string) - Optional - The font family. ### Request Example ```latex \DisableLigatures{encoding = T1, family = tt*} ``` ### Response N/A (Configuration applied directly in LaTeX document) ### Error Handling N/A (Errors typically reported by LaTeX compiler) ``` -------------------------------- ### Control Ligatures with \DisableLigatures Source: https://context7.com/schlcht/microtype/llms.txt Disable ligatures for specific fonts, encodings, or individual characters. Useful for preventing unwanted ligature formation. ```latex \documentclass{article} \usepackage{microtype} % Disable all ligatures for typewriter font \DisableLigatures{encoding = T1, family = tt*} % Disable specific ligatures only \DisableLigatures[?,!]{encoding = T1} % disable ?` and !` only % Disable f-ligatures for roman font \DisableLigatures[f]{encoding = T1, family = rm*} \begin{document} \texttt{--} prints as two dashes, not en-dash. Normal text still has fi ligatures. With [f] disabled: fi prints as f followed by i. \end{document} ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.