Rewrapping and Margins

To rewrap means to adjust text so that all lines fit within specified margins. Guiguts does this by moving whole words from line to line. You control the rewrapping operation by setting margins and by marking up the text with markers such as /*..*/, which tell Guiguts how to handle blocks of text.

Default Margins

You set the default margins for rewrapping normal and block-quote text using Prefs>Set Rewrap Margins, which opens this dialog:

You can override the default margins for particular blocks.

Hanging Hyphens

By default, when the rewrap operation finds a hyphen at the end of a line, it joins it to the first word in the next line. This is (usually) correct for English, but not for languages like German, where "hanging hyphens" are common and accepted. Under the Prefs menu look for an option, Leave Space After End-Of-Line Hyphens, which causes rewrap to leave hanging hyphens alone.

Rewrap Markers

The PGDP guidelines specify two type of rewrap markers: /#..#/ for block quotes, and /*..*/ for all other types of text that should not be rewrapped: poetry, tables, and lists. Guiguts supports additional markers:

/*...*/Do not rewrap, but indent a fixed amount
/$...$/Do not rewrap and do not indent
/#...#/Rewrap within the Block Rewrap margins
/P...P/Do not rewrap, do indent as for /*...*/, and generate poetry HTML.
/f...f/Do not rewrap and do not indent, and generate front-matter HTML (centered)
Note:The opening and closing markers (/*, etc.) should stand alone on a line, but these markups must be preceded and followed by blank lines. If the blank lines are missing, Guiguts will fail to recognize either the beginning or the end of the markup and mis-wrapping will result.

Rewrap Commands

You command rewrapping by selecting text and applying the command Selection>Rewrap Selection. Guiguts rewraps the selected text, adjusting unmarked text to the default margins and adjusting marked blocks according to the type of markup.

If you tear off the Selection menu you can select and rewrap quickly. In Windows you can use the menu accelerator alt-s alt-r to rewrap at any time.

Setting Per-block Indents and Margins

You can set a specific indent for a table (/*..*/ markup) by placing an indent value, 0 or a positive integer, in brackets immediately after the opening /*. For example, this text:

/*[6]
  Some
Tabular
  Text
*/
will be changed as follows by the rewrapping operation:
/*[6]
        Some
      Tabular
        Text
*/

You can set a specific left margin, hanging indent, and right margin for a block quote (/#..#/ markup) by putting up to three numbers in brackets after the opening /#. In computerese, the syntax is: left[.first][,right] but for non-geeks, can be spelled out so:

/#[left] Wrap to left margin left, default right margin
/#[left,right] Wrap within margins left and right
/#[left.first]Wrap first line to margin first, remaining lines to left margin left, default right margin
/#[left.first,right] Wrap first line in margins first to right, others in margins left and right
For example, this quote:
/#[4.8,24]
I hope to find you well and expect to arrive Wednesday <i>inst</i>
#/
will rewrap as follows:
/#[4.8,24]
        I hope to find
    you well and expect
    to arrive Wednesday
    <i>inst</i> 
#/
Guiguts leaves the bracketed numbers in place after rewrapping so you can rewrap repeatedly without losing the formatting.

Rewrap operations are not compatible with Undo/Redo. If you rewrap to a wrong margin, select the text and rewrap it again to the correct margin.

Clearing Rewrap Markers

After the book has been rewrapped and you have inspected it throughout to make sure that nothing is indented that shouldn't be, then use Fixup> Clean Up Rewrap Markers. Guiguts deletes all the lines containing rewrap markers. From now on, it is possible to rewrap blocks of plain text but the only way to rewrap blocks of indented text is to add rewrap markers back in, rewrap, and remove the markers.