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
|
% $Id: pst-rputover-doc.tex 2017-29-06 Martin, Thomas $
%% This is file `pst-rputover-doc.tex',
%%
%% IMPORTANT NOTICE:
%%
%% Package `pst-rputover.tex'
%%
%% Thomas S\"{O}LL and Martin J.OSBORNE
%%
%% This program can redistributed and/or modified under %%
%% the terms of the LaTeX Project Public License %%
%% Distributed from CTAN archives in directory %%
%% macros/latex/base/lppl.txt; either version 1.3c of %%
%% the License, or (at your option) any later version. %%
%%
%% DESCRIPTION:
%% `pst-rputover' is a PSTricks package that allows you to place text over objects without obscuring background colors
%%
%% Based partially on the answer of Werner at
%% http://tex.stackexchange.com/questions/353748/is-there-a-variant-of-rput-in-pstricks-that-preserves-background-fill-colors
%%
\documentclass[11pt,english,BCOR10mm,DIV12,bibliography=totoc,parskip=false,smallheadings,headexclude,footexclude,oneside,distiller]{pst-doc}
\usepackage[autostyle]{csquotes}
\usepackage{biblatex}
\addbibresource{pst-rputover-doc.bib}
\usepackage{pst-rputover}
\usepackage[utf8]{inputenc}
\let\pstrputoverFV\fileversion
\usepackage{pst-plot,pstricks-add}
\usepackage{etex} % increase the number of registers (otherwise only 256)
\let\belowcaptionskip\abovecaptionskip
\parindent0pt
\psset{arrowlength=2.8,arrowinset=0.1}
\makeatletter
\renewcommand\maketitle{%
\thispagestyle{empty}%
\begin{titlepage}
\ifpdf
\AddToShipoutPicture*{\includegraphics{pst-doc.pdf}}
\vspace*{0.3\textheight}
\parbox{17cm}{\sffamily\RaggedRight\bfseries\huge\@title}\\[5pt]
\parbox{15cm}{\sffamily\Large\@subtitle}
\vspace{5cm}
\parbox{10cm}{\sffamily\@date}
\vfill
~\\
\makebox[.5\textwidth]{\put(0,0){\bgImage}}\\
~
\vfill
\parbox[b]{19cm}{\sffamily\RaggedRight
\ifx\@docauthor\empty~\else Documentation by\fi\hfill\makebox[7cm][l]{Package authors:}\\
\ifx\@docauthor\empty~\else{\bfseries\tabular[t]{@{}l@{}}\@docauthor\endtabular}\fi\hfill\makebox[7cm][l]{%
\bfseries\tabular[t]{@{}l@{}}\@author\endtabular}}
\else
\psset{unit=1cm}
\begin{pspicture}(1.6in,0)(23cm,21.7cm)
\psframe[fillstyle=solid,linecolor=lightgray,fillcolor=lightgray,linestyle=solid](0,-5.75)(23,10)
\psframe[fillstyle=solid,linecolor=Orange!85!Red,fillcolor=Orange!85!Red,linestyle=solid](0,10)(23,10.5)
\psframe[fillstyle=solid,linecolor=Orange!85!Red,fillcolor=Orange!85!Red,linestyle=solid](0,21.1)(23,21.2)
\rput[lb](3,22){\Huge\sffamily\color{Orange!65!Red}\psscalebox{2}{\textbf{PSTricks}}}
\rput[lb](3,14.1){\parbox{17cm}{\sffamily\RaggedRight\bfseries\huge\@title}}
\rput[lb](3,12.6){\parbox{15cm}{\sffamily\Large\@subtitle}}
\rput[lb](3,7.6){\parbox{15cm}{\sffamily\@date}}
\rput[lb](3,-2.6){\parbox[b]{19cm}{\sffamily\RaggedRight
\ifx\@docauthor\empty~\else Documentation by\fi\hfill\makebox[7cm][l]{Package authors:}\\
\ifx\@docauthor\empty~\else{\bfseries\tabular[t]{@{}l@{}}\@docauthor\endtabular}\fi\hfill\makebox[7cm][l]{%
\bfseries\tabular[t]{@{}l@{}}\@author\endtabular}}}
\rput[C](11,4){\bgImage}%
\end{pspicture}%
\fi
\end{titlepage}
\setcounter{footnote}{0}%
\global\let\thanks\relax%
\global\let\maketitle\relax%
\global\let\@thanks\@empty%
\global\let\@author\@empty%
\global\let\@docauthor\@empty%
\global\let\@date\@empty%
\global\let\@title\@empty%
\global\let\@subtitle\@empty%
\global\let\title\relax%
\global\let\author\relax%
\global\let\date\relax%
\global\let\and\relax%
}
\makeatother
\renewcommand\bgImage{%
%{\psset{unit=3}%
\psscalebox{3}{%
\begin{pspicture}(2,2)
\psframe[fillstyle=solid,fillcolor=blue!40,linestyle=none,linewidth=0pt,opacity=0.8](0,0)(2,2)
\pscurve[fillstyle=solid,fillcolor=red!30,linestyle=none,opacity=0.8](0,2)(1,1)(2,2)
\pnode(.5,0){A}\psdot[linecolor=red](A)
\pnode(1.5,2){B}\psdot[linecolor=green](B)
\pclineover(A)(B){$\alpha$}
\end{pspicture}
}}
%%\usepackage[style=dtk]{biblatex}
%\usepackage{biblatex}
%%\addbibresource{pst-rputover-doc.bib}
\lstset{language=PSTricks,morekeywords={rputover,coverable,pclineover,pcarrowC,},basicstyle=\footnotesize\ttfamily}
%
\psset{labelFontSize=\scriptstyle}% for mathmode
\begin{document}
\title{pst-rputover v 1.0}
\subtitle{A PSTricks package to place text over lines and other objects without obscuring background fills}
\author{Martin J. \textsc{Osborne}\\
and\\
Thomas \textsc{S\"{o}ll}}
\date{\today}
\maketitle
\tableofcontents
\clearpage
\begin{abstract}
The command \verb+\rput*+ allows you to place text on top of other objects (e.g.\ lines), obscuring the parts of the objects that lie within a box surrounding the text, so that the objects do not interfere with the text. In doing so, it creates a white box that obscures \textit{all} objects that are under the text. This style allows you to place text over objects without obscuring background colors (or other objects of your choice).
\end{abstract}
\section{Introduction}
You create a PSTricks figure with regions filled with various colors.
\bigskip
\hspace*{\fill}%
\begin{pspicture}(10,3)
\psframe[fillstyle=solid,fillcolor=blue!20,linestyle=none](0,0)(10,3)
\pscustom[fillstyle=solid,fillcolor=red!30,linestyle=none]{%
\psplot[plotpoints=500]{0}{10}{x 150 mul cos 1.2 mul 1.5 add}
\psline[liftpen=1](10,0)(0,0)
\closepath
}
\end{pspicture}%
\hspace*{\fill}
\bigskip
\noindent
You add some lines over the colors.
\bigskip
\hspace*{\fill}%
\begin{pspicture}(10,3)
\psframe[fillstyle=solid,fillcolor=blue!20,linestyle=none](0,0)(10,3)
\pscustom[fillstyle=solid,fillcolor=red!30,linestyle=none]{%
\psplot[plotpoints=500]{0}{10}{x 150 mul cos 1.2 mul 1.5 add}
\psline[liftpen=1](10,0)(0,0)
\closepath
}
\psline[linestyle=dotted](5.3,0)(5.3,2.3)(0,2.3)
\end{pspicture}%
\hspace*{\fill}
\bigskip
\noindent
Now you want to add some labels. You'd like these
labels to block out the lines, so that they don't interfere with the characters in your labels.
\bigskip
\hspace*{\fill}%
\begin{pspicture}(10,3)
\psframe[fillstyle=solid,fillcolor=blue!20,linestyle=none](0,0)(10,3)
\pscustom[fillstyle=solid,fillcolor=red!30,linestyle=none]{%
\psplot[plotpoints=500]{0}{10}{x 150 mul cos 1.2 mul 1.5 add}
\psline[liftpen=1](10,0)(0,0)
\closepath
}
\rputover[autoangle=false,fboxsep=2pt]{0}(5.3,1.7){label}%
\coverable{\psline[linestyle=dotted](5.3,0)(5.3,2.3)(0,2.3)}
\end{pspicture}%
\hspace*{\fill}
\bigskip
\noindent
This style allows you to do that.
Why do you need a style? Why not use \verb+\rput*+? That
blocks out the lines, but it does so by creating a white rectangle that blocks
the colors too.
\bigskip
\hspace*{\fill}%
\begin{pspicture}(10,3)
\psframe[fillstyle=solid,fillcolor=blue!20,linestyle=none](0,0)(10,3)
\pscustom[fillstyle=solid,fillcolor=red!30,linestyle=none]{%
\psplot[plotpoints=500]{0}{10}{x 150 mul cos 1.2 mul 1.5 add}
\psline[liftpen=1](10,0)(0,0)
\closepath
}
\psline[linestyle=dotted](5.3,0)(5.3,2.3)(0,2.3)
\rput*(5.3,1.7){label}%
\end{pspicture}%
\hspace*{\fill}
\bigskip
\noindent
You could change the background color of that rectangle, but if the rectangle
includes regions with two or more colors, this approach can get pretty complicated.
This style offers a simple solution. You use \verb+\rputover+ instead of
\verb+\rput+ and include all the objects you want to be covered by the text in
the argument of \verb+\coverable+, like so:
\small
\begin{verbatim}
\usepackage{pstricks,rputover}
...
\begin{pspicture}(100,30)
...
\rputover[fboxsep=3pt](5.3,1.7){label}%
\coverable{%
\psline[linestyle=dotted,linewidth=0.5](5.0,0)(5.0,2.3)(0,2.3)
}
...
\end{pspicture}
\end{verbatim}
(The setting \verb+\fboxsep=3pt+ means that the padding around `\texttt{label}' is 3 points wide.)
The style combines two ideas. The first idea, suggested by the StackExchange user Werner on \href{http://tex.stackexchange.com/questions/353748/is-there-a-variant-of-rput-in-pstricks-that-preserves-background-fill-colors}{this page}, is to use \verb+\psDefBoxNodes+ in \verb+pst-node.sty+ to get the coordinates of the corners of the box occupied by each label. The second idea is to use these coordinates and \verb+\psclip+ to remove the parts of the objects in the argument of \verb+\coverable+ that overlap with the labels. The only subtlety in implementing this second idea is that we want to do a `reverse clip': we want to keep the areas \textit{outside} the labels, not the ones inside.
\section{Commands}
\subsection{\textbackslash rputover}
\verb+\rputover+ has the following syntax, where \Largb{angle} and \coord1 (as well as \OptArgs) are optional.
\begin{BDef}
\Lcs{rputover}\OptArgs\Largb{angle}\coord0\coord1\Largb{any material}
\end{BDef}
\verb+\rputover+ is intended to be used in conjunction with \verb+\coverable+, but we begin by explaining its effect by itself.
In the absence of the coordinates \coord1, the effect and syntax of \verb+\rputover+ are similar to those of \verb+\rput+. Specifically, \Lcs{rputover}\OptArgs\Largb{angle}\coord0\Largb{any material} places \textit{any material} at \coord0 rotated by \textit{angle}, with the placement relative to \coord0 determined by \OptArgs. The syntax of \verb+\rputover+ differs from that of \verb+\rput+ only in the specification of the placement of the box containing \textit{any material} relative to \coord0. This placement is specified in \verb+\rput+ by writing
\begin{BDef}
\Lcs{rput[p]}\Largb{angle}\coord0\Largb{any material}
\end{BDef}
where \verb+p+ is \verb+c+ (center), \verb+t+ (top), \verb+b+ (bottom), \verb+l+ (left), or \verb+r+ (right), or some combination of these letters (e.g.\ \verb+tl+ for top left). The same placement is specified in \verb+\rputover+ by writing
\begin{BDef}
\text{\Lcs{rputover[boxpos=p]}\Largb{angle}\coord0\Largb{any material}}
\end{BDef}
As for \verb+\rput+, the default value of \verb+p+ is \verb+c+.
Here is an example.\begin{LTXexample}[pos=t,width=2cm]
\begin{pspicture}(0,0)(2,1)
\rputover[boxpos=t]{45}(1,0.5){\(x\)}
\psframe[linestyle=dotted](0,0)(2,1)
\end{pspicture}
\end{LTXexample}
The optional pair of coordinates \coord1 provides an alternative way to position \textit{any material}. If it is present, then \textit{any material} is placed on the line segment joining \coord1 and \coord2, by default at the midpoint of this line segment, at the same angle as the line segment.
\begin{LTXexample}[pos=t,width=10cm]
\begin{pspicture}(0,0)(10,3)
\rputover(0,0)(5,3){\(x^3-1\)}
\psframe[linestyle=dotted](0,0)(10,3)
\coverable{\psline[linestyle=dotted](0,0)(5,3)}
\end{pspicture}
\end{LTXexample}
To make the label horizontal, use the option \verb+autoangle=false+.
\begin{LTXexample}[pos=t,width=10cm]
\begin{pspicture}(0,0)(10,3)
\rputover[autoangle=false](0,0)(5,3){\(x^3-1\)}
\psframe[linestyle=dotted](0,0)(10,3)
\coverable{\psline[linestyle=dotted](0,0)(5,3)}
\end{pspicture}
\end{LTXexample}
To put the label not at the midpoint of the line segment but at the point that is the fraction \(z\) of the distance between \coord0 and \coord1 from \coord0, use the setting \verb+npos=+\(z\).
\begin{LTXexample}[pos=t,width=10cm]
\begin{pspicture}(0,0)(10,3)
\rputover[npos=0.75](0,0)(5,3){\(x^3-1\)}
\psframe[linestyle=dotted](0,0)(10,3)
\coverable{\psline[linestyle=dotted](0,0)(5,3)}
\end{pspicture}
\end{LTXexample}
If you like, you can refer to points by labels that you assign. Doing so is handy if you use the same points several times.
\begin{LTXexample}[pos=t,width=10cm]
\begin{pspicture}(0,0)(10,3)
\pnode(0,0){A}
\pnode(5,3){B}
\pnode(10,3){C}
\rputover[npos=0.75](A)(B){\(x^3-1\)}
\psframe[linestyle=dotted](A)(C)
\coverable{\psline[linestyle=dotted](A)(B)}
\psdot[linecolor=red](A)
\psdot[linecolor=ForestGreen](B)
\end{pspicture}
\end{LTXexample}
\subsection{\textbackslash coverable}
\verb+\coverable+ has a single argument, which consists of all the objects that you want to be covered by the objects that are arguments of \verb+\putover+ commands.
\begin{BDef}
\Lcs{coverable}\Largb{any material}
\end{BDef}
\subsection{Using \textbackslash rputover and \textbackslash coverable together}
%
Here is a simple example of the way in which \verb+\rputover+ and \verb+\coverable+ are used together. The command
\begin{BDef}
\verb+\rputover[fboxsep=4pt]{0}(5.3,1.7){label}+
\end{BDef}
puts `label' in a box with padding 4pts wide at the point \verb+(5.3,1.7)+ and
\begin{BDef}
\verb+\coverable{\psline[linestyle=dashed](5.3,0)(5.3,2.3)(0,2.3)}}+
\end{BDef}
draws a (dashed) line that is `coverable' by the box containing the label.
\begin{LTXexample}[pos=t,width=10cm]
\begin{pspicture}(0,0)(10,3)
% Colored background
\psframe[fillstyle=solid,fillcolor=blue!20,linestyle=none](0,0)(10,3)
\pscustom[fillstyle=solid,fillcolor=red!30,linestyle=none]{%
\psplot[plotpoints=500]{0}{10}{x 150 mul cos 1.2 mul 1.5 add}
\psline[liftpen=1](10,0)(0,0)
\closepath
}
% Place `label' at (5.3,1.7)
\rputover[fboxsep=4pt]{0}(5.3,1.7){label}
% Draw a dashed line, but allow the label to cover it
\coverable{\psline[linestyle=dashed](5.3,0)(5.3,2.3)(0,2.3)}
\end{pspicture}
\end{LTXexample}
The next example illustrates the use of named nodes (\verb+A+ and \verb+B+) and the placement of a label over the midpoint of a line using the second pair of coordinates in \verb+\rputover+.
\begin{LTXexample}[pos=t,width=10cm]
\begin{pspicture}(0,0)(10,3)
% Colored background
\psframe[fillstyle=solid,fillcolor=blue!20,linestyle=none](0,0)(10,3)
\pscustom[fillstyle=solid,fillcolor=red!30,linestyle=none]{%
\psplot[plotpoints=500]{0}{10}{x 150 mul cos 1.2 mul 1.5 add}
\psline[liftpen=1](10,0)(0,0)
\closepath
}
% Red and green dots
\pnode(1.5,0){A}\psdot[linecolor=red](A)\pnode(8.5,3){B}\psdot[linecolor=green](B)
% Label, placed by default at the midpoint of the line segment from A to B
\rputover[fboxsep=2pt](A)(B){\(x^3+z-1\)}
% Line from A to B (with arrows at the ends) (\psline may be used instead of \pcline)
\coverable{\pcline{<->}(A)(B)}
\end{pspicture}
\end{LTXexample}
To set the label automatically you can use autoangle=true and autopoint=true, so the label will set between the last two (optional) points of \verb+\rputover+
like in the way of \verb+\cput*+.
\begin{LTXexample}[pos=t,width=10cm]
\begin{pspicture}(10,3)
% Colored background
\psframe[fillstyle=solid,fillcolor=blue!20,linestyle=none](0,0)(10,3)
\pscustom[fillstyle=solid,fillcolor=red!30,linestyle=none]{%
\psplot[plotpoints=500]{0}{10}{x 150 mul cos 1.2 mul 1.5 add}\psline[liftpen=1](10,0)(0,0)\closepath}
% Red and green dots
\pnode(1.5,0){A}\psdot[linecolor=red](A)\pnode(8.5,3){B}\psdot[linecolor=green](B)
% Label 40% of the way from A to B, rotated by 90 degrees, in a box. You can use any
% Postscript expression for the angle (for example, you can write 20 4.5 mul instead
% of 90).
\rputover[fboxsep=0pt,npos=0.4]{90}(A)(B){%
\psframebox[framesep=3pt]{Label: \(x=a^2\)}
}
% Line between A and B, coverable by the label
\coverable{\pcline{<->}(A)(B)}
% The (Postscript) constant delta1 is the angle of a line perpendicular to the line
% from A to B, and can be used elsewhere in the picture. (The ! prefix in the argument
% of \rput indicates Postscript.)
\rput{!delta1}(0.4,1.4){test1}
\rput[bl]{!delta1 90 sub}(0.6,1.8){\color{blue}test2}
\end{pspicture}
\end{LTXexample}
\subsection{\textbackslash pclineover}
As shorthand for
\begin{BDef}
\Lcs{rputover}\OptArgs\coord1\coord2\Largb{any material}\\
\Lcs{coverable}\verb+{+\Lcs{pcline}\coord1\coord2\verb+}+
\end{BDef}
you can write
\begin{BDef}
\Lcs{pclineover}\OptArgs\coord1\coord2\Largb{any material}\\
\end{BDef}
as illustrated in the following examples.
\begin{LTXexample}[pos=t,width=10cm]
\begin{pspicture}(10,3)
% Colored background
\psframe[fillstyle=solid,fillcolor=blue!20,linestyle=none](0,0)(10,3)
\pscustom[fillstyle=solid,fillcolor=red!30,linestyle=none]{%
\psplot[plotpoints=500]{0}{10}{x 150 mul cos 1.2 mul 1.5 add}\psline[liftpen=1](10,0)(0,0)\closepath}
% Red and green dots
\pnode(1.5,0){A}\psdot[linecolor=red](A)\pnode(8.5,3){B}\psdot[linecolor=green](B)
% Line from A to B, covered by label `\(\alpha\) and others'
\pclineover(A)(B){\(\alpha\) and others}
\end{pspicture}
\end{LTXexample}
\begin{LTXexample}[pos=t,width=10cm]
\begin{pspicture}(10,3)
% Colored background
\psframe[fillstyle=solid,fillcolor=blue!20,linestyle=none](0,0)(10,3)
\pscustom[fillstyle=solid,fillcolor=red!30,linestyle=none]{%
\psplot[plotpoints=500]{0}{10}{x 150 mul cos 1.2 mul 1.5 add}\psline[liftpen=1](10,0)(0,0)\closepath}
% Red and green dots
\pnode(1.5,0){A}\psdot[linecolor=red](A)\pnode(8.5,3){B}\psdot[linecolor=green](B)
% Line from A to B, covered by label `\(\alpha\) and others' rotated by 90 degrees
\pclineover[angleadd=90](A)(B){$\alpha$ and others}
\end{pspicture}
\end{LTXexample}
\begin{LTXexample}[pos=t,width=10cm]
\begin{pspicture}(10,3)
% Colored background
\psframe[fillstyle=solid,fillcolor=blue!20,linestyle=none](0,0)(10,3)
\pscustom[fillstyle=solid,fillcolor=red!30,linestyle=none]{%
\psplot[plotpoints=500]{0}{10}{x 150 mul cos 1.2 mul 1.5 add}\psline[liftpen=1](10,0)(0,0)\closepath}
% Red and green dots
\pnode(1.5,0){A}\psdot[linecolor=red](A)\pnode(8.5,3){B}\psdot[linecolor=green](B)
% Line from A to (8.5,2) with arrows and bars at the ends, covered by label `\(\alpha\)
% and others' in a box with a transparent cyan background
\pclineover[fboxsep=0pt,arrows=|->|](A)(8.5,2){%
\psframebox[fillstyle=solid,fillcolor=cyan,opacity=0.2,linestyle=none,linewidth=0pt]{\(\alpha\) and others}}
\end{pspicture}
\end{LTXexample}
\begin{LTXexample}[pos=t,width=10cm]
\begin{pspicture}(10,3)
% Colored background
\psframe[fillstyle=solid,fillcolor=blue!20,linestyle=none](0,0)(10,3)
\pscustom[fillstyle=solid,fillcolor=red!30,linestyle=none]{%
\psplot[plotpoints=500]{0}{10}{x 150 mul cos 1.2 mul 1.5 add}\psline[liftpen=1](10,0)(0,0)\closepath}
% Red and green dots
\pnode(1.5,0){A}\psdot[linecolor=red](A)\pnode(8.5,3){B}\psdot[linecolor=green](B)
% Line from A to B offset by 5pt, covered by label `\(\alpha\) and more text' in a box
% with a transparent tan background
\pclineover[offset=5pt,fboxsep=0pt](A)(B){%
\psframebox[fillstyle=solid,fillcolor=Tan,opacity=0.65,linestyle=none,linewidth=0pt]{\(\alpha\) and more text}}
% Bars at the end of the line
\pcline[linestyle=none,offset=5pt]{|*-|*}(A)(B)
\end{pspicture}
\end{LTXexample}
\begin{LTXexample}[pos=t,width=10cm]
\begin{pspicture}(10,3)
% Colored background
\psframe[fillstyle=solid,fillcolor=blue!20,linestyle=none](0,0)(10,3)
\pscustom[fillstyle=solid,fillcolor=red!30,linestyle=none]{%
\psplot[plotpoints=500]{0}{10}{x 150 mul cos 1.2 mul 1.5 add}\psline[liftpen=1](10,0)(0,0)\closepath}
% Red and green dots
\pnode(1.5,0){A}\psdot[linecolor=red](A)\pnode(8.5,3){B}\psdot[linecolor=green](B)
% Line from A to B offset by 5pt, covered by label `\(\alpha\) and ...' in a box
% with a transparent yellow background offset by 10pt to the left and 3pt up
\pclineover[offset=5pt,fboxsep=0pt,arrows=|<->|,absnodesep={-10pt,3pt}](A)(B){%
\rnode{C}{\psframebox[fillstyle=solid,fillcolor=yellow,opacity=0.65,linestyle=none,linewidth=0pt]{\(\alpha\) and other material \(\int_{a}^{b}\)}}}
\end{pspicture}
\end{LTXexample}
\subsection{\textbackslash pcarrowC}
As shorthand for
\begin{BDef}
\Lcs{pclineover}\verb+[arrows=|<->|,other options]+\coord1\coord2\Largb{any material}\\
\end{BDef}
you can write
\begin{BDef}
\Lcs{pcarrowC}\verb+[other options]+\coord1\coord2\Largb{any material}
\end{BDef}
\begin{LTXexample}[pos=t,width=10cm]
\begin{pspicture}(10,3)
% Colored background
\psframe[fillstyle=solid,fillcolor=blue!20,linestyle=none](0,0)(10,3)
\pscustom[fillstyle=solid,fillcolor=red!30,linestyle=none]{%
\psplot[plotpoints=500]{0}{10}{x 150 mul cos 1.2 mul 1.5 add}\psline[liftpen=1](10,0)(0,0)\closepath}
% Red and green dots
\pnode(1.5,0){A}\psdot[linecolor=red](A)\pnode(8.5,3){B}\psdot[linecolor=green](B)
% Line from A to B with arrows and bars at the ends, covered by label `\(\beta\) ...'
\pcarrowC(A)(B){$\beta$ and other material}
\end{pspicture}
\end{LTXexample}
\begin{LTXexample}[pos=t,width=10cm]
\begin{pspicture}(10,3)
% Colored background
\psframe[fillstyle=solid,fillcolor=blue!20,linestyle=none](0,0)(10,3)
\pscustom[fillstyle=solid,fillcolor=red!30,linestyle=none]{%
\psplot[plotpoints=500]{0}{10}{x 150 mul cos 1.2 mul 1.5 add}\psline[liftpen=1](10,0)(0,0)\closepath}
% Red and green dots
\pnode(1.5,0){A}\psdot[linecolor=red](A)\pnode(8.5,3){B}\psdot[linecolor=green](B)
% Line from A to B offset by 8pt, with bars 0.4pt thick and 12pt long offset by 6pt,
% covered by label `\(\gamma\) ...'
\pcarrowC[offset=8pt,baroffset=6pt,Cbarwidth=0.4pt,tbarsize=12pt,addbars=|*-|*](A)(B){\(\gamma\) and other material \(\int_{a}^{b}\)}
\end{pspicture}
\end{LTXexample}
\begin{LTXexample}[pos=t,width=10cm]
\begin{pspicture}(10,3)
% Colored background
\psframe[fillstyle=solid,fillcolor=blue!20,linestyle=none](0,0)(10,3)
\pscustom[fillstyle=solid,fillcolor=red!30,linestyle=none]{%
\psplot[plotpoints=500]{0}{10}{x 150 mul cos 1.2 mul 1.5 add}\psline[liftpen=1](10,0)(0,0)\closepath}
% Red and green dots
\pnode(1.5,0){A}\psdot[linecolor=red](A)\pnode(8.5,3){B}\psdot[linecolor=green](B)
% Line from A to B with bars 0.2pt thick and 20pt long, covered by label `\(\beta\) ...'
\pcarrowC[addbars=|-|,Cbarwidth=0.2pt,tbarsize=20pt]{<->}(A)(B){\(\beta\)}
\end{pspicture}
\end{LTXexample}
\subsection{inverscl option for \textbackslash coverable}
An experimental feature is the option \verb+inverscl+ for \verb+\coverable+. This option inverts the clip. All material above the figure will be clipped, so use this option only at the top of a page. (Even then, any running head is clipped.)
\newpage
\begin{LTXexample}[pos=t,width=10cm]
\begin{pspicture}(10,3)
\psframe[fillstyle=solid,fillcolor=blue!20,linestyle=none](0,0)(10,3)
\pscustom[fillstyle=solid,fillcolor=red!30,linestyle=none]{%
\psplot[plotpoints=500]{0}{10}{x 150 mul cos 1.2 mul 1.5 add}\psline[liftpen=1](10,0)(0,0)\closepath}
\rputover(1,1){\sffamily label}
\rputover{30}(1.6,1.6){\sffamily \parbox[t][1cm][c]{2cm}{nur mal wieder Text}}
\rputover[boxpos=tr](4.5,1.4){aha, this is crazy}
\coverable[inverscl=true]{%
\psgrid
\psline(0,0)(2,2)
\pscurve[linecolor=blue](1,0)(1.5,0.5)(0.5,1.5)(1,2)
\psline(1,0)(2,2)
}
\end{pspicture}
\end{LTXexample}
Compare this figure with one produced by the same code with the omission of \verb+inverscl=true+.
\begin{LTXexample}[pos=t,width=10cm]
\begin{pspicture}(10,3)
\psframe[fillstyle=solid,fillcolor=blue!20,linestyle=none](0,0)(10,3)
\pscustom[fillstyle=solid,fillcolor=red!30,linestyle=none]{%
\psplot[plotpoints=500]{0}{10}{x 150 mul cos 1.2 mul 1.5 add}\psline[liftpen=1](10,0)(0,0)\closepath}
\rputover(1,1){\sffamily label}
\rputover{30}(1.6,1.6){\sffamily \parbox[t][1cm][c]{2cm}{nur mal wieder Text}}
\rputover[boxpos=tr](4.5,1.4){aha, this is crazy}
\coverable{%
\psgrid
\psline(0,0)(2,2)
\pscurve[linecolor=blue](1,0)(1.5,0.5)(0.5,1.5)(1,2)
\psline(1,0)(2,2)
}
\end{pspicture}
\end{LTXexample}
\newpage
\section{History}
\begin{description}
\item[Version 1.0, 2017.6.29] First version
\end{description}
\clearpage
\section{List of all optional arguments for \texttt{pst-rputover}}
\xkvview{family=pst-rputover,columns={key,type,default}}
\clearpage
%\bgroup
%\RaggedRight
%\nocite{*}
%\bibliographystyle{plain}
%\printbibliography{pst-rputover-doc}
%\egroup
%\printindex
\end{document}
|