Options (21)
CachePersistence (3)
With CachePersistence→None, ReadableForm will not use any caching, which reduces overall memory usage but is the slowest method:
With the default behavior of CachePersistence→Automatic, ReadableForm will remember some values between evaluations to gain a modest performance boost:
Using CachePersistence→Full will give the fastest performance, but the extra memory used is not released for the remainder of the kernel session:
DynamicAlignment (4)
ReadableForm can adjust indentation of certain parts of code in order to obtain alignment across lines when using a monospace font. Here is a helper function to display monospaced results:
By default, ReadableForm will only indent one step at a time:
Use the setting "DynamicAlignment"→True to perform additional alignment heuristics:
Align associations:
FormatHeads (3)
By default, some expressions are formatted in StandardForm in order to enhance readability:
Use "FormatHeads" to control which expressions are formatted in StandardForm:
Use Automatic to include the defaults:
IndentSize (1)
Change the size of indentation in the output:
InitialIndent (1)
Specify an amount of additional indentation to apply to every line:
PageWidth (1)
Set a desired page width to control line breaks:
PerformanceGoal (2)
By default, ReadableForm will traverse expressions as deeply as possible to apply formatting:
With PerformanceGoal→"Speed", ReadableForm traverses only deeply enough to format lines and uses InputForm to handle the rest:
PrefixForm (2)
By default, ReadableForm will use Prefix formatting (f@expr) for some expressions:
Disable Prefix formatting:
RealAccuracy (2)
By default, ReadableForm displays real numbers with all available digits:
Specify a maximum number of digits to display:
RelativeWidth (2)
By default, measuring "PageWidth" per line includes the leading whitespace:
Set "RelativeWidth" to True if you don't want to count the leading whitespace:
Applications (12)
Copy Formatted Expressions (1)
Copy expressions to the clipboard that will be formatted nicely when pasting into email, etc.:
Readable Log Files (1)
Create readable log files with lots of metadata:
Generate Formatted Packages (4)
ReadableForm can be used to convert a FullDefinition into a formatted package notebook. Here's an example from a resource function:
View the default formatting:
Create formatted cells using ReadableForm:
Display in a package notebook:
Create a Formatter Palette (6)
Create a function to format notebook boxes:
Create a button that formats the boxes representing the current selection:
Create another button that formats cells:
Create one more button to format an entire notebook:
Combine into a single palette:
Test on an example notebook: