X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/sod/blobdiff_plain/284f1fa2ace3e276052ff1bd7d66442500e693da..7b7947024fedb0bb7a0ea3ccb0029f6060de901b:/doc/tutorial.tex

diff --git a/doc/tutorial.tex b/doc/tutorial.tex
index bb357d8..3d90293 100644
--- a/doc/tutorial.tex
+++ b/doc/tutorial.tex
@@ -96,10 +96,10 @@ The main consequences of this are as follows.
 Of course, this means that your build system needs to become more
 complicated.  If you use \man{make}{1}, then something like
 \begin{prog}
-  SOD = sod \\
-  \\
-  .SUFFIXES: .sod .c .h \\
-  .sod.c:; \$(SOD) -tc \$< \\
+  SOD = sod                                                     \\+
+
+  .SUFFIXES: .sod .c .h                                         \\
+  .sod.c:; \$(SOD) -tc \$<                                      \\
   .sod.h:; \$(SOD) -th \$<
 \end{prog}
 ought to do the job.
@@ -109,46 +109,46 @@ ought to do the job.
 
 The following is a simple Sod input file.
 \begin{prog}
-/* -*-sod-*- */ \\
-\\
-code c : includes \{ \\
-\#include "greeter.h" \\
-\} \\
-\\
-code h : includes \{ \\
-\#include <stdio.h> \\
-\#include <sod/sod.h> \\
-\} \\
-\\
-class Greeter : SodObject \{ \\ \ind
-  void greet(FILE *fp) \{ \\ \ind
-    fputs("Hello, world!\textbackslash n", fp); \- \\
-  \} \- \\
-\}
+  /* -*-sod-*- */                                               \\+
+
+  code c: includes \{                                           \\
+  \#include "greeter.h"                                         \\
+  \}                                                            \\+
+
+  code h: includes \{                                           \\
+  \#include <stdio.h>                                           \\
+  \#include <sod/sod.h>                                         \\
+  \}                                                            \\+
+
+  class Greeter: SodObject \{                                   \\ \ind
+    void greet(FILE *fp) \{                                     \\ \ind
+      fputs("Hello, world!\textbackslash n", fp);             \-\\
+    \}                                                        \-\\
+  \}
 \end{prog}
 Save it as @"greeter.sod", and run
 \begin{prog}
-sod --gc --gh greeter
+  sod --gc --gh greeter
 \end{prog}
 This will create files @"greeter.c" and @"greeter.h" in the current
 directory.  Here's how we might use such a simple thing.
 \begin{prog}
-\#include "greeter.h" \\
-\\
-int main(void) \\
-\{ \\ \ind
-  SOD_DECL(Greeter, g); \\
-  \\
-  Greeter_greet(g, stdout); \\
-  return (0); \- \\
-\}
+  \#include "greeter.h"                                         \\+
+
+  int main(void)                                                \\
+  \{                                                            \\ \ind
+    SOD_DECL(Greeter, g);                                       \\+
+
+    Greeter_greet(g, stdout);                                   \\
+    return (0);                                               \-\\
+  \}
 \end{prog}
 Compare this to the traditional
 \begin{prog}
-\#include <stdio.h> \\
-\\
-int main(void) \\ \ind
-  \{ fputs("Hello, world@\\n", stdout); return (0); \}
+  \#include <stdio.h>                                           \\+
+
+  int main(void)                                                \\ \ind
+    \{ fputs("Hello, world@\\n", stdout); return (0); \}
 \end{prog}
 and I'm sure you'll appreciate the benefits of using Sod already -- mostly to
 do with finger exercise.  Trust me, it gets more useful.
@@ -164,7 +164,7 @@ c"~\ldots, says that
 \end{prog}
 needs to appear in the generated @|greeter.c| file; the second says that
 \begin{prog}
-  \#include <stdio.h> \\
+  \#include <stdio.h>                                           \\
   \#include <sod/sod.h>
 \end{prog}
 needs to appear in the header file @|greeter.h|.  The generated C files need
@@ -175,8 +175,8 @@ approach to all of this: it expects you, the programmer, to deal with it.
 
 The basic syntax for @"code" stanzas is
 \begin{prog}
-  code @<file-label> : @<section> \{ \\ \ind
-    @<code> \- \\
+  code @<file-label>: @<section> \{                             \\ \ind
+    @<code>                                                   \-\\
   \}
 \end{prog}
 The @<file-label> is either @"c" or @"h", and says which output file the code
