<s>
Pretty-printing	B-Application
(	O
or	O
prettyprinting	B-Application
)	O
is	O
the	O
application	O
of	O
any	O
of	O
various	O
stylistic	O
formatting	O
conventions	O
to	O
text	B-General_Concept
files	I-General_Concept
,	O
such	O
as	O
source	O
code	O
,	O
markup	O
,	O
and	O
similar	O
kinds	O
of	O
content	O
.	O
</s>
<s>
Pretty-printers	B-Application
for	O
source	O
code	O
are	O
sometimes	O
called	O
code	O
formatters	O
or	O
beautifiers	O
.	O
</s>
<s>
Pretty-printing	B-Application
usually	O
refers	O
to	O
displaying	O
mathematical	O
expressions	O
similar	O
to	O
the	O
way	O
they	O
would	O
be	O
typeset	B-Application
professionally	O
.	O
</s>
<s>
For	O
example	O
,	O
in	O
computer	B-General_Concept
algebra	I-General_Concept
systems	I-General_Concept
such	O
as	O
Maxima	B-Language
or	O
Mathematica	B-Language
the	O
system	O
may	O
write	O
output	O
like	O
"	O
x	O
^	O
2	O
+	O
3	O
*	O
x	O
"	O
as	O
Some	O
graphing	B-Application
calculators	I-Application
,	O
such	O
as	O
the	O
Casio	B-Device
9860	I-Device
series	I-Device
,	O
HP-49	B-Device
series	I-Device
,	O
TI-84	B-Device
Plus	I-Device
,	O
TI-89	B-Device
,	O
and	O
TI-Nspire	B-Device
,	O
the	O
TI-83	B-Device
Plus	I-Device
with	O
the	O
PrettyPt	O
add-on	O
,	O
or	O
the	O
TI-84	B-Device
Plus	I-Device
with	O
the	O
same	O
add-on	O
or	O
the	O
"	O
MathPrint	O
"	O
-enabled	O
OSes	O
,	O
can	O
perform	O
pretty-printing	B-Application
.	O
</s>
<s>
Additionally	O
,	O
a	O
number	O
of	O
newer	O
scientific	O
calculators	O
are	O
equipped	O
with	O
dot	O
matrix	O
screens	O
capable	O
of	O
pretty-printing	B-Application
such	O
as	O
the	O
Casio	O
FX-ES	O
series	O
(	O
Natural	O
Display	O
)	O
,	O
Sharp	O
EL-W	O
series	O
(	O
WriteView	O
)	O
,	O
HP	O
SmartCalc	O
300s	O
,	O
TI-30XB	O
,	O
and	O
Numworks	B-Device
.	O
</s>
<s>
Many	O
text	O
formatting	O
programs	O
can	O
also	O
typeset	B-Application
mathematics	O
:	O
TeX	B-Application
was	O
developed	O
specifically	O
for	O
high-quality	O
mathematical	O
typesetting	O
.	O
</s>
<s>
Pretty-printing	B-Application
in	O
markup	O
language	O
instances	O
is	O
most	O
typically	O
associated	O
with	O
indentation	O
of	O
tags	O
and	O
string	O
content	O
to	O
visually	O
determine	O
hierarchy	O
and	O
nesting	O
.	O
</s>
<s>
In	O
MathML	B-Language
,	O
whitespace	O
characters	O
do	O
not	O
reflect	O
data	O
,	O
meaning	O
,	O
or	O
syntax	O
above	O
what	O
is	O
required	O
by	O
XML	B-Protocol
syntax	O
.	O
</s>
<s>
In	O
HTML	B-Language
,	O
whitespace	O
characters	O
between	O
tags	O
are	O
considered	O
text	O
and	O
are	O
parsed	O
as	O
text	O
nodes	O
into	O
the	O
parsed	O
result	O
.	O
</s>
<s>
While	O
indentation	O
may	O
be	O
generously	O
applied	O
to	O
a	O
MathML	B-Language
document	O
,	O
sufficient	O
additional	O
care	O
must	O
be	O
taken	O
in	O
pretty-printing	B-Application
an	O
HTML	B-Language
document	O
to	O
ensure	O
additional	O
text	O
nodes	O
are	O
not	O
created	O
or	O
destroyed	O
in	O
general	O
proximity	O
to	O
the	O
content	O
or	O
content-reflective	O
tag	O
elements	O
.	O
</s>
<s>
This	O
difference	O
in	O
complexity	O
is	O
non-trivial	O
from	O
the	O
perspective	O
of	O
an	O
automated	O
pretty-print	B-Application
operation	O
where	O
no	O
special	O
rules	O
or	O
edge	O
cases	O
are	O
necessary	O
,	O
as	O
in	O
the	O
more	O
simple	O
MathML	B-Language
example	O
.	O
</s>
<s>
The	O
HTML	B-Language
example	O
may	O
require	O
a	O
series	O
of	O
progressive	O
interrelated	O
algorithms	O
to	O
account	O
for	O
various	O
patterns	O
of	O
tag	O
elements	O
and	O
content	O
that	O
conforms	O
to	O
a	O
uniform	O
style	O
and	O
is	O
consistent	O
in	O
application	O
across	O
various	O
instances	O
,	O
as	O
evidenced	O
by	O
the	O
markup.ts	O
application	O
component	O
used	O
to	O
beautify	O
HTML	B-Language
,	O
XML	B-Protocol
,	O
and	O
related	O
technologies	O
for	O
the	O
Pretty	B-Application
Diff	I-Application
tool	O
.	O
</s>
<s>
Code	B-Application
beautification	I-Application
involves	O
parsing	O
the	O
source	O
code	O
into	O
component	O
structures	O
,	O
such	O
as	O
assignment	O
statements	O
,	O
if	O
blocks	O
,	O
loops	O
,	O
etc	O
.	O
</s>
<s>
Code	B-Application
beautifiers	I-Application
exist	O
as	O
standalone	O
applications	O
and	O
built	O
into	O
text	B-Application
editors	I-Application
and	O
integrated	B-Application
development	I-Application
environments	I-Application
.	O
</s>
<s>
For	O
example	O
,	O
Emacs	B-Application
 '	O
various	O
language	O
modes	O
can	O
correctly	O
indent	B-Application
blocks	O
of	O
code	O
attractively	O
.	O
</s>
<s>
An	O
early	O
example	O
of	O
pretty-printing	B-Application
was	O
Bill	O
Gosper	O
's	O
"	O
GRINDEF	O
"	O
(	O
i.e.	O
</s>
<s>
'	O
grind	O
function	O
 '	O
)	O
program	O
(	O
c	O
.	O
1967	O
)	O
,	O
which	O
used	O
combinatorial	O
search	O
with	O
pruning	O
to	O
format	O
LISP	B-Language
programs	O
.	O
</s>
<s>
Early	O
versions	O
operated	O
on	O
the	O
executable	O
(	O
list	O
structure	O
)	O
form	O
of	O
the	O
Lisp	B-Language
program	O
and	O
were	O
oblivious	O
to	O
the	O
special	O
meanings	O
of	O
various	O
functions	O
.	O
</s>
<s>
The	O
term	O
"	O
grind	O
"	O
was	O
used	O
in	O
some	O
Lisp	B-Language
circles	O
as	O
a	O
synonym	O
for	O
pretty-printing	B-Application
.	O
</s>
<s>
The	O
most	O
typical	O
are	O
the	O
GNU	B-Operating_System
formatting	O
and	O
the	O
BSD	O
style	O
.	O
</s>
<s>
The	O
biggest	O
difference	O
between	O
the	O
two	O
is	O
the	O
location	O
of	O
the	O
braces	O
:	O
in	O
the	O
GNU	B-Operating_System
style	O
,	O
opening	O
and	O
closing	O
braces	O
are	O
on	O
lines	O
by	O
themselves	O
,	O
with	O
the	O
same	O
indent	B-Application
.	O
</s>
<s>
The	O
size	O
of	O
indent	B-Application
and	O
location	O
of	O
whitespace	O
also	O
differs	O
.	O
</s>
<s>
The	O
GNU	B-Application
indent	I-Application
program	I-Application
produces	O
the	O
following	O
output	O
when	O
asked	O
to	O
indent	B-Application
according	O
to	O
the	O
GNU	B-Operating_System
rules	O
:	O
</s>
