1 | version = "$Id: bug.lib,v 1.0 2010/02/19 q$"; |
---|
2 | |
---|
3 | category = "general"; |
---|
4 | info = |
---|
5 | " |
---|
6 | LIBRARY: bugtexinfo.lib, |
---|
7 | PURPOSE: Shows a bug with texinfo and lib2doc |
---|
8 | AUTHOR: Christian Gorzel, University of Muenster |
---|
9 | |
---|
10 | OVERVIEW: |
---|
11 | This library demonstrates that TeX-commands have to be quoted in the |
---|
12 | overview part. @* |
---|
13 | A polynomial is non-constant @math{\iff \deg f \geq 1}. @* |
---|
14 | @texinfo |
---|
15 | @tex |
---|
16 | A polynomial is non-constant \quad $\iff \deg f \geq 1$. |
---|
17 | @end tex |
---|
18 | @end texinfo |
---|
19 | @* |
---|
20 | With quoting by a backslah, the text is fine. @* |
---|
21 | A polynomial is non-constant @math{\\iff \\deg f \\geq 1}. @* |
---|
22 | @texinfo |
---|
23 | @tex |
---|
24 | A polynomial is non-constant \\quad $\\iff \\deg f \\geq 1$. |
---|
25 | @end tex |
---|
26 | @end texinfo |
---|
27 | @* |
---|
28 | However, in the help-string of a proc, a quoting is not needed --- there, |
---|
29 | quoting gives incorrect text. @* |
---|
30 | |
---|
31 | Futhermore, commands like LIB \"poly.lib\"; need a blank after LIB, otherwise |
---|
32 | no output will by produced. |
---|
33 | |
---|
34 | |
---|
35 | PROCEDURES: |
---|
36 | |
---|
37 | is_constant(f;) checks whether f is constant |
---|
38 | "; |
---|
39 | |
---|
40 | // The bug is in pl2doc.pl |
---|
41 | // TeX commands work correctly in help-sting for procs, |
---|
42 | // since it doubles first the backslash (unless \") in texinfo and @math environment, |
---|
43 | |
---|
44 | LIB "poly.lib"; // here is a blank necessary: LIB"poly.lib"; cause problems |
---|
45 | /////////////////////////////////////////////////////////////////////////////// |
---|
46 | |
---|
47 | proc is_constant(poly f) |
---|
48 | "USAGE: is_constant(f); f poly |
---|
49 | RETURN: int, 1 if f is constant, 0 otherwise |
---|
50 | NOTE: A polynomial f is non-constant @math{\\iff \\deg f \\geq 1}. (with quoting) @* |
---|
51 | |
---|
52 | A polynomial \"f\" is non-constant @math{\iff \deg f \geq 1}. (without quoting) @* |
---|
53 | @texinfo |
---|
54 | @tex |
---|
55 | A polynomial is non-constant \quad $\iff \deg f \geq 1$. (without quoting) |
---|
56 | @end tex |
---|
57 | @end texinfo |
---|
58 | EXAMPLE: example is_constant; shows an example |
---|
59 | " |
---|
60 | { |
---|
61 | return(deg(f)<1); |
---|
62 | } |
---|
63 | example |
---|
64 | { "EXAMPLE:"; echo =2; |
---|
65 | ring r = 0,x,dp; |
---|
66 | is_constant(x+2); |
---|
67 | is_constant(101); |
---|
68 | is_constant(0); |
---|
69 | } |
---|
70 | /////////////////////////////////////////////////////////////////////////////// |
---|
71 | |
---|
72 | /* |
---|
73 | |
---|
74 | pl2doc.pl quoted in @texinfo @math Umgebungen, um anschliessend wieder |
---|
75 | doppelte backslashes zu entfernen. Dieses automatische quoten |
---|
76 | fehlt beim info-help-string (Overview) der library. |
---|
77 | |
---|
78 | This is the result, if above it is written LIB"poly.lib"; without a blank. |
---|
79 | |
---|
80 | libparse -i bugtexinfo.lib > bugtexinfo.perl |
---|
81 | perl ./pl2doc.pl -doc -o bugtexinfo.doc bugtexinfo.perl |
---|
82 | Bareword found where operator expected at bugtexinfo.perl line 31, near "]ERROR" |
---|
83 | (Might be a runaway multi-line << string starting on line 6) |
---|
84 | (Missing operator before ERROR?) |
---|
85 | Bareword found where operator expected at bugtexinfo.perl line 31, near "] cannot" |
---|
86 | (Missing operator before cannot?) |
---|
87 | String found where operator expected at bugtexinfo.perl line 31, near "character ''" |
---|
88 | (Do you need to predeclare character?) |
---|
89 | Bareword found where operator expected at bugtexinfo.perl line 31, near "'' in" |
---|
90 | (Missing operator before in?) |
---|
91 | Bareword found where operator expected at bugtexinfo.perl line 31, near "1080979772 to" |
---|
92 | (Missing operator before to?) |
---|
93 | syntax error at bugtexinfo.perl line 31, near "]ERROR occured" |
---|
94 | Compilation failed in require at ./pl2doc.pl line 37. |
---|
95 | make: *** [bugtexinfo.doc] Fehler 9 |
---|
96 | |
---|
97 | Put some remarks in STYLEGUIDE4libdocs |
---|
98 | */ |
---|