summaryrefslogtreecommitdiff
path: root/graphics/circuit_macros/examples/Flow.m4
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2020-12-21 03:01:35 +0000
committerNorbert Preining <norbert@preining.info>2020-12-21 03:01:35 +0000
commit4cc7922324b7a08ba0418e8f245cf1dcfa1891ac (patch)
treecd90cb6c072285e779f7555a85966b81a8757e15 /graphics/circuit_macros/examples/Flow.m4
parent2d9d44100d72263a7df34c12aaa89dbe6ee6fe0c (diff)
CTAN sync 202012210301
Diffstat (limited to 'graphics/circuit_macros/examples/Flow.m4')
-rw-r--r--graphics/circuit_macros/examples/Flow.m466
1 files changed, 45 insertions, 21 deletions
diff --git a/graphics/circuit_macros/examples/Flow.m4 b/graphics/circuit_macros/examples/Flow.m4
index f4fa766f1a..f0f8a842f0 100644
--- a/graphics/circuit_macros/examples/Flow.m4
+++ b/graphics/circuit_macros/examples/Flow.m4
@@ -3,19 +3,41 @@
gen_init
ifdef(`FlowchartDefs_',,`include(FlowchartDefs.m4)')
-# Could use xcolor with option dvipsnames but define color here for portability:
define(`Thistle',`rgbstring(0.85,0.75,0.85)')dnl
define(`RubineRed',`rgbstring(0.81,0,0.35)')dnl
define(`YellowGreen',`rgbstring(0.68,1,0.18)')dnl
define(`SeaGreen',`rgbstring(0.13,0.70,0.67)')dnl
define(`Goldenrod',`rgbstring(0.85,0.65,0.13)')dnl
+define(`Beaublue',`rgbstring(0.74,0.83,0.9)')dnl
+define(`Celadon',`rgbstring(0.67,0.88,0.69)')dnl
linethick_(1.0)
arrowwid = 0.05
arrowht = 0.1
- fillval = 0.8
- down
-
+ fillval = 0.9
+ maxpsht = 20
+
+define(`shad',`shaded rgbstring(0.9,0.8,0.7)')
+define(`Below',`with .nw at last [].sw+(0,-0.25)')
+TL: Here
+Simple: [
+ Fbox("\tt F{}box",,shad)
+ Ftest("\tt F{}test",,shad) Below
+ Fdata("\tt F{}data") Below
+ Fprep("\tt F{}prep",) Below
+ Fkeying("\tt F{}keying") Below
+ Fkeyboard("\tt F{}keyboard") Below
+ Fdocument("\tt F{}document",,shaded rgbstring(0.9,0.8,0.7)) Below
+ Fdelay("\tt F{}delay",,shaded Beaublue) Below
+ Fdisplay("\tt F{}display",,shaded Celadon) Below
+ Fstored("\tt F{}stored",,shaded Thistle) Below
+ Fconnect(,,shaded Thistle) Below
+ Fconnect("45",wid boxwid ht boxht:45,shaded Thistle) \
+ with .w at last [].e+(boxht/8,0)
+ "\tt F{}connect" at last [].nw + (0,boxht/6)
+ ] with .nw at TL+(0.1,0); move from Simple.nw to TL
+#showbox_
+Complex: [
Case: Fcase(,
"Test 1",[Fbox("Task 1",, shaded Thistle); W:last [].W; N:last [].N
arrow down linewid/3 from last [].S
@@ -28,35 +50,32 @@ Case: Fcase(,
"\sl .N" at Case.N rjust above; "\sl .S" at Case.S rjust below
"\sl .E" at Case.E ljust; "\sl .W" at Case.W rjust
- "\sl Case statement" below at Case.s+(0,-0.2)
- move to Case.nw+(-12bp__,10bp__)
+ "\tt F{}case" below at Case.s #+(0,-0.1)
Whiledo: Fwhiledo("$i < n$",,,Fbox("Task"),"T" above ljust at Test.E) \
with .nw at Case.ne+(0.25,0)
"\sl .N" at Whiledo.N rjust; "\sl .S" at Whiledo.S rjust below
"\sl .E" at Whiledo.E ljust; "\sl .W" at Whiledo.W rjust
- "\sl While-do" below at Whiledo.s+(0,-0.2)
+ "\tt F{}whiledo" below at Whiledo.s
Repeatuntil: Frepeatuntil("$n \geq 5$",,,Fbox("Task"),
- "T" at Test.E above ljust) with .nw at Whiledo.sw + (0.25,-1)
+ "T" at Test.E above ljust) with .nw at Whiledo.sw + (0.25,-0.5)
"\sl .N" at Repeatuntil.N rjust above; "\sl .S" at Repeatuntil.S rjust below
"\sl .E" at Repeatuntil.E ljust; "\sl .W" at Repeatuntil.W rjust
- "\sl Repeat-until" below at Repeatuntil.s+(0,-0.2)
+ "\tt F{}repeatuntil" below at Repeatuntil.se +(-0.0,0.2)
Ifthenelse: Fifthenelse("$A<B$",,,
Fbox("False"),
Fbox("True",ht fboxht*1.2 wid fboxwid)dnl
- ) with .nw at Repeatuntil.sw +(0.5,-0.5)
+ ) with .nw at Repeatuntil.sw +(-0.5,-0.3)
"\sl .N" at Ifthenelse.N rjust above; "\sl .S" at Ifthenelse.S below rjust
- "\sl .E" at Ifthenelse.E ljust; "\sl .W" at Ifthenelse.W rjust
- "\sl If-then-else" below at Ifthenelse.s+(0,-0.3) \
- "\sl (the True and False tasks are optional)"
+ "\sl .E" wid 12bp__ at Ifthenelse.E ljust; "\sl .W" at Ifthenelse.W rjust
+ "\tt F{}ifthenelse" below at Ifthenelse.s+(0,-0.15)
-# Compound statement:
-[ right
+Compound: [ right
ellipse shaded YellowGreen "Start"
arrow right linewid/2
@@ -71,9 +90,12 @@ Ifthenelse: Fifthenelse("$A<B$",,,
"T" at Test.E above ljust),
"T" at Test.E above ljust) with .N at Here
- A: arrow down 0.25 from last [].S ] with .nw at Case.sw + (-12bp__,-0.7)
+ A: arrow down 0.25 from last [].S ] with .nw at Case.sw + (-12bp__,-0.3)
+
+ "\sl Compound statements" at last [].A.end+(0.1,0) ljust above
- "\sl Compound statement" below at last [].A.end
+ ] with .nw at Simple.ne+(0.1,0)
+#showbox_
Example: [ fillvalue = 0.8; awid = linewid/2; right_
Start: ellipse wid boxwid/2 ht boxwid/3 shaded "green"
@@ -99,10 +121,12 @@ Example: [ fillvalue = 0.8; awid = linewid/2; right_
arrow from RT.E to (B3.S,RT.E) then to B3.S
B4: Fbox(`"Extra\c{c}\~ao"') with .S at B3.N+(0,awid)
arrow from B3.N to B4.S
- arrow right_ awid from B4.E
+# arrow right_ awid from B4.E
+ arrow up_ awid from B4.N
B5: Fbox(`"Conclus\~ao"')
- ellipse wid boxwid/2 ht boxwid/3 shaded "red" at (B5.S,Start)
- arrow down_ awid from B5.S to last ellipse.n
-] with .nw at last [].sw+(0,-fboxht)
+ arrow up_ awid from B5.N
+ ellipse wid boxwid/2 ht boxwid/3 shaded "red" # at (B5.S,Start)
+# arrow down_ awid from B5.S to last ellipse.n
+] with .nw at last [].Compound.sw+(0,2.5*fboxht)
.PE