7
$\begingroup$

Short of writing a highly specific function for particular text strings, is there a simple way to format text, as say in a bibliographic record, to produce a hanging indent (first line of full with, second and subsequent lines indented) as in a style option?

I find nothing via an online search or within the Mathematica documentation concerning hanging indentation.

$\endgroup$

2 Answers 2

9
$\begingroup$

You can use TextCell with the option ParagraphIndent

TextCell[StringTake[ExampleData[{"Text", "DeclarationOfIndependence"}], 900], "Text", 
 ParagraphIndent -> -40]

enter image description here

or Style with the option LineIndent:

Style[StringTake[ExampleData[{"Text", "DeclarationOfIndependence"}], 900], "Text", LineIndent->2]

enter image description here

$\endgroup$
1
$\begingroup$

You can mark any cell you like, invoke OptionInspector for it and go to FormattingOptions>TextLayoutOptions. There you find ParagraphIndent and TabSpacings.

E.g. ParagraphIndent -120 and TabSpacings {7.65} leaves enough space before the hanging paragraph e.g. for an outdented ISO date (i.e. YYYY-MM-DD) - but only if you display with 100%. If you display it with 125%, the tab no longer aligns with the ParagraphIndent. The reason seems to be that ParagraphIndent is defined in printer's points. TabSpacings is in "ems", a strage unit apparently related to the width of a capital M, which of course grows larger if the display maginification is increased.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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