3 <style|<tuple|article|tmdoc-keyboard|header-article|fangle>>
6 <hide-preamble|<assign|LyX|<macro|L<space|-0.1667em><move|Y|0fn|-0.25em><space|-0.125em>X>><assign|par-first|0fn><assign|par-par-sep|0.5fn>>
8 <doc-data|<doc-title|Getting Started with
9 Fangle>|<doc-author-data|<author-name|Sam Liddicott>|<\author-address>
13 <assign|sub-page|<\macro|x>
17 <\padded-centered|0cm|2cm>
18 <indent-both|1cm|1cm|<arg|x>>
23 <assign|fake-caret|<macro|<with|color|black|<math|\<vdots\>>>>>
26 This document explains how to use fangle and is a companion to
27 <strong|Fangle> which explains how fangle works.
29 Of course one does not need to know how Fangle works in order to use it,
30 and one may find it easier to understand how it works when one knows how
33 Because of this it is probably better to read <strong|Getting Started
34 with Fangle> before reading <strong|Fangle>.
36 This document is not intended to cover what <em|literate programming> is,
37 or what its advantages are. It is assumed that the reader will have some
38 knowledge of this. This document covers how to use fangle for literate
39 programming, assuming that the user has at least some theoretical
40 knowledge of what this entails.
42 This document includes getting and installing fangle, starting a new
43 simple fangle project (with <TeXmacs>, <LyX>, <LaTeX>, and plain text)
44 and then making use of <strong|Makefile.inc> (from the <strong|Fangle>
45 book) for larger projects and for specific sub-modules of existing Make
48 This document should have enough detail to help someone who is
49 un-familiar with <TeXmacs> or <LyX> to become acquainted with their use
50 for literate programming, but is not intended to guide the reader in
51 making particularly effective use of these editors.
53 It is assumed that the reader will already have a functioning
54 installation of <TeXmacs>, <LyX>, <LaTeX> or whatever document
55 preparation system they intend to employ.
58 <\table-of-contents|toc>
61 <part|Getting and Installing Fangle>
63 <section|Getting Fangle>
65 The latest release of Fangle can be downloaded as a gzip'd tar file from
66 the git repository at <hlink|http://git.savannah.gnu.org/cgit/fangle.git/snapshot/latest.tar.gz|>
68 You can checkout the entire git repository read-only by cloning either
69 <hlink|git://git.sv.gnu.org/fangle.git|> or
70 <hlink|http://git.savannah.gnu.org/r/fangle.git|>
72 Users with a Savannah.gnu.org login can also clone
73 <hlink|ssh://git.sv.gnu.org/srv/git/fangle.git|> which will also give
74 commit access to project members.
76 <section|Installing Fangle>
78 There is no <verbatim|make install><\footnote>
79 there should be, but I'm writing this document partly to find out what
80 the obstacles to adoption are
81 </footnote> so you will need to copy files to the correct places, as
86 <subsection|For personal use>
88 <subsubsection|The fangle untangler>
90 <verbatim|fangle> itself needs copying to where personal programs are kept.
91 This could just be the git checkout directory or the place where you
92 un-tar'd lateIf you have noweb installed then yst.tar.gz
94 I keep my personal programs in a private <verbatim|.local/bin> directory
95 which I keep in my path.
98 mkdir -p $HOME/.local/bin
100 cp fangle $HOME/.local/bin
103 If you don't have this folder in your path (and you use bash) you could add
106 <verbatim|echo 'export PATH=$PATH:$HOME/.local/bin' \<gtr\>\<gtr\>
109 and if you don't want to have to login again, also set the path for the
112 <verbatim|<verbatim|export PATH=$PATH:$HOME/.local/bin>>
114 <subsubsection|The <TeXmacs> stylesheet>
116 If you are using <TeXmacs>, then <verbatim|fangle.ts> needs copying to your
117 private <TeXmacs> packages folder:
119 <verbatim|cp fangle.ts $HOME/.TeXmacs/packages/>
121 <subsubsection|The <LyX> stylesheet>
123 If you are using <LyX>, then <verbatim|fangle.module> needs copying to your
124 private <LyX> modules folder:
126 <verbatim|cp fangle.module $HOME/.lyx/modules/>
128 You will also need to have Norman Ramsey's <name|noweb> stylesheet
131 <subsubsection|The <TeX> stylesheet>
133 <todo|Still needs ripping off out of the .module maybe>
135 You will also need to have Norman Ramsey's noweb stylesheet installed.
137 <subsection|For system-wide use>
139 <subsubsection|The fangle untangler>
141 <paragraph|/usr/local/bin>
143 <verbatim|fangle> can be copied to <verbatim|/usr/local/bin>
145 <verbatim|sudo cp fangle /usr/local/bin>
149 you could extract the entire package to <verbatim|/opt/fangle> but might
150 want to add <verbatim|/opt/fangle> to the system-wide path. You could do
154 echo 'PATH=$PATH:/opt/fangle' \<gtr\>\<gtr\> /etc/profile.d/fangle.sh
156 echo export PATH \<gtr\>\<gtr\> /etc/profile.d/fangle.sh
159 <subsubsection|The <TeXmacs> stylesheet>
161 If you are using <TeXmacs> then you will need to install
162 <verbatim|fangle.ts> into the <TeXmacs> system-wide package folder. This
163 might be <verbatim|/usr/share/texmacs/TeXmacs/packages/> but may vary
164 across installations.
166 <verbatim|cp fangle.ts /usr/share/texmacs/TeXmacs/packages/>
168 <subsubsection|The <LyX> stylesheet>
170 If you are using <LyX>, then you will need to install
171 <verbatim|fangle.module> into the <LyX> system-wide modules folder. This
172 might be <verbatim|/usr/share/lyx/> but may vary across installations
174 <verbatim|cp fangle.module /usr/share/lyx/modules/>
176 You will also need to have Norman Ramsey's <name|noweb> stylesheet
179 <subsubsection|The <TeX> stylesheet>
181 <todo|Still needs ripping off out of the .module maybe>
183 You will also need to have Norman Ramsey's noweb stylesheet installed.
185 <part|Authoring with Fangle>
187 Fangle has editor style-sheets for <TeXmacs> and <LyX> to aid document
190 Fangle can untangle<\footnote>
191 <em|untangling> is the historical term referring to the extraction or
192 generation of source code from the documentation
193 </footnote> sources from text files produced by <TeXmacs>'s verbatim
194 export, from <TeX> files generated by <LyX>, from plain hand-edited <LaTeX>
195 or <TeX> files, and from plain text files that adhere to certain
196 conventions (either hand-written or generated from other document editors).
198 This part will show how to start a simple project for <TeXmacs>, <LyX>,
199 <LaTeX>/<TeX> and plain text.
201 The instructions cover more than mere use of the fangle style-sheet.
202 Literate programming is more than just pretty-looks or a bound booklet
203 <emdash> it is a mind-set. Good titles, author information, abstracts, good
204 structure and good narrative are essential to stop the whole thing being a
205 good-looking waste of time.
209 This section does not assume a large degree of familiarity with <TeXmacs>,
210 but you should have spent at least a few minutes figuring out how to use
213 <subsection|Load fangle style-sheet>
216 <item>Start <TeXmacs> with a new document.
218 <item>Work around a dumb bug in Fangle<\footnote>
219 And if you can work out what the fix is to get fangle.ts to execute
220 this command, please let me know!
223 From the menu: <menu|Tools|Execute|Evaluate scheme expression...> and
224 type: <verbatim|(define-group enumerate-tag nf-chunk)>
226 Sadly you will need to do this each time you start <TeXmacs> but lucky
227 for you it will remember the last command you ran.
229 <item>Choose an appropriate document style:
231 From the menu: <menu|Document|Style|article>
233 For small informal projects I usually choose <em|article>, and for longer
234 more formal projects I usually choose a <em|book>.
236 <item>Add the fangle package:
238 From the menu: <menu|Document|Add package|fangle>
240 If the <em|fangle> package isn't listed, then update your styles
243 <menu|Tools|Update|Styles> and then try again
245 <item>Optionally, (if you prefer this style):
247 <menu|Document|View|Create preamble> (or <menu|Document|View|Show
248 preamble>) and insert this:
250 <verbatim|\<less\>assign\|par-first\|0fn\<gtr\>\<less\>assign\|par-par-sep\|0.5fn\<gtr\>>
252 and then: <menu|Document|View|Show all parts>
255 <subsection|Save the document>
257 Save the document, and call it <verbatim|hello-world.tm>
259 From the menu: <menu|File|Save>
261 <subsection|Sandard document parts>
263 <subsubsection|Insert your title>
265 <menu|Insert|Title|Insert title>
268 <item>Type the name of your document:
269 <keys|L|i|t|e|r|a|t|e|space|E|x|a|m|p|l|e>
271 <item>Press <key|enter> and then type your name.
273 <item>Press <key|enter> and then type your email address.
275 <item>Press <key|right> to leave the title block
278 <subsubsection|Insert your abstract>
280 <menu|Insert|Title|Abstract>
282 The abstract should explain what the document is about and help the reader
283 discover if the document is relevant to them. It should not contain
284 explanations that the document contains but it should explain what it is
285 that the document contains.
287 See the abstract to this document for a fair example.
289 After you have entered the abstract, press <key|right> to leave the
292 <subsubsection|Insert a table of contents>
294 <menu|Insert|Automatic|Table of contents>
296 <subsubsection|Start a new section (or chapter)>
298 <menu|Insert|Section|Section> (or <menu|Insert|Section|Chapter>) and type
299 the name of the chapter:
301 <keys|H|e|l|l|o|space|W|o|r|l|d|enter>
303 The first chapter will generally illustrate the problem to be solved and
304 explain how the book is to be used to understand and provide the solution.
306 <subsection|Talk about your code>
308 Before you insert a chunk of code, you introduce it.
310 Usually you will have introduced some aspect of the main problem that the
311 program as a whole will solve, and will then outline the solution that this
314 We will introduce our hello-world chunk by typing:
316 <key|T h e> <key|space> <key|t y p i c a l> <key|space> <key|h e l l o>
317 <key|space> <key|w o r l d> <key|space> <key|p r o g r a m> <key|space>
318 <key|l o o k s> <key|space> <key|l i k e> <key|space> <key|t h i s :>
321 <subsection|Insert your first code chunk>
323 Fangle currently has no menus; all commands are entered with a back-slash.
324 This may annoy you, but it is much faster to keep your hands off the mouse.
326 <todo|Add some menus bindings>
328 Fangle chunks are (currently) called: <verbatim|nf-chunk> and are entered
332 <item>type: <keys|\\|n|f|-|c|h|u|n|k> <emdash> it will appear like this:
333 <inactive|<hybrid|nf-chunk>>
335 <item>press <key|enter><math|>
337 Depending on your <TeXmacs> environment, you may get either this
338 <inactive|<nf-chunk|<fake-caret>|||>> which is the inactive view, or the
339 active view shown below:
342 <\nf-fake-chunk|<fake-caret>>
344 </nf-fake-chunk|||1|1a|||||>
347 If the text insertion point (represented by the three vertical dots
348 <fake-caret>) does not appear as shown above, then press <key|left> so
351 <item>Type the name of your chunk: <keys|h|e|l|l|o|-|w|o|r|l|d>
353 This will give you either <inactive|<nf-chunk|hello-world<fake-caret>|||>>
354 for the inactive view, or the active view shown as below:
357 <\nf-fake-chunk|hello-world<fake-caret>>
359 </nf-fake-chunk|||1|1a|||||>
363 <subsection|Optional chunk parameters>
365 Press <key|right> to move the text insertion point to the second argument
368 This is to specify parameters to the code that will be contained in the
369 chunk. Chunks can take optional parameters, and behave somewhat like C
372 Usually chunks will not have parameters, although parameters can be useful
373 when a chunk is used to express an algorithm (like a sort) or a class of
374 behaviours (like binary tree management). In such cases, a set of
375 parameterized chunks can work like generics or C++ templates.
377 If chunk has parameters, they must be enclosed in a tuple. When I
378 understand DRD's a bit better this will be done for you, but for now if you
379 want chunk parameters then you create a tuple, otherwise skip to the next
382 <subsubsection|Create a tuple>
384 Press <key|\\>. If this comes out as a backslash <with|color|red|\\>
385 (perhaps red) instead of in angle brackets like this
386 <with|color|blue|<math|\<langle\>\\\<rangle\>>> then press <key|backspace>
387 and enter a command-backslash using the meta key (probably the windows
388 button) by pressing <key|M-\\>.\
390 Once you have the <with|color|blue|<math|\<langle\>\\\<rangle\>>>, type
391 <keys|t|u|p|l|e|enter>.
393 Type the first chunk argument, and then for additional arguments,
394 <key|M-right> (windows key and right arrow).
396 You can type multiple parameters: <inactive|<nf-chunk|hello-world|<tuple|message|language<fake-caret>>||>>
400 <\nf-fake-chunk|hello-world>
402 </nf-fake-chunk||<tuple|message|language<fake-caret>>|1|1a|||||>
405 <subsection|Typing code>
407 Press <key|right> to move the text insertion point to the main code area.
409 If your chunk shows as inactive then this will be visible as the third
410 argument, but you may prefer to activate your chunk at this point. You
411 should be able to do this by pressing <key|enter> or clicking the
412 <image|<tuple|<#89504E470D0A1A0A0000000D49484452000000110000001108060000003B6D47FA000000017352474200AECE1CE900000006624B474400FF00FF00FFA0BDA793000000097048597300000B1300000B1301009A9C180000000774494D4507DB06120F0303780569BC0000001974455874436F6D6D656E74004372656174656420776974682047494D5057810E17000000924944415438CBBD94D10D80200C440FE3127E38846C0303EA3665083F1CA37E95102D52A2B17F90DCCB91BBE22811E3E50CF860C6F2E0176F1652221D020031C42660DDD6BA935EB119721532339C733688888FFDC877D33CD99C68620130731D52A67215B700B927129706E82A1B2552DFDC72A136B60459002A2486584DA16B77046471F11831805BA94C9072A97EFF0A4E5C193CCC5933FA210000000049454E44AE426082>|png>||||>
413 icon on the toolbar. Sometimes the <image|<tuple|<#89504E470D0A1A0A0000000D49484452000000110000001108060000003B6D47FA000000017352474200AECE1CE900000006624B474400FF00FF00FFA0BDA793000000097048597300000B1300000B1301009A9C180000000774494D4507DB06120F0303780569BC0000001974455874436F6D6D656E74004372656174656420776974682047494D5057810E17000000924944415438CBBD94D10D80200C440FE3127E38846C0303EA3665083F1CA37E95102D52A2B17F90DCCB91BBE22811E3E50CF860C6F2E0176F1652221D020031C42660DDD6BA935EB119721532339C733688888FFDC877D33CD99C68620130731D52A67215B700B927129706E82A1B2552DFDC72A136B60459002A2486584DA16B77046471F11831805BA94C9072A97EFF0A4E5C193CCC5933FA210000000049454E44AE426082>|png>||||>
414 icon is absent and pressent enter does nothing <emdash> in which case try
415 the <inactive|<menu|Tools|Update|Styles>> and if that doesn't work then I
416 don't know what to do.
418 The code body is an enumerate style. Press <key|enter> to insert a new
419 numbered line. (You'll probably want to press <keys|left|backspace|right>
420 to delete the blank line that is somehow there. <todo|stop that from
424 <\nf-fake-chunk|hello-world>
426 </nf-fake-chunk||<tuple|message|language>|1|1a|||||>
429 At this point, start typing code.
431 When you press <key|enter>, a new line number will be inserted at the left
432 of the listing. If you press <key|S-enter> then you can break the line for
433 layout purposes, but it will not be considered a new-line when the code is
434 extracted and leading white-space will be stripped.
437 <\nf-fake-chunk|hello-world>
438 <item>#include stdio.c
444 <item> \ printf("<fake-caret>
445 </nf-fake-chunk||<tuple|message|language>|1|1a|||||>
448 The listing above is incomplete. Instead of typing the the traditional
449 <verbatim|hello world!>, we can make use of our chunk arguments. Let's
450 place the value of the argument <with|color|blue|message> at this point.
452 The command for a chunk argument is <keys|\\|n|f|-|a|r|g>, but when you
453 press the <key|\\> it will enter a literal <verbatim|\\> because the cursor
454 is in a code block. To enter a command-backslash in code block, use the
455 meta key (probably the windows button): <keys|M-\\|n|f|-|a|r|g> and this
456 will produce: <inactive*|<nf-arg|>>
458 To enter the name of the argument <with|color|blue|message>, type
459 <keys|m|e|s|s|a|g|e|right> which will produce <nf-arg|message>
461 Finish typing the code as shown below:
464 <\nf-fake-chunk|hello-world>
465 <item>#include stdio.c
471 <item> \ printf("<nf-arg|message>\\n");
474 </nf-fake-chunk||<tuple|message|language>|1|1a|||||>
477 We've now defined a chunk of code which can potentially produce the famous
478 <verbatim|hello world!> in any language.
480 If the chunk were more complicated, we could break off part-way through and
481 provide more explanation, and then insert another chunk <em|with the same
482 name> to continue the code. In this way a single chunk can be broken across
483 sections and spread across the whole document and still be assembled in
486 Let's define some file-chunks that use this chunk.
488 <subsection|File chunks>
490 By convention, file chunk is just a regular chunk whose name begins with
491 <verbatim|./> which signifies to build-tools that it should be extracted
494 <subsubsection|French hello-world>
496 Insert a new sub-section for french:
498 <menu|Insert|Section|Subsection> (or <menu|Insert|Section|Section>) and
499 type the name of the subsection:
501 <key|I n> <key|space> <key|F r e n c h> <key|enter>
503 Then introduce the next code chunk, type:
504 <keys|W|e|space|w|i|l|l|space|d|e|r|i|v|e|space|t|h|e|space|f|r|e|n|c|h|space|h|e|l|l|o|-|w|o|r|l|d|space|p|r|o|g|r|a|m|space|l|i|k|e|space|t|h|i|s|:|enter>
506 Then, create a chunk called hello-world.fr.c, by typing:
507 <keys|\\|n|f|-|c|h|u|n|k|enter> and then the chunk name
508 <keys|.|/|h|e|l|l|o|-|w|o|r|l|d|.|f|r|.|c|right|right>
511 <strong|<small|1.1 In French>><htab|0mm>
513 We will derive the french hello-world program like this:<htab|0mm>
515 <\nf-fake-chunk|./hello-world.fr.c>
517 </nf-fake-chunk||<tuple>|1|1b|||||>
520 To include our previous chunk with the <verbatim|nf-ref> command, type
521 <keys|M-\\|n|f|-|r|e|f|enter> and then type the name of our previous chunk,
522 <keys|h|e|l|l|o|-|w|o|r|l|d>
524 We then move to the arguments part of the <verbatim|nf-ref>, <key|right>,
525 and type the argument <em|Bonjour tout le monde> in a tuple:
527 <keys|M-\\|t|u|p|l|e|enter|B|o|n|j|o|u|r|space|t|o|u|t|space|l|e|space|m|o|n|d|e|enter>
530 <strong|<small|1.1 In French>><htab|0mm>
532 We will derive the french hello-world program like this:<htab|0mm>
534 <\nf-fake-chunk|./hello-world.fr.c>
535 <item><nf-fake-ref|hello-world|<tuple|Bonjour tout le
536 monde>|1a><fake-caret>
537 </nf-fake-chunk||<tuple>|1|1b|||||>
540 Note that when there are no arguments to the reference, the parenthesis do
541 not appear, but they appear automatically when there are arguments.
543 <subsubsection|German hello-world>
545 And let's create a similar chunk for german. Insert a new sub-section:
547 <menu|Insert|Section|Subsection> (or <menu|Insert|Section|Section>) and
548 type the name of the subsection:
550 <key|I n> <key|space> <key|G e r m a n> <key|enter>
552 Then introduce the next code chunk, type:
553 <keys|W|e|space|w|i|l|l|space|d|e|r|i|v|e|space|t|h|e|space|g|e|r|m|a|n|space|h|e|l|l|o|-|w|o|r|l|d|space|p|r|o|g|r|a|m|space|l|i|k|e|space|t|h|i|s|:|enter>
555 Create a chunk called hello-world.de.c, by typing:
556 <keys|\\|n|f|-|c|h|u|n|k|enter> and then the chunk name
557 <keys|.|/|h|e|l|l|o|-|w|o|r|l|d|.|d|e|.|c|right|right>
560 <strong|<small|1.2 In German>><htab|0mm>
562 We will derive the german hello-world program like this:<htab|0mm>
564 <\nf-fake-chunk|./hello-world.de.c>
565 <item><nf-fake-ref|hello-world|<tuple|Hallo welt>|1a><fake-caret>
566 </nf-fake-chunk||<tuple>|1|1c|||||>
569 <subsection|Additional parameters>
571 Astute readers will have noticed that the <verbatim|hello-world> chunk has
572 two parameters but that our french and german invocations only have one
573 argument. This is not really a problem as the <verbatim|hello-world> chunk
574 only uses one; but let's change that:
577 <\nf-fake-chunk|hello-world>
578 <item>/* The traditional hello-world program in <nf-arg|language>\
580 <item> * generated using fangle literate programming macros
586 <item>#include stdio.c
592 <item> \ printf("<nf-arg|message>\\n");
595 </nf-fake-chunk||<tuple|message|language>|1|1a|||||>
598 We will now modify our french and german .c files by clicking inside
599 <with|color|blue|Bonjour tout le monde> and pressing <key|M-right> and then
600 typing: <key|f r e n c h>
603 <\nf-fake-chunk|./hello-world.fr.c>
604 <item><nf-fake-ref|hello-world|<tuple|Bonjour tout le
605 monde|french>|1a><fake-caret>
606 </nf-fake-chunk||<tuple>|1|1b|||||>
609 And doing similarly for the german:
612 <\nf-fake-chunk|./hello-world.de.c>
613 <item><nf-fake-ref|hello-world|<tuple|Hallo
614 welt|german>|1a><fake-caret>
615 </nf-fake-chunk||<tuple>|1|1c|||||>
618 <subsection|Extracting individual files>
620 Later on, automatic extraction using <verbatim|Makefile.inc> is shown, but
621 this is how to extract chunks manually from a <TeXmacs> document.
624 <item>Save the <verbatim|hello-world.tm> document\
626 <item>Generate a text file hello-world.txt, either with
627 <menu|File|Export\|Verbatim> or with this command line:
629 <verbatim|texmacs -s -c hello-world.tm hello-world.txt -q>
631 <item>Extract the french and german files:
634 fangle -R./hello-world.fr.c hello-world.txt \<gtr\> hello-world.fr.c
636 fangle -R./hello-world.de.c hello-world.txt \<gtr\> hello-world.de.c
640 The resultant french file should look like this:
644 <\with|par-par-sep|0fn>
647 /* The traditional hell-world program in french\
649 \ * generated using literate programming macros
655 \ \ printf("Bonjour tout le monde\\n");
662 <subsection|Extracting all files>
664 A list of all the chunks can be obtained with:
666 <verbatim|fangle -r hello-world.txt>
668 So we can extract all files like this:
671 texmacs -s -c hello-world.tm hello-world.txt -q &&
673 fangle -r hello-world.txt \| while read file
675 do fangle -R"$file" hello-world.txt \<gtr\> "$file"
680 If you have <em|noweb> installed then you can use <verbatim|cpif> to avoid
681 updating files that haven't changed:
684 texmacs -s -c hello-world.tm hello-world.txt -q &&
686 fangle -r hello-world.txt \| while read file
688 do fangle -R"$file" hello-world.txt \| cpif "$file"
693 <subsection|The completed document>
695 The document you typed might look something like this:<no-page-break>
698 <htab|0mm><strong|Literate Example><htab|0mm>
700 <\with|par-par-sep|0fn>
702 Joe Soap<htab|0mm>joe@example.com
706 <htab|0mm><small|<strong|Abstract>><htab|0mm>
709 This is a simple example of how to use literate programming templates,
712 Hello-world is a famous <em|first program> with a visible side effect.
714 This example produces hello-world in multiple languages.
717 <strong|Table of Contents>
719 <\with|par-par-sep|0fn>
720 <with|font-series|bold|math-font-series|bold|1<space|2spc>Hello World>
721 <datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
724 <with|par-left|1.5fn| \ \ \ 1.1<space|2spc>In French
725 <datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
726 <no-break>1><vspace|0.0fn>
728 <with|par-left|1.5fn| \ \ \ 1.2<space|2spc>In German
729 <datoms|<macro|x|<repeat|<arg|x>|<with|font-series|medium|<with|font-size|1|<space|0.2fn>.<space|0.2fn>>>>>|<htab|5mm>>
730 <no-break>1><vspace|0.5fn>
735 <with|font-series|bold|math-font-series|bold|1 Hello World>
737 The typical hello-world program looks something like this:
739 <\nf-fake-chunk|hello-world>
740 <item>/* The traditional hello-world program in <nf-arg|language>\
742 <item> * generated using literate programming macros
746 <item>#include stdio.c
752 <item> \ printf("<nf-arg|message>\\n");
755 </nf-fake-chunk||<tuple|message|language>|1|1a|||||>
757 <strong|<small|1.1 In French>>
759 We will derive the french hello-world program like this:<htab|0mm>
761 <\nf-fake-chunk|./hello-world.fr.c>
762 <item><nf-fake-ref|hello-world|<tuple|Bonjour tout le monde|french>|1a>
763 </nf-fake-chunk||<tuple>|1|1b|||||>
765 <small|<strong|1.2 In German>>
767 We will derive the german hello-world program like this:<htab|0mm>
769 <\nf-fake-chunk|./hello-world.de.c>
770 <item><nf-fake-ref|hello-world|<tuple|Hallo welt|german>|1a>
771 </nf-fake-chunk||<tuple>|1|1c|||||>
776 Which demonstrates nicely how to use fangle in terms of function, but less
777 so in terms of style.
782 <associate|page-medium|papyrus>
783 <associate|page-screen-height|746496tmpt>
784 <associate|page-screen-margin|false>
785 <associate|page-screen-width|1268736tmpt>
786 <associate|preamble|false>