Debian Codegraph @

texmf-dist/doc/support/match_parens/match_parens.html

raw symbols SCIP
1 <!DOCTYPE html>
2 <html Lang="en">
3 <head>
4 <meta name="generator" content="gendoc" />
5 <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
6 <title>match_parens documentation</title>
7 <style media="screen">
8 tr { vertical-align:baseline; }
9 p { margin-top:10px; }
10 * { padding: 0; margin: 0; }
11 body {
12 font-family:Fontin,serif;
13 font-size:small;
14 color:#444;
15 margin-left: 30px;
16 max-width: 40em;
17 }
18 .top {
19 margin-top:10px;
20 margin-bottom:5px;
21 }
22 .bot {
23 margin-top:10px;
24 margin-bottom:0px;
25 }
26 h1 {
27 font-size: 120%;
28 color:#a00;
29 text-shadow: rgba(135,145,135,0.65) 3px 3px 4px;
30 margin-top: 30px;
31 padding-bottom: 0.4em;
32 }
33 h4 {
34 margin-top:15px;
35 margin-bottom:0px;
36 }
37 :link,
38 :visited {
39 color: #aa0000;
40 text-decoration: none;
41 }
42 :link:hover,
43 :visited:hover {
44 border-bottom: 1px dotted #6C8C22;
45 }
46 ul { list-style-type: circle; }
47 li { margin-left: 1.5em; }
48 pre,code {
49 font-family:monospace;
50 font-size: medium;
51 color: #023aaa;
52 }
53 td { padding-right: 1em; }
54 .red { color:#f00; }
55 .green { color:#0f0; }
56 .blue { color:#00f; }
57 .big {
58 font-size:xx-large;
59 font-weight:900;
60 color:#a00;
61 text-shadow: rgba(135,145,135,0.65) 3px 3px 4px;
62 padding-right: .4em;
63 }
64 .kop {
65 font-size:large;
66 font-weight:900;
67 color:#a00;
68 text-shadow: rgba(135,145,135,0.65) 3px 3px 4px;
69 }
70 .left {
71 font-size:xx-small;
72 font-family:sans-serif;
73 margin-top:0px;
74 float: left;
75 width: 53%;
76 }
77 .right {
78 font-size:xx-small;
79 font-family:sans-serif;
80 text-align:right;
81 margin-top:0px;
82 float: right;
83 width: 45%;
84 }
85 img { vertical-align:top; }
86 h1.sub { color:#770; margin-top:2px; }
87 </style>
88 </head>
89 <body class="file">
90 <div>
91 <hr class="top"/>
92 <span class="big">match_parens</span>
93 <span class="kop">find mismatches of various brackets and quotes</span>
94 <hr class="bot"/>
95 <div class="left">doc generated from the script with <a href="http://www.dekkerdocumenten.nl/unix/doc/gendoc.html">gendoc</a></div>
96 <div class="right">ruby script, version=1.45</div><div><br/>
97 <p>
98 <h1>Synopsis</h1>
99 <table><colgroup><col style="width:10%"/><col style="width:90%"/></colgroup><tr><td></td><td></td></tr><tr><td colspan="2"><pre>match_parens [filename]</pre></td></tr></table><p>
100 <h4>Options</h4>
101 <table><tr><td><pre>-h</pre></td><td>print this help and exit</td></tr><tr><td><pre>-H,--help</pre></td><td>print full documentation and exit</td></tr><tr><td><pre>-V,--version</pre></td><td>print version and exit</td></tr><tr><td><pre>-l,--latex</pre></td><td>convert ``...'' to “...” before testing</td></tr><tr><td><pre>-n,--number=N</pre></td><td>set number of mismatching characters shown to N (default: 10)</td></tr><tr><td><pre>-p,--pairs=S</pre></td><td>set matching pairs to S (default: {}[]()“”«»‘’""'')</td></tr><tr><td><pre> --test</pre></td><td>do an internal test and exit</td></tr></table><p>
102 <h1>Description</h1>
103 Mismatches of parentheses, braces, (angle) brackets, especially in TeX sources which may be rich in those, may be difficult to trace. This little script helps you by writing your text to standard output, after adding a left margin to your text, which will normally be almost empty, but will clearly show up to 10 mismatches. (Just try me on myself to see that the parenthesis starting this sentence will not appear to be matched at the end of the file. If you look at me in the vim editor, then select this paragraph and try the command: <code>:!%</code>. <p>
104 By default, the following pairs are tested: <table><tr><td><pre>()</pre></td><td>round brackets or parentheses</td></tr><tr><td><pre>{}</pre></td><td>curly brackets or braces</td></tr><tr><td><pre>[]</pre></td><td>square brackets</td></tr><tr><td><pre>&lt;&gt;</pre></td><td>angle brackets (within html text only)</td></tr><tr><td><pre>""</pre></td><td>ASCII double quotes</td></tr><tr><td><pre>“”</pre></td><td>Unicode double quotation marks</td></tr><tr><td><pre>''</pre></td><td>ASCII single quotes</td></tr><tr><td><pre>‘’</pre></td><td>Unicode single quotation marks</td></tr></table><p>
105 The exit value of the script is 0 when there are no mismatches, 1 otherwise. <p>
106 Angle brackets are only looked for inside HTML text, where HTML is supposed to start with <code>&lt;html&gt;</code> or <code>=begin&#x2423;rdoc</code> and to end with <code>&lt;/html&gt;</code> or <code>=end</code>. <p>
107 <h1>Options</h1>
108 <table><colgroup><col style="width:10%"/><col style="width:90%"/></colgroup><tr><td></td><td></td></tr><tr><td colspan="2"><pre>-h,--help</pre></td></tr><tr><td></td><td>print short help information and exit.</td></tr><tr><td colspan="2"><pre>-H,--Help</pre></td></tr><tr><td></td><td>print full documentation via less and exit.</td></tr><tr><td colspan="2"><pre>-V,--version</pre></td></tr><tr><td></td><td>print this script's version and exit.</td></tr><tr><td colspan="2"><pre>-l,--latex</pre></td></tr><tr><td></td><td>convert <code>``...''</code> to <code>“...”</code> before testing.</td></tr><tr><td colspan="2"><pre>-n,--number=N</pre></td></tr><tr><td></td><td>Set number of mismatching characters shown to N. By default, only the first 10 are shown.</td></tr><tr><td colspan="2"><pre>-p,--pairs=S</pre></td></tr><tr><td></td><td>Set matching pairs to S (default: <code>{}[]()“”''«»""‘’</code>). For example, if you want to look for mismatching ASCII single quotes <i>only</i>, use <code>--pairs="''"</code>. Or, if you want to match braces and guillemets only, use <code>-p&#x2423;«»</code>. Note that if html is detected in your text, <code>&lt;&gt;</code> is automatically added to the pairs list. So by default, <code>&lt;...&gt;</code> is tested only in html, but you can test that in other text by specifying the <code>&lt;&gt;</code> pair in the <code>--pairs</code> option.</td></tr><tr><td colspan="2"><pre> --test</pre></td></tr><tr><td></td><td>do an internal test and exit. Note that if, with the <code>--pairs</code> option, you specify an other pairs list than the default, the test will probably fail, but you can still see the effects of your pairs list on the test data.</td></tr></table><p>
109 <h1>Examples</h1>
110 Suppose we have two files, <code>good</code> and <code>bad</code>, containing these texts: <p>
111 <table><colgroup><col style="width:10%"/><col style="width:90%"/></colgroup><tr><td></td><td></td></tr><tr><td colspan="2"><pre>good:</pre></td></tr><tr><td></td><td>This is a (simple) test without mismatches</td></tr></table><p>
112 <table><colgroup><col style="width:10%"/><col style="width:90%"/></colgroup><tr><td></td><td></td></tr><tr><td colspan="2"><pre>bad:</pre></td></tr><tr><td></td><td>This is a (simple test containing mismatches</td></tr></table><p>
113 then here are some usage examples. First a simple test on these files: <pre> $ matchparens good
114 1 || This is a (simple) test
115 2 || without mismatches
116 $ echo $?
117 0
118 $ matchparens bad
119 1 | (| This is a (simple test
120 2 | (| containing mismatches
121 $ echo $?
122 1
123 </pre>
124 <p>
125 Just report if there are mismatches: <pre> $ matchparens good &gt;/dev/null &amp;&amp; echo fine || echo problems
126 fine
127 $ matchparens bad &gt;/dev/null &amp;&amp; echo fine || echo problems
128 problems
129 </pre>
130 <p>
131 Report all tex files with mismatches in the current directory: <pre> $ for i in *.tex; do matchparens $i &gt;/dev/null || echo $i; done
132 </pre>
133 <p>
134 Matches must be in correct order: <pre> $ echo -e "This is a ([simple)] test\n" | match_parens
135 1 ([)]This is a ([simple)] test
136 2 ([)]
137 </pre>
138 <p>
139 <h1>Author</h1>
140 <a href="mailto:[email protected]">Wybo Dekker</a> <p>
141 <h1>Copyright</h1>
142 Released under the <a href="http://www.gnu.org/copyleft/gpl.html">GNU General Public License</a> </div></div></body></html>