summaryrefslogtreecommitdiff
path: root/macros/latex/contrib/showlabels/showlabels.html
blob: fbdf4164b0bd8d3bcfff3552f7595c16635e1c6b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
<?xml version="1.0"?>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Showlabels</title>
<link href="https://nxg.me.uk" rev="author"/>
<!-- content of style file, to make this document standalone... -->
<style type='text/css'>
/* Installed from repo: 2021-09-14T22:35:45+01:00, Hg:1d9954537983 */

body {
  color: #333;
  background: white;
  margin-left: +30%;
  width: 50%;            /* body is 50% of screen width */
  padding: 0.5em;        /* this will make a difference if I decide to
  			    have the background a different colour */
  /* I can't decide on font: Optima's always nice, but Gill looks
     agreeably intense.  Helvetica's a decent fallback. */
  font-family: "Helvetica Neue", Helvetica, "Gill Sans", gill, sans-serif;
  /* font-family: Optima, "Gill Sans", gill, Helvetica, sans-serif; */
  /* font-family: "Gill Sans", gill, Helvetica, sans-serif; */
  /* I seem to have used 11pt at some point in the past, but this
     is far too big -- did I ever have a reason for that, or is it
     just due to browser changes? */
  font-size: 10pt;
  line-height: 150%;
}

/* adapt to wider screens */
@media screen and (min-width: 700pt) {
    body {
        margin-left: 210pt;
        width: 350pt;
    }
}

/* The following appears not to work in Safari or Chrome
   -- don't know why, yet.
@media print {
    @page :right {
        size: auto;
        body {
            margin-top: 2cm;
            margin-bottom: 3cm;
            margin-left: 10%;
            width: 60%;
            margin-right: 30%;
            color: #d33;
        }
    }
    @page :left {
        size: auto;
        body {
            margin-top: 2cm;
            margin-bottom: 3cm;
            margin-left: 30%;
            width: 60%;
            margin-right: 10%;
            color: #33d;
        }
    }
}
*/

/* The class='topsidebar' is formatting, typically div or ul,
   for auxiliary stuff, placed at the top of the right-hand column.
   The element with this class should go just _after_ the <h1> heading. */
.topsidebar {
    float: right;
    width: 50%;                 /* ...of the body width (ie, 50% x 50% of screen) */
    font-size: smaller;
    line-height: 140%;          /* ...of the font size*/
    margin-left: 1em;
    padding-left: 1em;
    border-left: solid thin #AAA;
}

/*
I have in the past styled `.topsidebar li` like this,
but I think this is too much detail for this location:
I should restrict the styling here to the location and general appearance of the sidebar
and I should leave such details to more local stylesheets
(and in any case I think it's only my blog that actually uses this class)
.topsidebar li {
    list-style-type: none;
    text-align: right;
    line-height: 150%;
}
*/

/* On wider screens, move the sidebar out to the right hand side */
/* This uses CSS3 media queries: http://www.w3.org/TR/css3-mediaqueries/ */
@media screen and (min-width: 700pt) and (max-width: 850pt) {
    body {
        margin-left: 210pt;
        width: 350pt;           /* 50% of 700pt */
        margin-right: auto;
    }
    .topsidebar {
        position: absolute;
        /* I feel this size should be 595pt (350 + 210 + 0.05*700),
           but that's clearly not right -- I don't think I understand what the -5%
           in the h1 spec below is actually 5% of! */
        left: 570pt;
        width: auto;
        margin-left: 0pt;
        padding-left: 0pt;
        border: none;
    }
    /* .topsidebar li { text-align: center; } */
}
/* On still-wider screens, expand the left-margin, keeping the sidebar attached to the right-hand edge.
   When the screen is 850pt wide (expanding from the @media case above),
   the left margin will be 210pt, the width 350pt, and the right margin therefore 290pt.*/
@media screen and (min-width: 850pt) {
    body {
        margin-right: 290pt;    /* 290 = 850-(210+350) */
        width: 350pt;
        margin-left: auto;      /* ...takes up the slack */
    }
    .topsidebar {
        position: absolute;
        width: 290pt;           /* same 290pt as above */
        left: auto;
        right: 0%;
        padding-left: 0pt;
        border: none;
    }
    /* .topsidebar li { text-align: center; } */
}


code, pre {
  font-family: Monaco, fixed;
  font-size: 9pt;
}

a { text-decoration: none; }
a:link { color: #66C; }
a:visited { color: #669; }
a[href]:hover { background: #EEE; }

div.abstract {
  font-style: oblique;
  text-align: left;
}
div.abstract em { font-style: normal; }
div.abstract code {
  font-style: normal;
  font-size: 80%;
}

/* a span/div style for attracting attention */
.attention {
  color: #822;
}

h1, h2, h3, h4, h5, h6 {
  color: #822;
  font-weight: 100;             /* few fonts have ultra-light weights */
  line-height: 100%;            /* no need to spread out titles */
}

h1 {
  margin-left: -40%;
  margin-right: -5%;
  padding: 0.5em;
  border: solid thin #666;
  text-align: right;
}

h2 {
  margin-left: -40%;
  margin-right: -5%;
  padding: 0.2em;
  border-top: solid thin #666;
  clear: both;
}

h2.appendices {
  margin-top: 10ex;
  border-top: double medium #666;
}

h3 {
  margin-left: -30%;
  float: left;
  width: 25%;
  display: block;
  text-align: right;
  vertical-align: bottom;
  padding-top: 0pt;
  padding-right: 0.5em;
  margin-top: 0pt;
  line-height: 120%;
}

/*
h4 {
  color: #C66;
}
*/

pre, table { background: #dde; }

pre {
  padding: 1em;
  line-height: 130%;
}

table {
  font-size: smaller;
}
td {
  padding: 0.5ex;
}

Q:before { content: "“"; }
Q:after  { content: "”"; }

img.smallimage {
  float: right;
  margin: 24pt;
  margin-right: -30%;
}

div.signature {
  margin-left: -40%;
  margin-right: -5%;
  margin-top: 4ex;
  text-align: right;
  border-top: solid thin #666;
  padding-top: 0.3em;
  clear: both;
}

/* ============================================================
 * Some other curiosities of my one-time formatting for web pages
 */
.doc-history {
  font-size: xx-small;
  background: #eee;
  line-height: 100%;
}

div.subtoc, div.subsubtoc { display: none; }

/* ============================================================
 * Special formatting for ToC
 */

/*
  If there's significant amount of text in front of the first subsection,
  then the following are good to put in the per-document stylesheet:
  width: 25%;
  float: right;
*/
div#toc {
  color: #888;
  padding: 0;
  font-size: smaller;
  text-align: right;
}
div#toc a:link { color: #888; }
div#toc > ul {
  padding: 0pt;
  margin: 0pt;
  list-style: none;
}
div#toc li {
  padding: 0pt;
  display: inline-block;
}
div#toc li:before {
  content: "§ ";
  margin-left: 1em;
}
/* the following elements aren't currently generated by structure.lx */
div#toc li ul {
  padding-left: 1em;
  margin-left: 0;
  font-style: italic;
  display: inline;
}
div#toc li ul:before {
  content: "( ";
}
div#toc li ul:after {
  content: " ) ";
}
div#toc li li {
  padding-left: 0pt;
}
div#toc li li:after {
  content: "; ";
}
</style>
<style type='text/css'>
/* a span/div style for attracting attention */
.attention {
  color: #822;
}
</style>
</head>

<body>
<h1>Showlabels</h1>
<div class="abstract">
<p>Put the names of <code>\label</code>s and other commands into
the margins of a draft document.</p>
<!-- This is revision 5b2959804f35, 2021-10-09T20:59:45+01:00 -->
<p>Version 1.9, 2021 October  9,
  <a href='http://purl.org/nxg/dist/showlabels'
    ><code>http://purl.org/nxg/dist/showlabels</code></a>.</p>
</div>

<p>This class option helps you keep track of all the labels in your
documents, by putting the name of the new label into the margin
whenever either the <code>\label</code> command is used, or an
equation is automatically numbered.  It is compatible with the
<code>amsmath</code> and <code>hyperref</code> packages.</p>

<p>You invoke this package with the command
<code>\usepackage{showlabels}</code> in the preamble.  You can control
where the labels appear &#x2013; in the margins or in the interline gaps &#x2013;
and you can change the appearance of the formatted labels to some
extent.</p>

<p>As well, you can have the arguments to other commands besides
<code>\label</code> displayed.  This is fairly obviously useful for
the <code>\cite</code> command, but it can be useful for
<code>\ref</code> or <code>\begin</code> as well.</p>

<p>The package will also work in the presence of the
<code>[twocolumn]</code> option.  In this case, the options
<code>[inner]</code> and <code>[outer]</code> will be ignored, and the
label will be placed in the nearer margin.</p>

<h3>Compatibility and problems</h3>

<p>For reasonably obvious reasons, this package will <em>not</em> work at
all well with the multicol package, and for possibly less obvious
reasons, it won't work with the <code>[leqno]</code> option either (at
some point it should be modified to at least recognise and warn of the
conflict in either case).  The package can occasionally place labels
in the wrong margins, near the top of a page &#x2013; see the documentation
for a discussion of this.</p>

<p>The <code>{showlabels}</code> package has a large overlap in
functionality with David Carlisle's <code>{showkeys}</code>, although
the latter will only handle <code>\label</code> and <code>\cite</code> keys.  If
<code>{showlabels}</code> fails in some particular situation, you might
want to try using <code>{showkeys}</code>, but please do mention the
problem, typically by email to me.</p>

<h3>Download and installation</h3>

<ol>
<li>Download the file
<a href="showlabels-1.9.tar.gz" >showlabels-1.9.tar.gz</a>
or
<a href="showlabels-1.9.zip" >showlabels-1.9.zip</a>
and unpack it.</li>

<li>Run LaTeX on the file <code>showlabels.ins</code> &#x2013; this will
unpack the style file <code>showlabels.sty</code> amongst other files.
Place this somewhere where TeX can find it. </li>

<li>Run LaTeX on the file <code>showlabels.dtx</code> to obtain the
documentation.</li>
</ol>

<p>Links:</p>
<ul>
<li>Canonical package home page:
<a href="http://purl.org/nxg/dist/showlabels"
  ><code>http://purl.org/nxg/dist/showlabels</code></a></li>

<li>On CTAN:
<a href='https://www.ctan.org/pkg/showlabels'
  >macros/latex/contrib/showlabels</a></li>

<li>The source code for the package is maintained
<a href='https://hg.sr.ht/~nxg/showlabels'>online</a>
at <a href='https://sourcehut.org'>Sourcehut</a>.</li>

<li>There's an <a href='https://todo.sr.ht/~nxg/showlabels'>issue
tracker</a> there (the issues which had accumulated on the bitbucket
tracker were effectively lost when Bitbucket dropped support for
Mercurial; there were few outstanding ones anyway).  Or you can just
mail me.</li>

</ul>

<p>This work is Copyright 1999, 2001-09, 2013-21, Norman Gray, and may be distributed and/or modified under the
conditions of the <a href='http://www.latex-project.org/lppl.txt'>LaTeX Project Public Licence</a>,
either version 1.3 of this licence or (at your option) any later version.</p>

<h2>History</h2>
<!-- @RELEASENOTES@ -->
<h:dl xmlns:h="http://www.w3.org/1999/xhtml">

<h:dt><h:span class="attention">1.9, 2021 October 9</h:span></h:dt><h:dd>
<ul xmlns="http://www.w3.org/1999/xhtml">
  <li>Robustness fix: macros in arguments are now handled, so that
  (after <code>\showlabel{index}</code>),
  <code>\index{Poincar\'e}</code> doesn't cause an error.</li>
  <li>The <code>\showlabel[optarg]{command}</code> optional argument
  can now take a one-argument command.</li>
  <li>The macro <code>\showlabeltype</code> expands to the current
  label type, for possible use in <code>\showlabelsetlabel</code>.</li>
  <li>The code has moved from Bitbucket to
  <a>Sourcehut</a>: the new repository is
  <a>https://hg.sr.ht/~nxg/showlabels</a>.
  The issues links in the list below are therefore broken.</li>
</ul>
</h:dd>

<h:dt>1.8, 2016 June 9</h:dt><h:dd>
<p xmlns="http://www.w3.org/1999/xhtml">The <code>ntheorem</code> package exposed an apparently
long-standing incompleteness in the handling of <code>amsmath</code>
documents.
Fixes <a>issue 9</a>.</p>
</h:dd>

<h:dt>1.7, 2015 December 8</h:dt><h:dd>
<p xmlns="http://www.w3.org/1999/xhtml">Release v1.7.</p>
</h:dd>

<h:dt>1.7b2, 2015 December 7</h:dt><h:dd>
<p xmlns="http://www.w3.org/1999/xhtml">Make the combination of amsmath and [inline] mode work
(fixes <a>issue 8</a>
– thanks to A L Dukeman for the report;
what is it about showlabels and 6 December?!).</p>
</h:dd>

<h:dt>1.7b1, 2014 December 6</h:dt><h:dd>
<p xmlns="http://www.w3.org/1999/xhtml">This is a much-delayed bugfix release (by coincidence
<em>exactly</em> a year after the previous release!).</p>
<ul xmlns="http://www.w3.org/1999/xhtml">
<li>Give <code>\showlabels</code> an optional formatting argument
(implements <a>issue 1</a>
– thanks to Francesco Biccari for the suggestion).</li>
<li>Special-case the IEEEtrantools package
(fixes <a>issue 2</a>
– thanks to Boris Kheyfets for the report and test case, and to
Ben William Carabelli for additional analysis and a draft fix).</li>
<li>The <code>[final]</code> option now works with the
<code>{amsmath}</code> package
(fixes <a>issue 3</a>
– thanks to Guillermo Garza and Enno Nagel for the report, and to
Guillermo for the test case).</li>
<li>Handle the hyperref package's <code>\ref*{label}</code> variant
(fixes <a>issue 4</a>
– thanks to Alex Watson for the report and test case).</li>
<li>Handle the case where a label is in a display, but not in maths mode
(fixes <a>issue 5</a>
– thanks to ‘bartgol’ on Stackexchange for the report and test case).</li>
</ul>
</h:dd>

<h:dt>1.6.6, 2013 December 6</h:dt><h:dd>
<ul xmlns="http://www.w3.org/1999/xhtml">
<li>Add configuration interface <code>\showlabelrefline</code> and
ensure that <code>\color</code> works in
<code>\showlabelfont</code>.</li>
<li>Various documentation tweaks</li>
<li>Change licence from GPL to LPPL</li>
<li>Fix link to repository</li>
</ul>
</h:dd>

<h:dt>1.6.5, 2009 May 27</h:dt><h:dd>
<p xmlns="http://www.w3.org/1999/xhtml">Fixed a bug in the way that labels including underscores (and
other ‘exotic’ characters) were displayed.</p>
</h:dd>

<h:dt>1.6.4, 2008 October 10</h:dt><h:dd>
<p xmlns="http://www.w3.org/1999/xhtml">Fixed another poor interaction between eqnarray and amsart.  Now
we get equation labels in eqnarray, and we don't get marginal notes
about <code>\eqref</code> (which is good; might this finally be fixed?).</p>
</h:dd>

<h:dt>1.6.3, 2008 July 24</h:dt><h:dd>
<p xmlns="http://www.w3.org/1999/xhtml">Release 1.6.2 broke compatibility with the <em>rest</em> of
amsmath (<code>eqnarray</code> became the only thing that worked
within amsmath)!  Fixed.  Doh!</p>
</h:dd>

<h:dt>1.6.2, 2008 June 27</h:dt><h:dd>
<p xmlns="http://www.w3.org/1999/xhtml">The reimplementation of eqnarray within amsart was such that
equation labels disappeared in that case.  Fixed.</p>
</h:dd>

<h:dt>1.6.1, 2007 June 17</h:dt><h:dd>
<p xmlns="http://www.w3.org/1999/xhtml">Fix an errant test, which mangled equation labels starting
with two identical letters.</p>
</h:dd>

<h:dt>1.6, 2006 May 26</h:dt><h:dd>
<p xmlns="http://www.w3.org/1999/xhtml">The <code>\showlabels</code> command will now work with commands
  (such as <code>\cite</code> or <code>\includegraphics</code>) which
  take an optional argument.</p>
</h:dd>

<h:dt>1.5a, 2005 March 17</h:dt><h:dd>
<p xmlns="http://www.w3.org/1999/xhtml">Defined <code>\showlabelfont</code> using
<code>\ttfamily</code> rather than <code>\tt</code> (I'd
avoided doing this before to avoid a seemingly pointless
incompatibility with LaTeX 2.09, but (a) I imagine the
package is incompatible with that for other reasons, and (b)
it's really not worth the hassle...).</p>
</h:dd>

<h:dt>1.5, 2004 October 8</h:dt><h:dd>
<p xmlns="http://www.w3.org/1999/xhtml">Added <code>\showlabelfont</code> and
<code>\showlabelsetlabel</code> commands, allowing
customisation of the printed labels.  Added and documented
options [final], [draft] (the former makes this package do
nothing; the latter is the default behaviour).</p>
</h:dd>

<h:dt>1.4a, 2003 January 28</h:dt><h:dd>
<p xmlns="http://www.w3.org/1999/xhtml">Acquired the <code>[left]</code> and
<code>[right]</code> options, and fixed a bug which affected
<code>\label</code> commands in captions.</p>
</h:dd>

<h:dt>1.4, 2001 July 24</h:dt><h:dd>
<p xmlns="http://www.w3.org/1999/xhtml">Became (more) compatible with the
wrapfig package.  Also, I added the
<code>\showlabels</code> command, to have the package display
references to commands other than <code>\label</code>
(<code>\cite</code> and <code>\ref</code> are obvious ones),
and an <code>[inline]</code> option to have labels (etc.)
displayed inline where possible, rather than always in the
margin.</p>
</h:dd>

<h:dt>1.3e, 2001 May 30</h:dt><h:dd>
<p xmlns="http://www.w3.org/1999/xhtml">Became compatible with the hyperref package in
particular, and in general with other packages which
themselves modify the <code>\label</code> command.  This will
work, however, only if the showlabels package is loaded after
other packages which do this.  Notwithstanding Sebastian
Rahtz's excellent general advice on this, showlabels should
indeed be loaded after hyperref.</p>
</h:dd>

<h:dt>1.3e, 2001 May 31</h:dt><h:dd>
<p xmlns="http://www.w3.org/1999/xhtml">After a long delay, here is an updated version of my showlabels
package.  It corrects all the reported bugs which I could reproduce,
namely:</p>
<ul xmlns="http://www.w3.org/1999/xhtml">
<li>The package now formats labels correctly when the
<code>\label</code> command appears outside either an equation or a
<code>\caption</code> (silly of me).</li>

<li>A couple of people reported problems in the interaction with the
amsmath package.  Either these were confined to that package's earlier
incarnations as AMS-LaTeX or the amstex package, or else there's some
arcane circumstance I can't reproduce, so I haven't found anything to
fix on this matter.  Note that the
<code>\usepackage{showlabels}</code> command must come <em>after</em>
the <code>\usepackage{amsmath}</code> command.  Bug-sightings here
will be warmly appreciated.</li>

<li>I haven't worried too much about the precise formatting of the
labels – this is, after all, supposed to be a draft-only
package.</li>
</ul>
</h:dd>

<h:dt>1.1, 2001 January 1</h:dt><h:dd>
<p xmlns="http://www.w3.org/1999/xhtml">Modified to conform to the slightly
different mechanism that <code>amsmath</code> uses to produce equation
numbers.  I don't habitually use <code>amsmath</code>, so I won't
discover any bugs or weaknesses with its support here, and I'd
consequently be glad to be informed of any that appear.  Do note that
the <code>\usepackage{showlabels}</code> command <em>must</em> appear
after the <code>\usepackage{amsmath}</code> if it is to detect that
you are using the amsmath package.  Note also that, since these
additions appeared, AMS-LaTeX and the <code>amstex</code> package seem
to have been declared ‘obsolete’ in favour of the <code>amsmath</code>
package.  This package now claims conformance with the
<code>amsmath</code> package alone, though it will probably work with
older versions in fact.</p>
</h:dd>

<h:dt>Updated, 1992 January 29</h:dt><h:dd>
<p xmlns="http://www.w3.org/1999/xhtml">On 1992 January 29, Darrel Hankerson
(<code>hank@ducvax.auburn.edu</code>), made the update to NFSS, and
changed the name to <code>showlabel.sty</code>.</p>
  </h:dd>

<h:dt>Original, 1991 September 21</h:dt><h:dd>
<p xmlns="http://www.w3.org/1999/xhtml">The package was originally released by me on 1991 September 21, under the name
<code>labels.sty</code>.</p>
</h:dd>

</h:dl>

<div class="signature">
<a href="http://www.astro.gla.ac.uk/users/norman/"
	>Norman Gray</a><br/>
2021 October  9
</div>

</body>
</html>




<!-- Local Variables: -->
<!-- mode: nxml -->
<!-- End: -->