aboutsummaryrefslogtreecommitdiffstats
path: root/doc/user/prg_opti
diff options
context:
space:
mode:
authorJeffrey H. Kingston <jeff@it.usyd.edu.au>2010-09-14 20:36:01 +0000
committerJeffrey H. Kingston <jeff@it.usyd.edu.au>2010-09-14 20:36:01 +0000
commit2f4268e5e02216be53cd85816362191373512463 (patch)
tree57165bf2889337044bc3633854e5aa38f7d89e6b /doc/user/prg_opti
parent73d840b9f14b65166b92e6b43f930fd0ef7b8267 (diff)
downloadlout-2f4268e5e02216be53cd85816362191373512463.tar.gz
Lout 3.20.
git-svn-id: http://svn.savannah.nongnu.org/svn/lout/trunk@9 9365b830-b601-4143-9ba8-b4a8e2c3339c
Diffstat (limited to 'doc/user/prg_opti')
-rw-r--r--doc/user/prg_opti101
1 files changed, 101 insertions, 0 deletions
diff --git a/doc/user/prg_opti b/doc/user/prg_opti
new file mode 100644
index 0000000..9eb1818
--- /dev/null
+++ b/doc/user/prg_opti
@@ -0,0 +1,101 @@
+@Section
+ @Title { Changing the appearance of a program }
+ @Tag { prg_opti }
+@Begin
+@PP
+The {@Code "@CP"}, {@Code "@Eiffel"} etc. symbols have a number of
+options for changing the appearance of the printed program. These
+options are the same for all symbols, although their default values
+may vary. The @Code "style" option changes the printing style; its
+value may be {@Code "fixed"} (fixed-width font), {@Code "varying"}
+(varying-width font), or {@Code "symbol"} (varying-width font with
+mathematical symbols used for some operators). Its default value
+depends on the language, and may be found in the fourth column of
+the table at the start of this chapter. The example in the previous
+section was in @Code fixed style; we can switch styles like this:
+@ID @OneRow @Code {
+"@CP"
+" style { varying }"
+"{"
+"#include <stdio.h>"
+""
+"treeprint(p) /* print tree p recursively */"
+"struct tnode *p;"
+"{"
+" if (p != NULL) {"
+" treeprint(p->left);"
+" printf(\"%4d %s\\n\", p->count, p->word);"
+" treeprint(p->right);"
+" }"
+"}"
+"}"
+}
+The result in this case will be
+@ID @OneRow @CP style { varying }
+{
+#include <stdio.h>
+
+treeprint(p) /* print tree p recursively */
+struct tnode *p;
+{
+ if (p != NULL) {
+ treeprint(p->left);
+ printf("%4d %s\n", p->count, p->word);
+ treeprint(p->right);
+ }
+}
+}
+If we use @Code "style { symbol }" we get this:
+@ID @OneRow @CP style { symbol }
+{
+#include <stdio.h>
+
+treeprint(p) /* print tree p recursively */
+struct tnode *p;
+{
+ if (p != NULL) {
+ treeprint(p->left);
+ printf("%4d %s\n", p->count, p->word);
+ treeprint(p->right);
+ }
+}
+}
+with mathematical symbols replacing some of the operators.
+@PP
+The {@Code "@CP"}, {@Code "@Eiffel"} etc. symbols have additional options
+which allow a finer control over the style. Here they all are, with their
+default values:
+@ID @OneRow @Code {
+"@CP [ or @Eiffel, @Blue, etc. ]"
+" style { fixed }"
+" font { Courier }"
+" size { -1.0p }"
+" line { 1.0vx }"
+" tabin { 8 }"
+" tabout { 8s }"
+" identifiers { Base }"
+" keywords { Base }"
+" operators { Base }"
+" numbers { Base }"
+" strings { Base }"
+" comments { Base }"
+"{"
+" ..."
+"}"
+}
+We are already familiar with {@Code "style"}. After that comes
+{@Code "font"}, which determines the font family to use, {@Code "size"},
+the font size to use, and {@Code "line"}, the inter-line spacing. The
+default value for @Code "size" asks for one point smaller than in the
+surrounding document; this was done to compensate for Courier's relatively
+large appearance compared to other fonts of the same nominal size.
+@PP
+The @Code "tabin" and @Code "tabout" options are the subject of
+Section {@NumberOf tabs}. After them come six options giving the
+particular font faces in which to print identifiers, keywords, operators,
+numbers, strings, and comments. {@Code "Base"} means the basic face; other
+commonly available choices are {@Code "Slope"} and {@Code "Bold"}. These
+options may all be set to different faces if desired. The default values
+shown are correct for @Code "style { fixed }" only; the other styles
+have other defaults (Section {@NumberOf cpsetup}).
+@End @Section