Command/hspace

From Wiki
Jump to navigation Jump to search


\hspace

Summary

The command \hspace inserts horizontal space

Settings

\hspace[...][...]
[...]name
[...]small medium big normal default none .5 1 2 3 speech quote interquotation quotation sentence intersentence final name

OptionExplanation
small .25em
medium .5em
big 1em
normal spaceamount
default spaceamount
.5 .1250em (aka \hairspace)
1 .1667em (aka \thinspace)
2 .2222em (aka \medspace)
3 .2777em (aka \thickspace)
speech a language-specific amount, taken from the "quotation" language parameter
quote a language-specific amount, taken from the "quotation" language parameter
interquotation .125em
quotation 0pt
sentence 0pt
intersentence .25em

Description

Insert a named amount of horizontal space. A number of dimensions are already predefined; more can be defined with \definehspace.

Examples

Example 1

  • \definehspace[oneem][1 em]
    \definehspace[twoem][2 em]
    
    asdf\hspace[oneem]asdf\crlf
    asdf\hspace[twoem]asdf
    

Example 2

  • 
    asdf\hspace[speech]: more text
    
    \language[fr]
    
    asdf\hspace[speech]: more text
    
    

Notes

  • By FMichel on 2024-09-21T13:49:39+0200:

\hspace is ignored at the start of a paragraph of after an explicit newline. The proper way to add horizontal space at the start of a paragraph is Indentation (see also Indent). A quick workaround to have space aftter a newline is to add a hidden symbol using the \hphantom, \vphantom, or \phantom command. (The following example works with ConTeXt LMTX 024.08.16, although apparently not on ConTeXt Garden:)

  • Spaces after newlines: \\
    \hspace[big] No space here \\
    \vphantom{m}\hspace[big] A ‘big’ space \\
    \phantom{m}\hspace[big] Larger space (length of a m + ‘big’ space) \\
    \hphantom{m}\hspace[big] Larger space (length of a m + ‘big’ space)
    
  • By Garulfoo on 2025-01-05T17:44:52+0100:
Link to update to Text blocks/Typography/Indentation

See also

Help from ConTeXt-Mailinglist/Forum

All issues with: