What does the symbol Continuation do?

Citing this 1996 year MathGroup post by Dave Wagner,

A similar function, Continuation[n], is called to format the character at the beginning of continued lines. So, for example, the definition

 Format[Continuation[n_]] := StringForm["(``)",n]

would place a line number inside of parentheses on the second and subsequent lines of a multi-line output.

More specifically, this function is called during formatting of multi-line output for the purposes of displaying it within the terminal interface (i.e. when you work interactively with math.exe or WolframKernel.exe) and also when you request the OutputForm format within the notebook interface. Using the example provided by Dave (and working within the notebook interface),

Format[Continuation[n_]] := StringForm["(``)", n]

200! // OutputForm
78865786736479050355236321393218506229513597768\ 
(2) 7173263294742533244359449963403342920304284\ 
(3) 0119846239041772121389196388302576427902426\ 
(4) 3710506192662495282993111346285727076331723\ 
(5) 7396988943922445621451664240254033291864131\ 
(6) 2274282948532775242424075739032403212574055\ 
(7) 7956866022603190417032406235170085879617892\ 
(8) 2222789623703897374720000000000000000000000\ 
(9) 000000000000000000000000000

You may be also interested in the function StringBreak described by Dave in the same post:

There is a function called StringBreak that you can override to do this. (For some reason, this function was documented in version 2 but has been dropped from the documentation in version 3).

StringBreak[n] is called to format the n'th line-breaking character in a multiline output. So you can define

 Format[StringBreak[_]] := ""

to eliminate all the line-breaking characters.

After evaluating

Format[StringBreak[_]] := ""

in a fresh kernel, we get

200! // OutputForm
7886578673647905035523632139321850622951359776871 
  73263294742533244359449963403342920304284011984 
  62390417721213891963883025764279024263710506192 
  66249528299311134628572707633172373969889439224 
  45621451664240254033291864131227428294853277524 
  24240757390324032125740557956866022603190417032 
  40623517008587961789222227896237038973747200000 
  00000000000000000000000000000000000000000000

The same way these functions work in the actual terminal mode:

screenshot

screenshot

These functions aren't called on Export, Write, WriteString etc. even when the OutputForm wrapper is used:

Format[StringBreak[_]] := ""
Format[Continuation[n_]] := StringForm["(``)", n]

str = OpenWrite[];
Write[str, OutputForm[200!]];
Close[str];
FilePrint[%]
78865786736479050355236321393218506229513597768717326329474253324435944996340\
33429203042840119846239041772121389196388302576427902426371050619266249528299\
31113462857270763317237396988943922445621451664240254033291864131227428294853\
27752424240757390324032125740557956866022603190417032406235170085879617892222\
2789623703897374720000000000000000000000000000000000000000000000000

\[Continuation] is also the name of the special character used to indicate that input should be interpreted as continuing in the next line, or to break output too long for the current window. I suspect Continuation[] to be the operator form of that infix symbol.

On second thought, I suspect that the formatting references you found are linked to special situations in which the \[Continuation] symbol is best / most safely formatted as a space.

In my installation (MMA 10.4.0 on Win7-64), the definitions associated with Continuation are found in the following files:

$InstallationDirectory <> "\\SystemFiles\\FrontEnd\\TextResources\\FEKernelInit.tr"
$InstallationDirectory <> "\\SystemFiles\\Links\\JLink\\Source\\Java\\com\\wolfram\\jlink\\ui\\MathSessionPane.java"

The first file seems related to front-end initialization and contains:

Format[Continuation[_]] := " ";

whereas the second file contains:

Format[Continuation[_], OutputForm] = \"\" ;

The second file is more heavily commented by its author (Todd Gayley from Wolfram); the line above appears in a J/Link function dealing with the generation / management of window interfaces (as far as I can tell). One of the properties of these windows seems to be the fact that Continuation[] is to be formatted as the string "\" in OutputForm. This is, of course, also commonly done by the front end when copying lines that are too long for the set page width.


After a quick Google search I came across this, which provides a description.

enter image description here

Translation:


Continuation[n]

is the result at the beginning of the nth line in a multiline printed Expression. The default value of Continuation is either the string " " or the string ">". The value of Continuation is can be changed with the command Format[Continuation[n_]]:=expr. The Symbol LineBreak will be printed between continuing lines, Indent spezifies the used indent, if a line begins with a subexpression, StringBreak is a Symbol that will be used if a string is splitted in output lines, StringSkeleton and Skeleton will be used for Short or Shallow Output forms.

see also: Format, Indent, LineBreak, Skeleton, StringBreak, StringSkeleton.


In other words, Continuation along with some other symbols control text formatting in mathematica. Some of the symbols like Skeleton or StringSkeleton are aparrently documented. The book associates Continuation with "manual formatting", a category which includes the following:

enter image description here