summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/latex/scalerel/scalerel.tex
blob: cd153d1fa66ee0898c8b80b44121decafdd92a7a (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
\documentclass{article}
\def\version{1.4}
%% Copyright 2013 Steven B. Segletes
%
% This work may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.3
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.3c or later is part of all distributions of LaTeX
% version 2005/12/01 or later.
%
% This work has the LPPL maintenance status `maintained'.
%
% The Current Maintainer of this work is Steven B. Segletes.

% V1.01 Correct typos in documentation
% V1.1  Corrected usepackage dependencies; Significant doc rewrite.
% V1.11 Corrected typo in documentation
% V1.2  Added \scaleleftright and \stretchleftright; revised docs.
% V1.3  Corrected missing % in stretch routines, added \hstretch and
%       \vstretch commands; fixed version number in .sty file
% V1.4 -Auto-detect mathmode and style; use the proper math display
%       style; Allow \ignoremathstyle and \discernmathstyle to
%       revert to former approach in rare cases and return to new
%       approach.
%      -Added \Isnextbyte as a supplemental routine
%      -Added \scaleobj (like \scalebox, but defaults to math mode
%       using current display style).
\parskip 1em
\parindent 0em
\newcommand\rl{\rule{2em}{0in}}
\usepackage{scalerel}
\usepackage{verbatim}
\usepackage[only,llbracket,rrbracket,llparenthesis,rrparenthesis]{stmaryrd}
\usepackage{accsupp} % for ensuring the right Unicode codepoint upon pasting
\def\sr{\textsf{scalerel}}

\begin{document}
\begin{center}
\LARGE The \textsf{scalerel} Package\\
\rule{0em}{.7em}\small Routines for constrained scaling and stretching
of objects,\\relative to a reference object or in absolute terms\\
\rule{0em}{2.7em}\large Steven B. Segletes\\
steven.b.segletes.civ@mail.mil\\
\rule{0em}{1.7em}\today\\
v\version
\end{center}

\section{Commands and Description}
The \textsf{scalerel} package is used to scale and vertically stretch
objects, either relative to other objects, or in absolute terms.  Its
commands may be invoked in either math mode or text mode (if there is no
math in the objects to manipulate); however, the objects it manipulates
will, by default, be processed in math mode.  Nonetheless, one may
process the objects in text mode (assuming they do not contain
math-specific characters or commands) by specifying arguments as
\verb|{$object$}|, instead of the usual \verb|{object}|.

There are four basic commands with the \textsf{scalerel} package, two
of which have star variants:
\begin{verbatim}
  \scalerel[*][max_width]{object}{reference}
  \stretchrel[*][min_aspect]{object}{reference}
  \scaleto[max_width]{object}{height}
  \stretchto[min_aspect]{object}{height}
\end{verbatim} 
In addition, there are a number of added commands that have been
implemented as composites of the four basic commands, they are
\begin{verbatim}
  \scaleleftright[max_width]{left-obj.}{reference}{right-obj.}
  \stretchleftright[min_aspect]{left-obj.}{reference}{right-obj.}
  \hstretch{scale}{object}
  \vstretch{scale}{object}
  \scaleobj{scale}{object}
\end{verbatim}
There are also several auxiliary commands, supporting backward
compatibility, \textit{etc.}:
\begin{verbatim}
  \ignoremathstyle
  \discernmathstyle
  \Isnextbyte[[v] OR q]{test byte}{string}
\end{verbatim}

In all cases, \verb|object| is the object to be scaled or 
stretched.  It can be as simple as a symbol, like a summation sign
($\sum$), or it can be an object of complex description.  Likewise, in
cases of \textit{relative} scaling and stretching, \verb|reference| is
the reference object in relation to which the manipulated
\verb|object| is scaled or vertically stretched.  The \verb|reference|
may likewise be of complex description (such as a mathematical
expression).  When an \verb|object| is scaled or stretched
\textit{relative} to a \verb|reference| object, it is also vertically
shifted, if necessary, so that its vertical extent conforms to that of
the \verb|reference| object.

In cases of scaling or stretching \textit{to} a specified size,
\verb|height| will the final vertical height of \verb|object| following
a scale or stretch manipulation.  Since scaling or stretching to an
absolute size provides no \verb|reference| object, the baseline of
manipulated \verb|object| remains unchanged.

In cases of scaling (relative or absolute), the constraint
\verb|max_width| is optionally specified as the maximum width allowable
for the manipulated object.  If the manipulated width would otherwise
exceed this limit, the
\verb|object| width is scaled back to this limit.  If the \verb|object|
width is scaled back, its aspect ratio will change with respect to its
original shape.

By definition, vertical stretching will change the aspect ratio of an
object.  In the case of stretching (relative or absolute), the
constraint \verb|min_aspect| is the minimum aspect ratio allowed by the
stretch.  Its value is given in \%, such that a parameter value of
\texttt{100} indicates 100\% or an aspect ratio of 1.  If the stretch
would otherwise cause the manipulated \verb|object|'s aspect ratio to
fall below this value, the width of the manipulated \verb|object| is
increased to meet this minimum threshold.  The value of
\verb|min_aspect| must be an integer.

Because \textit{relative} scaling or stretching is done
\textit{relative} to a reference object, the \verb|\scalerel| and
\verb|\stretchrel| commands will, by default, print out the
manipulated \verb|object| followed immediately by the \verb|reference|
object.  Because this may not always be desired, the star (*) version of
these commands suppresses the output of the \verb|reference| object, so
that only the \verb|object| that was manipulated is output.

The \verb|\scaleleftright| and \verb|\stretchleftright| commands are
intended to provide the functional capability of the \verb|\left| and
\verb|\right| commands in math mode, for delimiting symbols not
otherwise supported by those commands.

The \verb|\hstretch| and \verb|\vstretch commands| merely take the
second argument and either horizontally or vertically stretch it by a
scale factor given by the first argument.  The scale is not given in
percent, like some aforementioned commands.  Remember also, that these
commands are, by default processed in math mode.  In a like manner,
\verb|\scaleobj| performs a scale of the object.  It is like the
\verb|\scalebox| command of the \textsf{graphicx} package, except that
its argument (like others in this package) defaults to math mode, and is
displayed in the current math display style.

As of version 1.4, {\sr} commands will autodetect the current math
display style and process its arguments in the same mode.  However, this
improvement could ``break'' a prior (rare but) accepted usage of the
package in which the {\sr} \verb|object| is given in mixed mode
(containing \verb|$| characters in the middle of the \verb|object|.  In
order to maintain backward compatibility, the user may invoke
\verb|\ignoremathstyle|.  Thereafter, {\sr} objects will be processed in
the prior (pre-version 1.4) manner, until the command
\verb|\discernmathstyle| is later invoked to restore the more modern
package settings.

A service routine \verb|\Isnextbyte| was employed by this package.
Because of its more general utility, it is made accessible to the user.
It is an improved version of the command \verb|\isnextbyte| from the
\textsf{stringstrings} package.  It will determine if the first
byte from a passed string argument matches a specified
\textit{match}-character.  It produces a \verb|T| or \verb|F| result,
which is printed out by default.  With the use of the \verb|q| optional
argument, the output can be suppressed, with the result instead being
stored in a macro \verb|\theresult|.

\section{Usage Examples}

Now for a few examples.  Let us define
\begin{verbatim}
    \def\preblob{\displaystyle\sum_{i=0}^3}
    \def\blob{\displaystyle\frac{\displaystyle\frac{x^3}{z+r^3}}%
              {\displaystyle\frac{y}{x^2}}%
    }
\end{verbatim}
    \def\preblob{\displaystyle\sum_{i=0}^3}
    \def\blob{\displaystyle\frac{\displaystyle\frac{x^3}{z+r^3}}%
              {\displaystyle\frac{y}{x^2}}%
    }
Here are the raw definitions of \verb|$\preblob\blob$|, unscaled:

    \rl$\preblob\blob$

\subsection{The $\backslash$\texttt{scalerel} Command}

Now we employ \verb|$\scalerel{\preblob}{\blob}$|

    \rl$\scalerel{\preblob}{\blob}$

If we wish constrain the width of the summation to 3ex, we employ\\
\verb|$\scalerel[3ex]{\preblob}{\blob}$|

    \rl$\scalerel[3ex]{\preblob}{\blob}$

Of course, if the manipulated object contains text symbols, a width
constraint will change their aspect ratio, which may not be desirable.

Now let's say you wanted to introduce notation to bound mathematical
expressions by triangles. After defining
\verb|\blob| as before, you could use\\
\verb|$\scalerel[3ex]{\triangleleft}{\blob}|\\
\verb|\scalerel*[3ex]{\triangleright}{\blob}$|

\rl%
$\scalerel[3ex]{\triangleleft}{\blob}\scalerel*[3ex]{\triangleright}{\blob}$

Here, the second call to \verb|\scalerel| was with the star (\verb|*|)
option, indicating that \verb|\blob| should not be printed out following
the right-hand delimiter.  A less-tall expression would appear in those
same delimiters as

\rl%
$\scalerel[3ex]{\triangleleft}{Q}\scalerel*[3ex]{\triangleright}{Q}$

Because the width limit had not been reached, no horizontal compression
of the object was required.  Note: see the \verb|\scaleleftright| and
\verb|\stretchleftright| commands for a more direct way to employ these
sort of transformations.

\subsection{The $\backslash$\texttt{stretchrel} Command}

In its most simple application \verb|\stretchrel| can be used in the
fashion of a \verb|\left\{| in math mode.  While there is no reason to
replace that more efficient usage supplied by \LaTeX{}, it is
nonetheless instructional to see a comparison of 
\verb|$\left\{\blob\right.$| and \verb|$\stretchrel[400]{\{}{\blob}$|, to
see how the aspect-ratio limiting option can be employed to avoid an
overly stretched manipulation:

\rl$\left\{\blob\right.$  ~~~~~ $\stretchrel[400]{\{}{\blob}$

The expression on the right uses a standard \{ character, which has been
vertically stretched, but limited to an aspect ratio of 4.  To use
symbols for which the \verb|\left| nomenclature will not work,
\verb|\stretchrel| provides a viable alternative, as shown in this
stick-figure example:\\
\verb|3m $\stretchrel[500]{\updownarrow\,}|\\
\verb|{\fbox{\rule[-1.8em]{0ex}{4em}Work Table}}$|

\rl3m $\stretchrel[500]{\updownarrow\,}
  {\fbox{\rule[-1.8em]{0ex}{4em}Work Table}}$

or in this use, \verb|$\stretchrel[225]{\int}{\blob} dx$|, of the
stretched integral sign (aspect limited to 2.25):

\rl$\stretchrel[225]{\int}{\blob} dx$


\subsection{Baseline Shifts of \textit{Relative} Scales and Stretches}

It was mentioned that when \verb|\scalerel| and \verb|\stretchrel| are
employed, the manipulated object gets vertically shifted to match the
extent of the reference object.  To see how this works, we provide the
following example, that employs some inline math. and scaling.  

\rl\underline{The baseline is the line that runs under this text}
\fbox{$\scalerel{i}{\blob}$}\underline{\scaleto{i}{43.32pt}}

The first case of the large letter ``i'' was generated with 
\verb|\scalerel|, and so the baseline of the ``i'', normally not a
descending letter, was dropped to conform to the descended reference
equation.  All of this was set in an \verb|\fbox| to show the extent of
the objects.  For comparison, an ``i'' of the samesize was then placed
using a \verb|\scaleto| command, which does not change the baseline of
the original object.

\subsection{The $\backslash$\texttt{scaleto} and
$\backslash$\texttt{stretchto} Commands}

The \verb|\scaleto| and \verb|\stretchto| commands are comparable to the
\verb|\scalerel| and \verb|\stretchrel| commands, except they do not
accept a reference object as their second mandatory argument.  Rather,
they take an absolute height (specified with units).  These commands use
the same optional arguments as \verb|\scalerel| and \verb|\stretchrel|
to constrain the width and/or the aspect ratio, respectively, of the
manipulated object.

As was mentioned in the prior section, a difference between these and
the \textit{relative} commands is that an object's baseline is not
altered with the use of \verb|\scaleto| and \verb|\stretchto|.  Because
there is no reference object employed with these commands, there is no
need for starred (\verb|*|) versions of these commands, which would
otherwise suppress the printing of the reference object.

Examples follow the established pattern established in prior sections.
First, we scale the equation blob used as an example in this
documentation to a vertical extent of 80pt, preserving the original
aspect ratio,

\rl\verb|$\scaleto{\blob}{80pt}$      | $\scaleto{\blob}{80pt}$

Then, we stretch the Greek letter, capital phi, to 60pt, but constrain
the aspect ratio to no less than 1.75.

\rl\verb|$\stretchto[175]{\Phi}{60pt}$      | $\stretchto[175]{\Phi}{80pt}$

\subsection{The $\backslash$\texttt{scaleleftright} and
 $\backslash$\texttt{stretchleftright}\\Commands}

These commands are composites of several \verb|\scalerel| and
\verb|\stretchrel| commands, intended to provide the functionality of
the \verb|\left ...\right| syntax of mathmode, for symbols for which
the \verb|\left ...\right| syntax does not work.  It uses the same
optional arguments as \verb|\scalerel| and \verb|\stretchrel| in order
to limit the width or aspect ratio of the respective manipulated
objects.  If one of the symbols on the left or right end of the enclosed
reference block is to be blank, these commands support the use of the
period argument \verb|{.}| as a blank placeholder, in a fashion
analogous to the \verb|\left ...\right| syntax of mathmode.

\rl\verb|$\scaleleftright[3ex]{\prod}{\blob}{\coprod}$  |
$\scaleleftright[3ex]{\prod}{\blob}{\coprod}$

\rl\verb|$\stretchleftright[450]{.}{\blob}{\in}$        |
$\stretchleftright[450]{.}{\blob}{\in}$

\subsection{The $\backslash$\texttt{hstretch},
 $\backslash$\texttt{vstretch}, and $\backslash$\texttt{scaleobj}
 Commands}

These commands simply perform horizontal or vertical stretching,
respectively.  They use a scale factor, rather than an absolute length.
If the stretch factor is greater than 1, the stretched length is larger
than the original.  If less than one, it is compressed with respect to
the original.

\rl\verb|$\otimes\hstretch{3}{\otimes}\hstretch{0.5}{\otimes}$ |
$\otimes\hstretch{3}{\otimes}\hstretch{0.5}{\otimes}$

\rl\verb|$\otimes\vstretch{3}{\otimes}\vstretch{0.5}{\otimes}$ |
$\otimes\vstretch{3}{\otimes}\vstretch{0.5}{\otimes}$

The \verb|\scaleobj| command performs scaling in the fashion of a
\verb|\scalebox| command, except that its argument is processed in math
mode of the current math display style, by default.  Thus, the
difference between the following two invocations:
\begin{verbatim}
  \(\scaleobj{2}{\sum_{i=0}^{n}}\)
  \[\scaleobj{2}{\sum_{i=0}^{n}}\]
\end{verbatim}
is given as
\(\scaleobj{2}{\sum_{i=0}^{n}}\) versus
\[\scaleobj{2}{\sum_{i=0}^{n}}\]

\section{Real World Application}

\subsection{White Curly Brackets}

Ref: http://tex.stackexchange.com/questions/100966/defining-
scalable-white- curly-brackets-and-and

\newcommand*{\llbrace}{%
  \BeginAccSupp{method=hex,unicode,ActualText=2983}%
    \textnormal{\usefont{OMS}{lmr}{m}{n}\char102}%
    \mathchoice{\mkern-4.05mu}{\mkern-4.05mu}{\mkern-4.3mu}{\mkern-4.8mu}%
    \textnormal{\usefont{OMS}{lmr}{m}{n}\char106}%
  \EndAccSupp{}%
}
\newcommand*{\rrbrace}{%
  \BeginAccSupp{method=hex,unicode,ActualText=2984}%
    \textnormal{\usefont{OMS}{lmr}{m}{n}\char106}%
    \mathchoice{\mkern-4.05mu}{\mkern-4.05mu}{\mkern-4.3mu}{\mkern-4.8mu}%
    \textnormal{\usefont{OMS}{lmr}{m}{n}\char103}%
  \EndAccSupp{}%
}

A user defined two new symbols made by combining the font glyphs of a
brace and a vertical strut, calling them \verb|\llbrace| and
\verb|\rrbrace|, to look as follows around an argument (in this case
$x$):

\def\wbrace{\scalebox{5}{$\llbrace x\rrbrace$}}
\rl\wbrace

But they found that when represented in reduced size fonts, the symbol
glyphs of the brace and the strut separated (note: \verb|\tiny| font has
been scaled up to match prior figure's height):

\def\tinywbrace{\scalebox{3}{\tiny$\llbrace x\rrbrace$}}
\rl$\scalerel*{\tinywbrace}{\wbrace}$

This happens because font designers don't merely scale their fonts when
shrunk down in size, but they do things (like thickening up lines and
changing aspect ratios) in an attempt to retain legibility.  In this
case, the font's auto-adjustment at smaller scale caused this composite
representation to change in unacceptable ways.

The \textsf{scalerel} solution was to use the image from the normal-size
representation and to shrink it down as needed.  So, in this case, a
normal-sized copy of the braces were stored in boxes called
\verb|\lXbrace| and \verb|\rXbrace|, resepctively.  Then the following
terms were defined:
\begin{verbatim}
\def\lxbrace{\scalerel*{\usebox{\lXbrace}}{\llbrace}}
\def\rxbrace{\scalerel*{\usebox{\rXbrace}}{\rrbrace}}
\end{verbatim} 
Now, in lieu of using \verb|\llbrace| directly, the use of
\verb|\lxbrace| would take a copy of the normal-sized \verb|\lXbrace|
and scale it down to the vertical height of the malformed tiny
\verb|\llbrace|, and substitute for it.  Here, we show the result at
both normal size and tiny size:

\newsavebox{\lXbrace}
\savebox{\lXbrace}{$\llbrace$}
\newsavebox{\rXbrace}
\savebox{\rXbrace}{$\rrbrace$}
\def\lxbrace{\scalerel*{\usebox{\lXbrace}}{\llbrace}}
\def\rxbrace{\scalerel*{\usebox{\rXbrace}}{\rrbrace}}
\rl$\scalerel*{\lxbrace x\rxbrace}{\wbrace}$
{\tiny$\scalerel*{\lxbrace x\rxbrace}{\wbrace}$}

Note that the brace is the properly formed scale of the normal-sized
brace in both cases, even as the $x$ adjusts to the fontsize reduction.

If one wanted the default braces narrower (to match the look of the
comparable symbols in the literature), one could use
\verb|\hstretch| in the definitions to achieve that quickly as
\begin{verbatim}
\def\lxbrace{%
   \hstretch{0.6}{\scalerel*{\usebox{\lXbrace}}{\llbrace}}}
\def\rxbrace{%
   \hstretch{0.6}{\scalerel*{\usebox{\rXbrace}}{\rrbrace}}}
\end{verbatim}

to give the following

\def\lxbrace{\hstretch{0.6}{\scalerel*{\usebox{\lXbrace}}{\llbrace}}}
\def\rxbrace{\hstretch{0.6}{\scalerel*{\usebox{\rXbrace}}{\rrbrace}}}
\rl$\scalerel*{\lxbrace x\rxbrace}{\wbrace}$
{\tiny$\scalerel*{\lxbrace x\rxbrace}{\wbrace}$}

Likewise, the \verb|\left| and \verb|\right| features of equation mode
cannot be used with the white braces, 

\rl \(\llbrace \left\llbracket\left\{\left[(a) \cdot
bc^{2^3}\right]^4\right\}^5\right\rrbracket \rrbrace\)

but \textsf{scalerel} can fix that, too:

\def\core{ \left\llbracket\left\{\left[(a) \cdot
bc^{2^3}\right]^4\right\}^5\right\rrbracket}%
\rl
\(\scalerel[1.5ex]{\lxbrace}{\core}\scalerel*[1.5ex]{\rxbrace}{\core}\)

with 
\begin{verbatim}
\(\scalerel[1.5ex]{\lxbrace}{\core}%
  \scalerel*[1.5ex]{\rxbrace}{\core}\)
\end{verbatim}
where \verb|\core| is the core inner equation to which the white braces
need to be scaled.  In this case, the scaled white braces were
width-limited to 1.5ex.

\subsection{Extra-Wide Oversymbols}

Refs:
http://tex.stackexchange.com/questions/86036/use-overarc-to-represent-an-arc/101539\#101539,
http://tex.stackexchange.com/questions/100574/really-wide-hat-symbol/101136\#101136

There are many oversymbols defined to stand over a single-letter
variable.  There are a smaller number of extra-wide oversymbols to
extend over small groups of symbols.  Occasionally, however, a need
arises for an oversymbol to stretch over a larger group of symbols.

With these definitions,
\begin{verbatim}
\newcommand\reallywidehat[1]{%
\begin{array}{c}%
\stretchto{%
  \scaleto{%
    \scalerel*[\widthof{#1}]{\bigwedge}%
    {\rule[-\textheight/2]{1ex}{\textheight}}% WIDTH-LIMITED
%                                              BIG WEDGE
  }{1.25\textheight}%  THIS STRETCHES THE WEDGE A LITTLE EXTRA
%                      WIDE
}{0.9ex}\\%            THIS SQUEEZES THE WEDGE TO 0.9ex HEIGHT
#1\\%                  THIS STACKS THE WEDGE ATOP THE ARGUMENT
\rule{0ex}{.01ex}%
\end{array}%
}


\newcommand\reallywideparen[1]{%
\begin{array}{c}%
\stretchto{%
  \scaleto{%
    \scalerel*[\widthof{#1}]{\frown}%
    {\rule[-\textheight/2]{1ex}{\textheight}}% WIDTH-LIMITED
%                                              BIG WEDGE
  }{1.25\textheight}%  THIS STRETCHES THE WEDGE A LITTLE EXTRA
%                      WIDE
}{0.6ex}\\%            THIS SQUEEZES THE WEDGE TO 0.6ex HEIGHT
#1\\%                  THIS STACKS THE WEDGE ATOP THE ARGUMENT
\rule{0ex}{.01ex}%
\end{array}%
}
\end{verbatim}
arbitrarily wide oversymbols may be constructed:

\newcommand\reallywidehat[1]{%
\begin{array}{c}%
\stretchto{%
  \scaleto{%
    \scalerel*[\widthof{#1}]{\bigwedge}%
    {\rule[-\textheight/2]{1ex}{\textheight}}% WIDTH-LIMITED BIG WEDGE
  }{1.25\textheight}%  THIS STRETCHES THE WEDGE A LITTLE EXTRA WIDE
}{0.9ex}\\%            THIS SQUEEZES THE WEDGE TO 0.9ex HEIGHT
#1\\%                  THIS STACKS THE WEDGE ATOP THE ARGUMENT
\rule{0ex}{.01ex}%
\end{array}%
}

\newcommand\reallywideparen[1]{%
\begin{array}{c}%
\stretchto{%
  \scaleto{%
    \scalerel*[\widthof{#1}]{\frown}%
    {\rule[-\textheight/2]{1ex}{\textheight}}% WIDTH-LIMITED BIG WEDGE
  }{1.25\textheight}%  THIS STRETCHES THE WEDGE A LITTLE EXTRA WIDE
}{0.6ex}\\%            THIS SQUEEZES THE WEDGE TO 0.6ex HEIGHT
#1\\%                  THIS STACKS THE WEDGE ATOP THE ARGUMENT
\rule{0ex}{.01ex}%
\end{array}%
}

\rl
$\reallywideparen{POQ}$ $+ \reallywidehat{QOR} + \reallywidehat{ROP}=
2\pi r$

\rl $\reallywidehat{zbcdefghijklm}$

\section{Future Development}

It would be relatively straightforward to extend this approach to
horizontal scaling problems.  However, it is not exactly clear to the
author what format is best suited for user needs.  If he gets feedback
in that regard, it will inform him how best to proceed.

\section{Code Listing}

\verbatiminput{scalerel.sty}

\end{document}