Macro Language Reference > Macros > Document > tformat
  
tformat
Description
Re-formats the current document. Re-formatting a document using tformat correctly positions footnotes and anchored frames and is more powerful and effective than trf or wdr.
 
Example 50. Reformat the whole document using index and contents control streams
The macro below formats the whole document, using the index and contents control streams ic1 and cc1 respectively:
tformat "ic1","cc1"
 
Example 51. Reformat pages 15 to 30 without using control streams
tformat 15,30
 
Example 52. Reformat with wdb, tpgoto and tformat
The macro below uses the wdb macro to get the number of the current page from the Goto page dialogue box and then uses the current page number as parameters to tformat. This is a more thorough re-formatting than trf alone provides and is most useful when assigned to a keystroke which you can then, for example, use after adding a footnote reference:
(wdb "Current"):(tpgoto):(tformat ^current,^current^)
Syntax
tformat ?:L? ;:L? start page:n? ( end page:n? ( scan fwd:n? ) ) ic stream:t? (  cc stream:t? ( ac stream:t? ) ) repos anchors:n? ( autocopy create:n? ( autocopy purge:n? (freeze create:n? ( freeze purge:n? ) ) ) )
tformat
[no parameter]
Reformat whole document without using control streams.
?
Invoke the re-format dialog box
;
Specify the page to go to after formatting by adding this character before one of the options below. For example, tformat ;1 will reformat the whole document and stay on last page. This can be useful before a freeze because it ensures that the freeze will use the page information generated by the tformat operation and not some subsequent trf which may desynchronize it.
0
Goto first page
1
Goto last page
2
Goto start of document
start page
The first page of the range of pages to be re-formatted. If this parameter is omitted, PTC ALD will re-format from the first page of the document.
end page
The last page of the range of pages to be re-formatted. If this parameter is omitted, PTC ALD will re-format the entire document.
scan fwd
The 'forward scan limit': the number of paragraphs PTC ALD should scan ahead when moving paragraphs to fill the available space in a frame for which Fill mode has been enabled with tfcol and tffill. Forward Scan is unique in that it is the only feature that can change your main text stream during formatting and for this reason it is well protected. The feature is only available through tformat and even then it must be specifically altered from its default value of 0, in effect giving PTC ALD permission to change your text stream as necessary. In the event that re-formatting produces unsatisfactory results or modifies your text in an unacceptable way then selecting Edit > Undo, (or using macrotundo) will restore all changes made; it may then be necessary to perform another format to restore PTC ALD internal structures.
ic stream
Index control stream to be used during re-formatting to generate an index. See tindmk.
cc stream
Table of contents control stream to be used during re-formatting to generate a table of contents. See ttocmk.
ac stream
Anchor control stream to be used during re-formatting to manage the position of anchored frames within the document
repos anchors
0
Do not remove or replace anchored frames during reformat
Ø or 1
Remove frames that have an anchor name from the specified range of pages before formatting begins. Whenever frame references are found, with matching frame names, the appropriate frames will be replaced in the document (possibly using anchor conditions as specified in the ac stream control stream).
 
Any frames which have not been replaced at the end of the format operation will be returned to their original page and position.
autocopy create
0
Do not duplicate master pages
Ø or 1
Duplicate master pages (as 'copied' pages - see tpacopy) as many times as necessary to ensure that the associated text stream is formatted to its end.
autocopy purge
0
Do not remove 'copied' pages within the specified range of pages from the document before formatting begins. This may be useful if manual changes have been made to 'copied' pages which need to be preserved (this is not recommended).
Ø or 1
Remove all 'copied' pages within the specified range of pages which also have an associated master page within that range from the document before formatting begins. This allows the AutoCopy feature to start with a minimum-sized document and increase it to the number of pages necessary. It may sometimes be appropriate to set autocopy purge to 1 and autocopy create to 0 to reduce the document to the minimum number of pages; for example to prepare a template under development for saving.
freeze create
0
Do not insert additional pages
Ø or 1
Insert additional pages as necessary
freeze purge
0
Do not remove previously added pages
Ø or 1
Remove previously added pages before the format
Related Links