summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/glossaries/mfirstuc-manual.html
blob: df0f837d87a902cbb55b79c519882dac21e2d5cd (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
<?xml version="1.0" encoding="utf-8" ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">  
<!--http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd-->  
<html xmlns="http://www.w3.org/1999/xhtml"  
> 
<head><title>mfirstuc.sty v1.08: uppercasing first letter</title> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<meta name="generator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)" /> 
<meta name="originator" content="TeX4ht (http://www.cse.ohio-state.edu/~gurari/TeX4ht/)" /> 
<!-- xhtml,fn-in,css-in,uni-html4,utf8 --> 
<meta name="src" content="mfirstuc-manual.tex" /> 
<meta name="date" content="2013-12-05 15:12:00" /> 
</head><body 
>
  <div class="maketitle">
                                                                    
                                                                    
                                                                    
                                                                    
<div class="minipage"><a 
 id="top"></a>
</div>

<h2 class="titleHead">mfirstuc.sty v1.08: uppercasing
first letter</h2>
          <div class="author" ><span 
class="ecrm-1440">Nicola L.C. Talbot</span>
<br />           <span 
class="ecrm-1440">Dickimaw Books</span>
<br /><a 
href="http://www.dickimaw-books.com/" class="url" ><span 
class="ectt-1440">http://www.dickimaw-books.com/</span></a></div><br />
<div class="date" ><span 
class="ecrm-1440">2013-11-04</span></div>
  </div>
<!--l. 24--><p class="indent" >  The <span 
class="ecss-1095">glossaries </span>bundle is supplied with the package <span 
class="ecss-1095">mfirstuc</span><a 
 id="dx1-2"></a> which provides the
command:
</p><!--l. 26--><p class="indent" >  <hr><div title="Definition"><span class="marginpar"><span 
class="ectt-1000">\makefirstuc</span><span 
class="ectt-1000">&#x00A0;</span></span><a 
 id="dx1-3"></a> <span 
class="ectt-1095">\makefirstuc{</span><span 
class="ecit-1095">&#x003C;stuff&#x003E;</span><span 
class="ectt-1095">} </span></div><hr>
</p><!--l. 28--><p class="noindent" >
This makes the first object of <span 
class="ecti-1095">&#x003C;stuff&#x003E; </span>uppercase unless <span 
class="ecti-1095">&#x003C;stuff&#x003E; </span>starts with a
control sequence followed by a non-empty group, in which case the first object in
the group is converted to uppercase. Examples: </p>
     <ul class="itemize1">
     <li class="itemize"><span class="obeylines-h"><span class="verb"><span 
class="ectt-1095">\makefirstuc{abc}</span></span></span> produces Abc.
     </li>
     <li class="itemize"><span class="obeylines-h"><span class="verb"><span 
class="ectt-1095">\makefirstuc{\emph{abc}}</span></span></span> produces <span 
class="ecti-1095">Abc </span>(<span 
class="ectt-1095">\MakeUppercase</span><a 
 id="dx1-4"></a> has
     been applied to the letter &#8220;a&#8221; rather than <span 
class="ectt-1095">\emph</span>). Note however
     that
                                                                    
                                                                    
     <div class="verbatim" id="verbatim-1">
     \makefirstuc{{\em&#x00A0;abc}}
</div>
     <!--l. 41--><p class="nopar" > produces <span 
class="ecti-1095">ABC </span>(first object is <span class="obeylines-h"><span class="verb"><span 
class="ectt-1095">{\em</span><span 
class="ectt-1095">&#x00A0;abc}</span></span></span> so equivalent to
     <span class="obeylines-h"><span class="verb"><span 
class="ectt-1095">\MakeUppercase{\em</span><span 
class="ectt-1095">&#x00A0;abc}</span></span></span>), and
                                                                    
                                                                    
</p>
     <div class="verbatim" id="verbatim-2">
     {\makefirstuc{\em&#x00A0;abc}}
</div>
     <!--l. 46--><p class="nopar" > produces abc (<span class="obeylines-h"><span class="verb"><span 
class="ectt-1095">\em</span></span></span> doesn&#8217;t have an argument therefore first object is <span class="obeylines-h"><span class="verb"><span 
class="ectt-1095">\em</span></span></span>
     so equivalent to <span class="obeylines-h"><span class="verb"><span 
class="ectt-1095">{\MakeUppercase{\em}abc}</span></span></span>).
     </p></li>
     <li class="itemize"><span class="obeylines-h"><span class="verb"><span 
class="ectt-1095">\makefirstuc{{\&#8217;a}bc}</span></span></span> produces &Aacute;bc.
     </li>
     <li class="itemize"><span class="obeylines-h"><span class="verb"><span 
class="ectt-1095">\makefirstuc{\ae</span><span 
class="ectt-1095">&#x00A0;bc}</span></span></span> produces &AElig;bc.
     </li>
     <li class="itemize"><span class="obeylines-h"><span class="verb"><span 
class="ectt-1095">\makefirstuc{{\ae}bc}</span></span></span> produces &AElig;bc.
     </li>
     <li class="itemize"><span class="obeylines-h"><span class="verb"><span 
class="ectt-1095">\makefirstuc{{</span><span 
class="ectt-1095">&auml;</span><span 
class="ectt-1095">}bc}</span></span></span> produces &Auml;bc.
     </li></ul>
<!--l. 60--><p class="noindent" >Note that non-Latin or accented characters appearing at the start of the text must
be placed in a group (even if you are using the <span 
class="ecss-1095">inputenc</span><a 
 id="dx1-5"></a> package) due to
expansion issues.
</p><!--l. 64--><p class="indent" >  <div class="important" title="Important Note"> In version 1.02 of <span 
class="ecss-1095">mfirstuc</span>, a bug fix resulted in a change in output if the first
object is a control sequence followed by an empty group. Prior to version 1.02,
<span class="obeylines-h"><span class="verb"><span 
class="ectt-1095">\makefirstuc{\ae{}bc}</span></span></span> produced &aelig;Bc. However as from version 1.02, it now
produces &AElig;bc. </div>
</p><!--l. 70--><p class="noindent" >
</p><!--l. 72--><p class="indent" >  Note also that
                                                                    
                                                                    
</p>
  <div class="verbatim" id="verbatim-3">
\newcommand{\abc}{abc}
&#x00A0;<br />\makefirstuc{\abc}
</div>
<!--l. 76--><p class="nopar" > produces: ABC. This is because the first object in the argument of
<span 
class="ectt-1095">\makefirstuc </span>is <span 
class="ectt-1095">\abc</span>, so it does <span class="obeylines-h"><span class="verb"><span 
class="ectt-1095">\MakeUppercase{\abc}</span></span></span>. Whereas:
                                                                    
                                                                    
</p>
  <div class="verbatim" id="verbatim-4">
\newcommand{\abc}{abc}
&#x00A0;<br />\expandafter\makefirstuc\expandafter{\abc}
</div>
<!--l. 83--><p class="nopar" > produces: Abc. There is a short cut command which will do this:
</p><!--l. 85--><p class="indent" >  <hr><div title="Definition"><span class="marginpar"><span 
class="ectt-1000">\xmakefirstuc</span><span 
class="ectt-1000">&#x00A0;</span></span><a 
 id="dx1-6"></a> <span 
class="ectt-1095">\xmakefirstuc{</span><span 
class="ecit-1095">&#x003C;stuff&#x003E;</span><span 
class="ectt-1095">} </span></div><hr>
</p><!--l. 87--><p class="noindent" >
This is equivalent to <span 
class="ectt-1095">\expandafter\makefirstuc\expandafter{</span><span 
class="ecti-1095">&#x003C;stuff&#x003E;</span><span 
class="ectt-1095">}</span>.
So
                                                                    
                                                                    
</p>
  <div class="verbatim" id="verbatim-5">
\newcommand{\abc}{abc}
&#x00A0;<br />\xmakefirstuc{\abc}
</div>
<!--l. 92--><p class="nopar" > produces: Abc.
</p><!--l. 97--><p class="indent" >  <div class="important" title="Important Note"> <span 
class="ectt-1095">\xmakefirstuc </span>only performs one level expansion on the first object in its
argument. It does not fully expand the entire argument. </div>
</p><!--l. 101--><p class="noindent" >
</p><!--l. 103--><p class="indent" >  If you use <span 
class="ecss-1095">mfirstuc </span>without the <span 
class="ecss-1095">glossaries</span><a 
 id="dx1-7"></a> package, the standard <span 
class="ectt-1095">\MakeUppercase</span>
command is used. If used with <span 
class="ecss-1095">glossaries</span><a 
 id="dx1-8"></a>, <span 
class="ectt-1095">\MakeTextUppercase</span><a 
 id="dx1-9"></a> (defined by
<span 
class="ecss-1095">textcase</span><a 
 id="dx1-10"></a> the package) is used instead. If you are using <span 
class="ecss-1095">mfirstuc </span>without the
<span 
class="ecss-1095">glossaries </span>package and want to use <span 
class="ectt-1095">\MakeTextUppercase</span><a 
 id="dx1-11"></a> instead, you can
redefine
</p><!--l. 109--><p class="indent" >  <hr><div title="Definition"><span class="marginpar"><span 
class="ectt-1000">\glsmakefirstuc</span><span 
class="ectt-1000">&#x00A0;</span></span><a 
 id="dx1-12"></a> <span 
class="ectt-1095">\glsmakefirstuc{</span><span 
class="ecit-1095">&#x003C;text&#x003E;</span><span 
class="ectt-1095">} </span></div><hr>
</p><!--l. 111--><p class="noindent" >
For example:
                                                                    
                                                                    
</p>
  <div class="verbatim" id="verbatim-6">
\renewcommand{\glsmakefirstuc}[1]{\MakeTextUppercase&#x00A0;#1}
</div>
<!--l. 115--><p class="nopar" > Remember to also load <span 
class="ecss-1095">textcase</span><a 
 id="dx1-13"></a> (<span 
class="ecss-1095">glossaries </span>loads this automatically).
</p><!--l. 119--><p class="indent" >  New to mfirstuc v1.06:
</p><!--l. 120--><p class="indent" >  <hr><div title="Definition"><span class="marginpar"><span 
class="ectt-1000">\capitalisewords</span><span 
class="ectt-1000">&#x00A0;</span></span><a 
 id="dx1-14"></a> <span 
class="ectt-1095">\capitalisewords{</span><span 
class="ecit-1095">&#x003C;text&#x003E;</span><span 
class="ectt-1095">} </span></div><hr>
</p><!--l. 122--><p class="noindent" >
This command apply <span 
class="ectt-1095">\makefirstuc</span><a 
 id="dx1-15"></a> to each word in <span 
class="ecti-1095">&#x003C;text&#x003E; </span>where the space
character is used as the word separator. Note that it has to be a plain space
character, not another form of space, such as <span class="obeylines-h"><span class="verb"><span 
class="ectt-1095">~</span></span></span> or <span 
class="ectt-1095">\space</span>. Note that no
expansion is performed on <span 
class="ecti-1095">&#x003C;text&#x003E;</span>.
</p><!--l. 129--><p class="indent" >  <hr><div title="Definition"><span class="marginpar"><span 
class="ectt-1000">\xcapitalisewords</span><span 
class="ectt-1000">&#x00A0;</span></span><a 
 id="dx1-16"></a> <span 
class="ectt-1095">\xcapitalisewords{</span><span 
class="ecit-1095">&#x003C;text&#x003E;</span><span 
class="ectt-1095">} </span></div><hr>
</p><!--l. 131--><p class="noindent" >
This is a short cut for <span 
class="ectt-1095">\expandafter\capitalisewords\expandafter{</span><span 
class="ecti-1095">&#x003C;text&#x003E;</span><span 
class="ectt-1095">}</span>.
</p><!--l. 135--><p class="indent" >  <div class="important" title="Important Note"> If you are using <span 
class="ecss-1095">hyperref</span><a 
 id="dx1-17"></a> and want to use <span 
class="ectt-1095">\capitalisewords </span>or <span 
class="ectt-1095">\makefirstuc</span><a 
 id="dx1-18"></a>
(or <span 
class="ectt-1095">\xcapitalisewords</span>/<span 
class="ectt-1095">\xmakefirstuc</span>) in a section heading, the PDF
bookmarks won&#8217;t be able to use the command as it&#8217;s not expandable, so you will
get a warning that looks like:
                                                                    
                                                                    
</p>
  <div class="verbatim" id="verbatim-7">
Package&#x00A0;hyperref&#x00A0;Warning:&#x00A0;Token&#x00A0;not&#x00A0;allowed&#x00A0;in&#x00A0;a&#x00A0;PDF&#x00A0;string&#x00A0;(PDFDocEncoding):
&#x00A0;<br />(hyperref)&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;&#x00A0;removing&#x00A0;&#8216;\capitalisewords&#8217;
</div>
<!--l. 143--><p class="nopar" > If you want to provide an alternative for the PDF bookmark, you can use
<span 
class="ecss-1095">hyperref</span><a 
 id="dx1-19"></a>&#8217;s <span 
class="ectt-1095">\texorpdfstring</span><a 
 id="dx1-20"></a> command. See the <span 
class="ecss-1095">hyperref</span><a 
 id="dx1-21"></a> manual for further
details. </div>
</p><!--l. 147--><p class="noindent" >
</p><!--l. 149--><p class="indent" >  Examples:
     </p><ol  class="enumerate1" >
     <li 
  class="enumerate" id="x1-23x1">
                                                                    
                                                                    
     <div class="verbatim" id="verbatim-8">
     \capitalisewords{a&#x00A0;book&#x00A0;of&#x00A0;rhyme.}
</div>
     <!--l. 154--><p class="nopar" > produces: A Book Of Rhyme.
     </p></li>
     <li 
  class="enumerate" id="x1-25x2">
                                                                    
                                                                    
     <div class="verbatim" id="verbatim-9">
     \capitalisewords{a&#x00A0;book\space&#x00A0;of&#x00A0;rhyme.}
</div>
     <!--l. 161--><p class="nopar" > produces: A Book of Rhyme.
     </p></li>
     <li 
  class="enumerate" id="x1-27x3">
                                                                    
                                                                    
     <div class="verbatim" id="verbatim-10">
     \newcommand{\mytitle}{a&#x00A0;book\space&#x00A0;of&#x00A0;rhyme.}
     &#x00A0;<br />\capitalisewords{\mytitle}
</div>
     <!--l. 169--><p class="nopar" > produces:  A BOOK OF RHYME. (No expansion is performed on
     <span 
class="ectt-1095">\mytitle</span>, so <span 
class="ecti-1095">&#x003C;text&#x003E; </span>consists of just one &#8220;word&#8221;.) Compare with next
     example:
     </p></li>
     <li 
  class="enumerate" id="x1-29x4">
                                                                    
                                                                    
     <div class="verbatim" id="verbatim-11">
     \newcommand{\mytitle}{a&#x00A0;book\space&#x00A0;of&#x00A0;rhyme.}
     &#x00A0;<br />\xcapitalisewords{\mytitle}
</div>
     <!--l. 180--><p class="nopar" > produces: A Book of Rhyme.
</p>
     </li></ol>
   
</body></html>