Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

Adobe InDesign lets me insert a wide variety of spaces:

  • over half a dozen spaces that allow for a line break (let's assume for the purpose of this question that they disappear in case of a line break, though the case that they don't is interesting in its own right); their lengths: 1em, 1/2 em, 1/3 em, 1/4 em, 1/6 em, 1/8em, 1/24 em, width of a number, width of ! and . and :
  • a non-breaking space (same flexible width as a space character) [I think this corresponds to ~ in TeX]
  • a non-breaking, fixed-width space [see Fixed-width interword space]

How can I produce such spaces with LaTeX? I am looking for the following spaces:

  • a potentially line-breaking space of a fixed, specified width (e.g. 0.5em)
    • useful for something like "post--World␣War II" ["--" should be an en-dash; note that the hyphen/en-dash distinction doesn't quite render as desired on this forum]
    • Another usage scenario is this: Sometimes I write legends (somewhat similar to footnotes that can align on the same line), with symbols followed by text (SYMBOL text text text text text). Usually each new legend item should be spaced apart from the surrounding ones by a wide and fixed space, but there can alternatively be a line break. The entire text will normally be in a raggedright context. In a scenario with justified text, a flexible space (which would belong into the next large bullet point) would be appropriate.
  • a potentially line-breaking space of variable width, specified in relative terms (e.g. 1.5 times the width of an ordinary space)
    • useful for occasional double sentence spacing in text that is otherwise set with \frenchspacing [I'm not sure about the line-breaking behavior of hacks such as ␣{}␣ in all cases; in any case this would give me only integer multiples of ]
  • a non-breaking space of a fixed, specified width (e.g. 0.5em)
    • necessary for spaces that are used as group separators within numbers
    • useful for something like "post--World War␣II" ["--" should be an en-dash; note that the hyphen/en-dash distinction doesn't quite render as desired on this forum]
    • In the "legend" scenario described under the first large bullet point above, the symbol and the following text should be separated by a fixed, non-breaking space. In a scenario with justified text, a flexible (but still non-breaking) space (which would belong into the next/last large bullet point) might be justified.
    • \kern<width> is used in the definition of \LaTeXe in dtklogos
    • similar to InDesign's "Nonbreaking Space (Fixed Width)"
  • a non-breaking space of variable width, specified in relative terms (e.g. 1.5 times the width of an ordinary space)
    • for use in something like "E.␣T.␣A. Hoffmann", though I haven't given thought to the optimal width here; note that certain German abbreviations like "u.␣Ä." ("und Ähnliches") require a shorter space according to some authorities
    • similar to InDesign's "Nonbreaking Space"
    • a real-number generalization of the sequence ~, ~~, ~~~, ... (is that right?)

This question is a wide generalization and a follow-up to "Fixed-width interword space". Also relevant and potentially useful: "Lengths and when to use them".

Some of this is proof of concept, to see what is possible. Knowing whether and how (La)TeX can do the above things that InDesign can do, and more (if this is the case here), is good. Some of the above usage scenarios are quite useful, others are more hypothetical. This question will also serve to document and catalogue the options the user has. Knowing how to code spaces without overuse of \mboxes and modification of general spacing parameters (see my question about fixed-width interword spaces) might come in handy.

share|improve this question
2  
You can insert an arbitrary space that allow for a line break using \hskip <dimen> where <dimen> is any valid TeX dimension. For spaces that do not break across lines using \kern <dimen>. –  Aditya Mar 31 '13 at 6:07
    
@Aditya Here some more thoughts from my side, even though I am assuming you know this already :-) For widths in terms of the default spacing, using something with <number>\fontdimen2 should work. For absolutely absolute (i.e. font-independent) spacing, using an absolute dimension should work. But what about spacing that I want uniformly stretched along with the other spaces in the line? (E.g. a space that's always 0.8 times the size of the other spaces in the same line. This is what I mean by "variable" spacing.) User "egreg"'s trick to use \makebox[\textwidth][s]{...} visualizes this. –  Lover of Structure Mar 31 '13 at 6:52
add comment

1 Answer 1

Maybe this info helps: Lengths and when to use them. You can use different units of measure in the <skip>, for example: pt, ex, em, in, mm or cm among others. It is also valid to use only the <natural width>, for example \hspace{1in}.

share|improve this answer
    
Welcome to TeX.SE! –  Lover of Structure Mar 31 '13 at 6:56
    
I did include your link in my original question statement. In any case, thanks and I hope you'll stay as a member! –  Lover of Structure Mar 31 '13 at 6:58
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.