-
Notifications
You must be signed in to change notification settings - Fork 10
/
pullquote.dtx
2215 lines (2174 loc) · 76.8 KB
/
pullquote.dtx
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
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
% \iffalse meta-comment
%<*internal>
\iffalse
%</internal>
%<*readme>
----------------------------------------------------------------
pullquote --- make pullquotes with LaTeX
E-mail: [email protected]
Web: www.docscape.de
Released under the LaTeX Project Public License v1.3c or later
See http://www.latex-project.org/lppl.txt
----------------------------------------------------------------
This package allows to insert an object between two columns of text.
%</readme>
%<*internal>
\fi
\def\nameofplainTeX{plain}
\ifx\fmtname\nameofplainTeX\else
\expandafter\begingroup
\fi
%</internal>
%<*install>
\input docstrip.tex
\keepsilent
\askforoverwritefalse
\preamble
----------------------------------------------------------------
pullquote --- make pullquotes with LaTeX
E-mail: [email protected]
Web: www.docscape.de
Released under the LaTeX Project Public License v1.3c or later
See http://www.latex-project.org/lppl.txt
----------------------------------------------------------------
\endpreamble
\postamble
Copyright (C) 2012 by Stephan Lehmke <[email protected]>
This work may be distributed and/or modified under the
conditions of the LaTeX Project Public License (LPPL), either
version 1.3c of this license or (at your option) any later
version. The latest version of this license is in the file:
http://www.latex-project.org/lppl.txt
This work is "maintained" (as per LPPL maintenance status) by
Stephan Lehmke.
This work consists of the file pullquote.dtx
and the derived files pullquote.ins,
pullquote.pdf, and
pullquote.sty.
\endpostamble
\usedir{tex/latex/pullquote}
\generate{
\file{\jobname.sty}{\from{\jobname.dtx}{package}}
}
%</install>
%<install>\endbatchfile
%<*internal>
\usedir{source/latex/pullquote}
\generate{
\file{\jobname.ins}{\from{\jobname.dtx}{install}}
}
\nopreamble\nopostamble
\usedir{doc/latex/demopkg}
\generate{
\file{README.txt}{\from{\jobname.dtx}{readme}}
}
\ifx\fmtname\nameofplainTeX
\expandafter\endbatchfile
\else
\expandafter\endgroup
\fi
%</internal>
%<*package>
\NeedsTeXFormat{LaTeX2e}
\ProvidesPackage{pullquote}[2012/09/12 v2.0 EXPERIMENTAL package for typesetting pullquotes]
%</package>
%<*driver>
\documentclass{ltxdoc}
\usepackage[T1]{fontenc}
\usepackage{lmodern}
\usepackage{float}
\usepackage{tikz}
\usepackage{lipsum}
\usepackage{tabularx}
\usepackage{booktabs}
\usepackage[latin,english]{babel}
\usepackage{\jobname}
\makeatletter
\input{t1lmtt.fd}
\DeclareFontShape{T1}{lmtt}{m}{it}
{<-> sub*lmtt/m/sl}{}
\DeclareRobustCommand\textequals{=}
\newcommand\ttarg[1]{\texttt{\meta{#1}}}
\newcommand\default[1]{\par\vspace{-2\baselineskip}\mbox{}\hfill
Default: \textbf{#1}\par\medskip}
\newcommand\usageindex[1]
{%
\@bsphack
\HD@page@wrindex{#1\actualchar{\protect\ttfamily#1}\encapchar usage}%
\@esphack
}
\newcommand\ttindex[1]
{%
\@bsphack
\HD@page@wrindex{#1\actualchar{\protect\ttfamily#1}}%
\@esphack
}
\newcommand\pindex[1]
{%
\@bsphack
\HD@page@wrindex{#1\actualchar{\protect\ttfamily#1} \mbox{(package)}}%
\HD@page@wrindex{packages:\levelchar#1\actualchar{\protect\ttfamily#1}}%
\@esphack
}
\DeclareRobustCommand\package[1]{\texttt{#1}\pindex{#1}}
\newcommand\poindex[1]
{%
\@bsphack
\HD@page@wrindex{#1\actualchar{\protect\ttfamily#1} \mbox{(package option)}}%
\HD@page@wrindex{package options:\levelchar#1\actualchar{\protect\ttfamily#1}}%
\@esphack
}
\DeclareRobustCommand\packageoption[1]{\texttt{#1}\poindex{#1}}
\newcommand\eoindex[1]
{%
\@bsphack
\HD@page@wrindex{#1\actualchar{\protect\ttfamily#1} \mbox{(environment option)}}%
\HD@page@wrindex{environment options:\levelchar#1\actualchar{\protect\ttfamily#1}}%
\@esphack
}
\DeclareRobustCommand\environmentoption[1]{\texttt{#1}\eoindex{#1}}
\newcommand\dontsplit
{\@nobreaktrue\nopagebreak}
\renewcommand*\descriptionlabel[1]{\hspace\labelsep
\normalfont\bfseries\boldmath #1}
\makeatother
\usepackage[numbered]{hypdoc}
\definecolor{lstbgcolor}{rgb}{0.9,0.9,0.9}
\usepackage{listings}
\lstloadlanguages{[LaTeX]TeX}
\lstset{breakatwhitespace=true,breaklines=true,language=TeX}
\usepackage{fancyvrb}
\renewcommand\topfraction{.9}
\renewcommand\bottomfraction{.5}
\renewcommand\textfraction{.1}
\renewcommand\floatpagefraction{.8}
\newfloat{Example}{hbtp}{loe}
\newenvironment{example}[2]
{\def\excaption{#1}\def\exlabel{#2}%
\VerbatimEnvironment
\begin{VerbatimOut}[gobble=2]{example.out}}
{\end{VerbatimOut}
\begin{Example}
\centering\parindent0pt
\fbox{\begin{minipage}{.9\linewidth}
\lstset{breakatwhitespace=true,breaklines=true,language=[LaTeX]TeX,basicstyle=\small\ttfamily,flexiblecolumns}
\lstinputlisting[]{example.out}
\end{minipage}}
\fbox{\begin{minipage}{.9\linewidth}
\footnotesize\parindent=1em
\input{example.out}
\end{minipage}}%
\caption{\excaption}\label{\exlabel}
\end{Example}
}
\newenvironment{texcode}
{%
\lstset{breakatwhitespace=true,breaklines=true,language=[LaTeX]TeX,basicstyle=\small\ttfamily,flexiblecolumns}
\begin{lstlisting}
}
{%
\end{lstlisting}
}
\newenvironment{quotecode}
{%
\begin{quote}
\begin{lrbox}{\pqbox}
\begin{minipage}{\dimexpr\linewidth-2\fboxsep-2\fboxrule\relax}
}
{
\end{minipage}
\end{lrbox}
\fbox{\usebox{\pqbox}}
\end{quote}
}
\immediate\write18{makeindex -s gglo.ist -o pullquote.gls pullquote.glo}
\immediate\write18{makeindex -s gind.ist pullquote.idx}
\EnableCrossrefs
\CodelineIndex
\RecordChanges
\begin{document}
\DocInput{\jobname.dtx}
\PrintChanges
\PrintIndex
\end{document}
%</driver>
% \fi
%
%
% \CharacterTable
% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
% Digits \0\1\2\3\4\5\6\7\8\9
% Exclamation \! Double quote \" Hash (number) \#
% Dollar \$ Percent \% Ampersand \&
% Acute accent \' Left paren \( Right paren \)
% Asterisk \* Plus \+ Comma \,
% Minus \- Point \. Solidus \/
% Colon \: Semicolon \; Less than \<
% Equals \= Greater than \> Question mark \?
% Commercial at \@ Left bracket \[ Backslash \\
% Right bracket \] Circumflex \^ Underscore \_
% Grave accent \` Left brace \{ Vertical bar \|
% Right brace \} Tilde \~}
%
%
% \changes{1.0}{2012/09/06}{Converted to DTX file}
%
% \DoNotIndex{\newcommand,\newenvironment}
% \DoNotIndex{\def,\long,\edef,\xdef,\gdef,\let,\global}
% \DoNotIndex{\if,\ifnum,\ifdim,\ifcat,\ifmmode,\ifvmode,\ifhmode,%
% \iftrue,\iffalse,\ifvoid,\ifx,\ifeof,\ifcase,\else,\or,\fi}
% \DoNotIndex{\box,\copy,\setbox,\unvbox,\unhbox,\hbox,%
% \vbox,\vtop,\vcenter}
% \DoNotIndex{\@empty,\empty,\immediate,\write,\@tempdima,\@tempdimb,\@tempcnta,\@tmp}
% \DoNotIndex{\egroup,\bgroup,\expandafter,\begingroup,\endgroup}
% \DoNotIndex{\divide,\advance,\multiply,\count,\dimen}
% \DoNotIndex{\relax,\space,\string}
% \DoNotIndex{\csname,\endcsname,\@spaces,\openin,\openout,%
% \closein,\closeout}
% \DoNotIndex{\catcode,\endinput}
% \DoNotIndex{\jobname,\message,\read,\the,\noexpand}
% \DoNotIndex{\hsize,\vsize,\hskip,\vskip,\kern,\hfil,\hfill,\hss}
% \DoNotIndex{\m@ne,\z@,\z@skip,\@ne,\tw@,\p@,\strip@pt}
% \DoNotIndex{\dp,\wd,\ht,\vss,\unskip}
% \DoNotIndex{\@nil,\do,\next,\repeat}
% \DoNotIndex{\ ,\vspace}
% \DoNotIndex{\dimexpr,\numexpr,\number}
% \tolerance9999
% \providecommand*{\url}{\texttt}
% \GetFileInfo{pullquote.dtx}
% \newsavebox\pqbox
% \makeatletter
% \gdef\tshortstack{\@ifnextchar[\@tshortstack{\@tshortstack[c]}}
% \gdef\@tshortstack[#1]{%
% \leavevmode
% \vtop\bgroup
% \baselineskip-\p@\lineskip 3\p@
% \let\mb@l\hss\let\mb@r\hss
% \expandafter\let\csname mb@#1\endcsname\relax
% \let\\\@stackcr
% \@ishortstack}
% \makeatother
% \title{The \textsf{pullquote} package}
% \author{Stephan Lehmke \\ \url{mailto:[email protected]} \\ \url{www.docscape.de}}
% \date{\fileversion~from \filedate}
%
%
% \maketitle
%
% \begin{abstract}
% A \emph{pull quote} (also known as a lift-out quote) is a
% quotation or excerpt from an article that is typically placed in a
% larger or distinctive typeface on the same page, serving to entice
% readers into an article or to highlight a key topic (from
% \href{http://en.wikipedia.org/wiki/Pull_quote}{Wikipedia}).
%
% In journal publishing, where multi-column typesetting is common, a
% pull quote is usually placed between two columns, inside a
% `window' which is cut out of the columns' text flow. Pictures and
% other graphical objects are also often placed this way.
%
% This package implements an environment for typesetting a balanced
% two-column text with a cut-out window of customizeable shape in
% which an arbitrary object is positioned.
% \end{abstract}
%
% \tableofcontents
%
% \listof{Example}{Examples}
%
%
% \def\alicetext
% {%
% \selectlanguage{english}%
% They were indeed a queer-looking party that assembled on the bank--the birds with draggled feathers, the animals with their fur clinging close to them, and all dripping wet, cross, and uncomfortable.
%
% The first question of course was, how to get dry again: they had a consultation about this, and after a few minutes it seemed quite natural to Alice to find herself talking familiarly with them, as if she had known them all her life. Indeed, she had quite a long argument with the Lory, who at last turned sulky, and would only say, `I am older than you, and must know better'; and this Alice would not allow without knowing how old it was, and, as the Lory positively refused to tell its age, there was no more to be said.
%
% At last the Mouse, who seemed to be a person of authority among them, called out, `Sit down, all of you, and listen to me! I'll soon make you dry enough!' They all sat down at once, in a large ring, with the Mouse in the middle. Alice kept her eyes anxiously fixed on it, for she felt sure she would catch a bad cold if she did not get dry very soon.
%
% `Ahem!' said the Mouse with an important air, `are you all ready? This is the driest thing I know. Silence all round, if you please! "William the Conqueror, whose cause was favoured by the pope, was soon submitted to by the English, who wanted leaders, and had been of late much accustomed to usurpation and conquest. Edwin and Morcar, the earls of Mercia and Northumbria--"'
%
% `Ugh!' said the Lory, with a shiver.
%
% `I beg your pardon!' said the Mouse, frowning, but very politely: `Did you speak?'
%
% `Not I!' said the Lory hastily.
%
% `I thought you did,' said the Mouse. `--I proceed. "Edwin and Morcar, the earls of Mercia and Northumbria, declared for him: and even Stigand, the patriotic archbishop of Canterbury, found it advisable--"'
%
% `Found what?' said the Duck.
%
% `Found it,' the Mouse replied rather crossly: `of course you know what "it" means.'
%
% `I know what "it" means well enough, when I find a thing,' said the Duck: `it's generally a frog or a worm. The question is, what did the archbishop find?'
%
% The Mouse did not notice this question, but hurriedly went on, `"--found it advisable to go with Edgar Atheling to meet William and offer him the crown. William's conduct at first was moderate. But the insolence of his Normans--" How are you getting on now, my dear?' it continued, turning to Alice as it spoke.
% }
%
% \section{Introduction}
%
% This is an \emph{experimental} package for inserting an arbitrary
% object into a two-column balanced text flow such that a ``window''
% of appropriate size is cut out of the text at the place the object
% is inserted.
%
% Different window shapes are supported, for instance rectangular and
% circular shapes. New shapes can easily be added by providing a
% specific type of macro called \emph{shape function}.
%
% In its current state, the package is more like a proof of concept,
% demonstrating how this effect can be achieved by \TeX\ macro
% programming. For being really useful, there are too many
% restrictions at the time being. See sections \ref{sec:Requirements},
% \ref{sec:Limitations},
% and \ref{sec:Extensions}.
% \begin{figure}
% \begin{lrbox}{\pqbox}
% \begin{minipage}{\textwidth}
% \begin{pullquote}
% {%
% object=%
% {\begin{tabular}[b]{p{4cm}}
% \midrule
% \textit{Wir m\"ussen wissen.}\\
% \textit{Wir werden wissen.}\\
% \mbox{}\hfill\small\textsc{David Hilbert}\\
% \midrule
% \end{tabular}}%
% }
% \selectlanguage{latin}\lipsum[1-4]
% \end{pullquote}
% \end{minipage}
% \end{lrbox}
% \begin{minipage}[b]{\dimexpr.5\textwidth-3mm}
% \resizebox{\linewidth}{!}{\usebox{\pqbox}}
% \caption{Text with rectangular insert using \texttt{pullquote}.}
% \label{fig:rectpq}
% \end{minipage}\hfill
% \begin{lrbox}{\pqbox}
% \begin{minipage}{\textwidth}
% \begin{pullquote}
% {%
% shape=circular,%
% object=%
% {%
% \begin{tikzpicture}
% \clip (0,0) circle (2.7cm);
% \node (0,0) {\includegraphics[width=5.2cm]{pq-alice}};
% \end{tikzpicture}%
% }
% }
% \alicetext
% \end{pullquote}
% \end{minipage}
% \end{lrbox}
% \begin{minipage}[b]{\dimexpr.5\textwidth-3mm}
% \resizebox{\linewidth}{!}{\usebox{\pqbox}}
% \caption{Text with circular insert using
% \texttt{shape=circular}. Text and image by \textsc{Lewis Carroll} (pdf from \url{gasl.org}) [Public domain], via Wikimedia Commons.}
% \label{fig:circpq}
% \end{minipage}
%
% \bigskip
% \bigskip
%
% \begin{lrbox}{\pqbox}
% \begin{minipage}{\textwidth}
% \begin{pullquote}{shape=image,image=pq-duck.pdf,imageopts={width=5cm}}\lipsum[1-3]
% \end{pullquote}
% \end{minipage}
% \end{lrbox}
% \begin{minipage}[b]{\dimexpr.5\textwidth-3mm}
% \resizebox{\linewidth}{!}{\usebox{\pqbox}}
% \caption{Text with insert based on image shape using
% \texttt{shape=image}. Image by
% \href{http://tex.stackexchange.com/users/3094/paulo-cereda}{Paulo Cereda}.}
% \label{fig:imgpq}
% \end{minipage}
% \end{figure}
%
% Figures \ref{fig:rectpq}--\ref{fig:imgpq} show some examples of
% the style of formatting possible with this package.
%
% You are invited to test this package and find useful applications
% for it, but please be prepared for unexpected failures.
%
% The package was implemented in the course of answering the questions
% \href{http://tex.stackexchange.com/questions/45958/implementing-a-pullquotes-algorithm-in-latex}{``Implementing
% a pullquotes algorithm in \LaTeX''} and
% \href{http://tex.stackexchange.com/questions/53073/two-column-text-with-circular-insert}{``Two-column
% text with circular insert''} on the
% \href{http://tex.stackexchange.com}{Q\&A site \TeX\ Stack
% Exchange}. Report bugs at \href{https://launchpad.net/tex-sx/}{the
% \TeX-SX Launchpad site}. There is also a
% \href{http://chat.stackexchange.com/rooms/409/from-answers-to-packages}{chatroom}
% dedicated to the \TeX-SX packages.
%
% As soon as the package is a bit more bug-free, basically documented
% and acceptably user-friendly, it will be prepared for publication on
% \href{http://www.ctan.org}{CTAN}.
%
% \section{Requirements}\label{sec:Requirements}
%
% \subsection{Required Packages}
%
% The \package{pullquote} package automatically loads the following
% further packages:
% \begin{enumerate}
% \item \package{etoolbox}, \package{environ}, \package{keyval}.
% \item \package{microtype} (only if the package option
% \packageoption{nomicrotype} is
% \emph{not} given): The text formatting done by this package can get
% awfully `tight' when text flows around objects. \package{microtype}
% significantly improves typographic quality in these situations. Use
% the option \packageoption{nomicrotype} only if you want to load
% \package{microtype} yourself and
% avoid option clashes.
% \item \package{graphicx} (only if the package option \packageoption{noimageshapes} is
% \emph{not} given): As the \texttt{pullquote} environment with the
% option \texttt{shape=image} executes a
% call to \cs{includegraphics} in the \package{graphicx} variant, this
% package is needed unless you explicitly deactivate that option.
% \end{enumerate}
%
% \subsection{External Calls to Image Magick}\label{sec:Requirements:ImageMagick}
%
% The \texttt{pullquote} environment with the
% option \texttt{shape=image} will generate an external system
% call to the command \texttt{convert} from the image manipulation
% software \href{http://www.imagemagick.org/}{Image Magick}. The
% purpose of this call is to determine the \emph{shape} of an inserted
% image to get an appropriate `smooth' text flow around the image.
%
% This option doesn't make sense without that call, so to use this
% option, you need to fulfil the following requirements.
%
% \begin{enumerate}
% \item The software package \href{http://www.imagemagick.org/}{Image
% Magick} should be installed on your computer such that the command
% \texttt{convert} can be called from a command shell. You can check
% whether your installation will work for the purposes of this package
% by pasting the following call into a command shell \textbf{all on
% one line}:
% \begin{verbatim}
% convert pq-duck.pdf -resize 124.99362x123.20798! -bordercolor white
% -border 10x10 -morphology Erode Disk:10.3 -resize 26x13!
% -black-threshold 95% -monochrome pq-duck.pdf.pqshape.txt
% \end{verbatim}
% (assuming you're in the installation directory of the pullquote
% package and the file \texttt{pq-duck.pdf} is present).
%
% You should get no error message and a non-empty text file
% \texttt{pq-duck.pdf.pqshape.txt} should be produced.
%
% \item The \texttt{shell-escape} feature of \texttt{(pdf)tex},
% enabling \TeX\ to execute system commands, should be activated. If
% you don't want to activate it in a global configuration file, you
% should call |pdflatex| with the |--shell-escape| option.
%
% If you have generated this documentation and the example text in figure
% \ref{fig:imgpq} flows around the image, then all is well.
%
% \end{enumerate}
%
% If you don't meet these requirements or are not feeling secure when
% \TeX\ is calling external tools, then you can turn off the
% \texttt{shape=image} option by giving the \emph{package option}
% \packageoption{noimageshapes}.
%
% Even without the \texttt{shape=image} option, you can let text flow
% around the \emph{bounding box} of an image by using the default
% rectangular shape of the \texttt{pullquote} environment and giving
% an \cs{includegraphics} call as \texttt{object}.
%
% \subsubsection{Remarks on Ubuntu Linux}
%
% That's the system I'm testing with. Installing Image Magick should
% be as easy as typing
% \begin{verbatim}
% apt-get install imagemagick
% \end{verbatim}
% or using some dedicated installation tool like \texttt{synaptic}.
%
% I didn't have to configure anything special wrt.\
% \texttt{shell-escape}, though I'm not entirely sure why this is so\dots
%
% \subsubsection{Remarks on Windows}
%
% I am indebted to the user
% \href{http://tex.stackexchange.com/users/9237/speravir}{speravir}
% for providing the following comments on using \texttt{pullquote}
% with Windows.
%
% As I have no possibility to test on Windows myself, I did my best to
% translate it from German to English, but am otherwise providing this
% advice as-is. If you are getting good results in other ways, please
% report to me and I'll try to incorporate further advice.
%
% \bigskip
%
% Image Magick needs to be installed on your system. Unfortunately,
% there is already a system command \texttt{convert.exe} for
% converting FAT-drives into NTFS-drives. So you need to make sure
% that after installation, \texttt{convert} from the Image Magick
% suite is found \emph{before} the system version of \texttt{convert}.
%
% \paragraph{Installation:}
% \begin{enumerate}
% \item Download the binary release from
% \url{http://www.imagemagick.org/}, ideally in the form of an
% \emph{Installer}. The portable version will pose problems (see below).
% \item Install. It is important that the program inserts itself into
% the system path |%PATH%| \emph{in front of} the entry for
% |C:\Windows\system32| to make sure that a call to \texttt{convert}
% will call the program from the Image Magick suite.
% \item
% This will not work with the portable version of Image Magick, so in
% that case the tool should be called via a batch file where the
% system path is set.
% \item
% When using MiK\TeX-portable, the \emph{start batch} needs to be
% augmented. See the following answer on \TeX.SX:
% \begin{center}
% \url{http://tex.stackexchange.com/questions/50911/using-miktex-portable-texmaker-and-asymptote-from-a-usb-drive/51110#51110}
% \end{center}
% The topic there was \emph{Asymptote}, but it's the same principle.
% \end{enumerate}
%
% \bigskip
%
% When executing \TeX, the command line option |--enable-write18| (or
% the alias |--shell-escape|) has to be set. People using a \TeX-editor
% need to configure this in the appropriate place.
%
% \section{Usage}
%
% \subsection{Package Options}
% Currently, there are only some simple options to pre-configure this package:
% \begin{description}
% \item[\packageoption{nomicrotype}] Normally, the \package{pullquote} package loads
% the package \package{microtype} which enhances typesetting in `tight
% places'. If you don't want to have this package loaded by
% \package{pullquote} because you don't want to use it or want to load
% it yourself, you can disable it by this package option.
%
% The package is not strictly neccessary for anything
% \texttt{pullquote} does, so apart from slightly worse typesetting
% quality, you won't notice anything when giving that option.
%
% \item[\packageoption{noimageshapes}] The option \texttt{shape=image} of the
% \texttt{pullquote} environment requires loading the package
% \package{graphicx} as well as the possibility to make an external
% system call to the software \href{http://www.imagemagick.org/}{Image
% Magick} (see section \ref{sec:Requirements:ImageMagick}).
%
% You can avoid all this by turning off this part of
% \package{pullquote} by giving this package option. Note that using
% the option \texttt{shape=image} will give an error message in this
% case.
% \end{description}
%
% \subsection{Basic Configuration}
%
% All of the configuration parameters for the \texttt{pullquote}
% environment can be specified by appropriate environment options; see
% section \ref{sec:Usage:Options}. Most of these options have
% \emph{canonical} defaults; for some of them you can specify default
% values by setting the following registers.
%
% \begin{description}
% \item[\cs{textcoldist}] \DescribeMacro{\textcoldist} The distance
% between the two text
% columns. Default for the option \texttt{textcoldist}. You can set
% this register to 6mm by
% \begin{verbatim}
% \setlength{\textcoldist}{6mm}
% \end{verbatim}
% \default{4mm}
%
% \item[\cs{objdist}] \DescribeMacro{\objdist} The distance around the
% inserted object. Default
% for the option \texttt{objdist}. You can set
% this register to 6mm by
% \begin{verbatim}
% \setlength{\objdist}{6mm}
% \end{verbatim}
% \default{4mm}
% \end{description}
%
% \subsection{Basic Usage}\label{sec:Usage:Basic}
%
% To make a two-column text with a pull quote, you need
% \begin{itemize}
% \item some \emph{text}, which will be denoted by \ttarg{text} below and
% \item an \emph{object} to be inserted between the columns, denoted
% by \ttarg{object}.
% \end{itemize}
%
% Then creating the pull quote representation is as easy as
% calling\DescribeEnv{pullquote}\dontsplit
% \begin{quotecode}
% |\begin{pullquote}{object=|\ttarg{object}|}|\\
% \mbox{\quad}\ttarg{text}\\
% |\end{pullquote}|
% \end{quotecode}
%
% Example \ref{Ex:first} assumes you have loaded the package
% \package{lipsum} which provides a macro for \emph{blind text}.
% \begin{example}{Pull quote with tabular text \ttarg{object}.}{Ex:first}
% \begin{pullquote}
% {object=%
% {%
% \large\itshape
% \begin{tabular}{@{}l@{}}
% This is the\\pullquote text
% \end{tabular}%
% }%
% }%
% \selectlanguage{latin}\lipsum[1]
% \end{pullquote}
% \end{example}
%
% In general, the \texttt{pullquote} environment is called like this:\dontsplit
% \begin{quotecode}
% |\begin{pullquote}{|\ttarg{options}|}|\\
% \mbox{\quad}\ttarg{text}\\
% |\end{pullquote}|
% \end{quotecode}
%
% The content of the \texttt{pullquote} environment is just
% \ttarg{text}, while the \emph{mandatory argument} \ttarg{options} of
% the environment contains a comma-separated option list for
% configuring the appearance of the pull quote construction. It's
% similar to the \emph{key-value style} options which can be given to
% \cs{includegraphics} from the \package{graphicx} package, only here
% the argument is not optional because the \ttarg{object} always needs
% to be specified (usually with the \texttt{object} key, only in the
% special case of \emph{image shapes} you need to use the
% \texttt{image} key; see section \ref{sec:Usage:ImageShapes}). A full
% list of option keys and their use is described in section
% \ref{sec:Usage:Options}.
%
% The use of \texttt{tabular} above is only one way of arranging text
% for use as \ttarg{object}. In fact, every \LaTeX\ construct of fixed
% \emph{width} and \emph{height} qualifies, for instance \cs{makebox},
% \cs{parbox} or \texttt{minipage}.
%
% Another typical choice for \ttarg{object} is an \emph{image}, like
% in example \ref{Ex:second}.
% \begin{example}{Pull quote with image \ttarg{object}.}{Ex:second}
% \begin{pullquote}
% {object={\includegraphics[width=2cm]{pq-duck}}}%
% \selectlanguage{latin}\lipsum[1]
% \end{pullquote}
% \end{example}
%
% Example \ref{Ex:options} shows some more options in use, with an object
% made by clipping an image with a circular path using Ti\textit{k}Z,
% a circular-shaped ``window'', an explicit \emph{vertical offset} and
% a slightly tighter distance between text and object than the usual
% default. The text by \textsc{Lewis Carroll} has been
% assigned to the macro \cs{alicetext}.
% \begin{example}{Pull quote with several options.}{Ex:options}
% \begin{pullquote}
% {%
% shape=circular,objdist=2mm,objvoffset=3,%
% object=%
% {%
% \begin{tikzpicture}
% \clip (0,0) circle (1.7cm);
% \node (0,0) {\includegraphics[width=3.2cm]{pq-alice}};
% \end{tikzpicture}%
% }
% }
% \alicetext
% \end{pullquote}
% \end{example}
%
% \bigskip
%
% The \texttt{pullquote} environment is executed in the follwing steps:
% \begin{enumerate}
% \item Typeset \ttarg{object} into a \emph{box}, measuring its
% \emph{width} and \emph{total height}.
% \item Add the value given by the option \texttt{objdist} (see
% section \ref{sec:Usage:Options}) to the measured width and height
% as a distance on all sides.
% \item \emph{Normalise} the height (including distance) to a full
% number of text lines (measured in \cs{baselineskip}).
% \item The width and (normalised) height (including \texttt{objdist})
% give the total size of the ``window'' to be cut out of the text
% columns.
% \item Calculate the \emph{vertical position} of the window based on
% its height and the value of the options \texttt{objvalign} or
% \texttt{objvoffset}.
% \item Calculate a \cs{parshape} definition for the surrounding
% \ttarg{text} based on the size and position of the window.
% \item Typeset \ttarg{text} in two balanced columns according to the
% pre-calculated \cs{parshape} definition. This may take several
% attempts as it is impossible to estimate the exact number of lines
% needed to typeset all text (and that number may even vary
% depending on the exact `relative' position of the window and its
% influence on paragraph formatting). The correct balance is
% determined automatically by an internal loop.
% \item Arrange the balanced text columns with the object in the
% predefined position to output the complete \emph{pull quote}
% construct.
% \end{enumerate}
%
% \bigskip
%
% Summary of remarks and restrictions on \ttarg{text}:
% \begin{itemize}
% \item \ttarg{text} should be just continuous text interspersed with
% \cs{par}. The result of typesetting \ttarg{text} in the given column
% width (using the predefined \cs{parshape} construct) is supposed to
% be a collection of plain text lines with base line distance
% \cs{baselineskip} (with the value in force at the beginning of the
% \cs{pullquote} environment). These lines are processed sequentially
% for calculating the \cs{parshape} construct and balancing the
% columns.
% \item In particular, \ttarg{text} should \textbf{not} contain
% \begin{itemize}
% \item List environments like \texttt{itemize}, \texttt{quote} or
% \texttt{center}.
% \item Displayed math.
% \item Section headings.
% \item Any commands which change \cs{baselineskip}.
% \item Vertical spacing (or commands inserting it).
% \item Nothing which would make a line higher than usual text,
% which practically rules out \texttt{tabular} material.
% \item No fancy rules, frames or color tricks which can disturb
% \cs{parshape} or vertical splitting of text.
% \end{itemize}
% Some of these restrictions may be loosened with future versions of
% the package; see sections \ref{sec:Limitations} and
% \ref{sec:Extensions}.
% \end{itemize}
%
%
%
%
%
% \subsection{Environment Options}\label{sec:Usage:Options}
% Remember the \texttt{pullquote} environment is called like this:
% \begin{quotecode}
% |\begin{pullquote}{|\ttarg{options}|}|\\
% \mbox{\quad}\ttarg{text}\\
% |\end{pullquote}|
% \end{quotecode}
% In this section, all the possible option keys which can go into
% \ttarg{options} are explained, together with their usage and
% interdependencies.
%
% \begin{table}
% \centering
% \caption{Summary of Environment Options.}
% \label{tab:optsummary}
% \begin{tabularx}{\textwidth}{r>{\raggedright}Xll}
% \toprule
% \multicolumn{1}{l}{\textbf{Option}}&\textbf{Description}&\textbf{Default}&\textbf{P.}\\
% \cmidrule(r){1-1}\cmidrule(rl){2-2}\cmidrule(rl){3-3}\cmidrule(l){4-4}\addlinespace
% \environmentoption{textcoldist}&\texttt{=\meta{len}}\newline%
% Distance between text columns.&%
% \cs{textcoldist}&\pageref{eo:textcoldist}\tabularnewline\addlinespace
% \environmentoption{objdist}&\texttt{=\meta{len}}\newline%
% Distance inserted all around \ttarg{object}.&%
% \cs{objdist}&\pageref{eo:objdist}\tabularnewline\addlinespace
% \environmentoption{textcolwd}&\texttt{=\meta{len}}\newline%
% Width of one text column.&%
% $\frac{1}{2}\left(\footnotesize\begin{array}{@{}l@{}}\cs{linewidth}-{}\\\ttarg{textcoldist}\end{array}\right)$&\pageref{eo:textcolwd}\tabularnewline\addlinespace\midrule\addlinespace%
% \environmentoption{object}&\texttt{=\meta{object}}\newline%
% Object to be inserted between text columns.&%
% \textit{mandatory}&\pageref{eo:object}\tabularnewline\addlinespace
% \environmentoption{image}&\texttt{=\meta{file name}}\newline%
% Sets \ttarg{object} to be \texttt{\cs{includegraphics}\marg{file
% name}}.&%
% ---&\pageref{eo:image}\tabularnewline\addlinespace
% \environmentoption{imageopts}&\texttt{=\meta{opts}}\newline%
% \cs{includegraphics} options in conjunction with
% \environmentoption{image} key.&%
% ---&\pageref{eo:imageopts}\tabularnewline\addlinespace\midrule\addlinespace%
% \environmentoption{objvalign}&\texttt{=(top\string|middle\string|center\string|bottom)}\newline
% \emph{Vertical alignment} of the ``object window''.&%
% \texttt{middle}&\pageref{eo:objvalign}\tabularnewline\addlinespace
% \environmentoption{objvoffset}&\texttt{=\meta{offset}}\newline%
% \emph{Vertical offset} of the ``object window''.&%
% ---&\pageref{eo:objvoffset}\tabularnewline\addlinespace\midrule\addlinespace%
% \environmentoption{shape}&\texttt{=(rectangular\string|circular\string|image)}\newline%
% \emph{Shape} of the ``object window''.&%
% \texttt{rectangular}&\pageref{eo:shape}\tabularnewline\addlinespace%
% \environmentoption{shapefunction}&\texttt{=\meta{cs}}\newline%
% \emph{Shape function}.&%
% ---&\pageref{eo:shapefunction}\tabularnewline\addlinespace%
% \bottomrule
% \end{tabularx}
%
% \end{table}
%
% Table \ref{tab:optsummary} on page \pageref{tab:optsummary} gives a
% summary of all options.
%
% \subsubsection{Geometry Configuration}
% \begin{description}
% \item[\environmentoption{textcoldist}\texttt{=\meta{len}}\phantomsection\label{eo:textcoldist}] sets the distance between
% text columns produced by \texttt{pullquote} to \ttarg{len}. To
% change the distance to 5mm, use
% \begin{verbatim}
% textcoldist=5mm
% \end{verbatim}
% \default{\cs{textcoldist}}
% Compare example \ref{Ex:first} with example \ref{Ex:textcoldist}.
% \begin{example}{\texttt{textcoldist} example.}{Ex:textcoldist}
% \begin{pullquote}
% {textcoldist=1cm,%
% object=%
% {%
% \large\itshape
% \begin{tabular}{@{}l@{}}
% This is the\\pullquote text
% \end{tabular}%
% }%
% }%
% \selectlanguage{latin}\lipsum[1]
% \end{pullquote}
% \end{example}
%
% \item[\environmentoption{objdist}\texttt{=\meta{len}}\phantomsection\label{eo:objdist}] sets the distance inserted all
% around \ttarg{object} to \ttarg{len}. Note that the vertical
% distance can be slightly larger because it needs to be
% \emph{normalised} so that the ``window'' takes a full number of
% text lines.
%
% To
% change the distance to 5mm, use
% \begin{verbatim}
% objdist=5mm
% \end{verbatim}
% \default{\cs{objdist}}
% Compare example \ref{Ex:first} with example \ref{Ex:objdist}.
% \begin{example}{\texttt{objdist} example.}{Ex:objdist}
% \begin{pullquote}
% {objdist=1mm,%
% object=%
% {%
% \large\itshape
% \begin{tabular}{@{}l@{}}
% This is the\\pullquote text
% \end{tabular}%
% }%
% }%
% \selectlanguage{latin}\lipsum[1]
% \end{pullquote}
% \end{example}
%
% \item[\environmentoption{textcolwd}\texttt{=\meta{len}}\phantomsection\label{eo:textcolwd}] sets the width of one text
% column to \ttarg{len}. If this option is not given, then the default
% value
% \begin{displaymath}
% \frac{1}{2}\left(\cs{linewidth}-\ttarg{textcoldist}\right)
% \end{displaymath}
% is calculated in the moment the \texttt{pullquote} environment is
% executed, so the then-current value of \cs{linewidth} is respected.
%
% To
% change the value to 5cm, use
% \begin{verbatim}
% textcolwd=5cm
% \end{verbatim}
% \default{$\frac{1}{2}\left(\cs{linewidth}-\ttarg{textcoldist}\right)$}
% Compare example \ref{Ex:first} with example \ref{Ex:textcolwd}.
% \begin{example}{\texttt{textcolwd} example.}{Ex:textcolwd}
% \begin{pullquote}
% {textcolwd=4cm,%
% object=%
% {%
% \large\itshape
% \begin{tabular}{@{}l@{}}
% This is the\\pullquote text
% \end{tabular}%
% }%
% }%
% \selectlanguage{latin}\lipsum[1]
% \end{pullquote}
% \end{example}
% \end{description}
%
%
% \subsubsection{Object Specification}
% \emph{An \textbf{object} to be inserted between the text columns
% needs to be specified for every use of \texttt{pullquote}. This
% means one of the following keys has to occur in the mandatory
% argument of the \texttt{pullquote} environment.}
% \begin{description}
% \item[\environmentoption{object}\texttt{=\meta{object}}\phantomsection\label{eo:object}] specifies the object to be
% inserted
% between text columns, in the form of a `box-like' \LaTeX\ construct
% of fixed width and height. See example \ref{Ex:first} and section
% \ref{sec:Usage:Basic} for further description and examples.
%
% It is best to generally enclose \ttarg{object} in curly braces |{}|
% to avoid conflicts with parsing the key-value list.
%
% In the case that the option \environmentoption{shape}\texttt{=image} is given, the
% object \emph{needs to be specified with the \texttt{image} key}!
%
% \item[\environmentoption{image}\texttt{=\meta{file name}}\phantomsection\label{eo:image}] specifies the \ttarg{object}
% to be \texttt{\cs{includegraphics}\marg{file name}}. When the
% \environmentoption{imageopts}\texttt{=\meta{opts}} key is also given, (see below), this
% becomes
% \texttt{\ttarg{object}=\cs{includegraphics}\oarg{opts}\marg{file
% name}}.
%
% Compare example \ref{Ex:second} with example \ref{Ex:image}.
% \begin{example}{\environmentoption{image} example.}{Ex:image}
% \begin{pullquote}
% {image=pq-duck,imageopts={width=2cm}}%
% \selectlanguage{latin}\lipsum[1]
% \end{pullquote}
% \end{example}
%
% \item[\environmentoption{imageopts}\texttt{=\meta{opts}}\phantomsection\label{eo:imageopts}] specifies the
% \cs{includegraphics} options in conjunction with the \environmentoption{image}
% key (see above).
% \end{description}
%
%
% \subsubsection{Vertical Position of Object Window}
% \begin{description}
% \item[\environmentoption{objvalign}\texttt{=(top\string|middle\string|center\string|bottom)}\phantomsection\label{eo:objvalign}] specifies the
% \emph{vertical
% alignment} of the ``object window'' relative to the text
% columns. The following values for this key are valid:
% \begin{description}
% \item[\texttt{top}] Uppermost position.
% \item[\texttt{middle} or \texttt{center}] Centered position (default).
% \item[\texttt{bottom}] Lowermost position.
% \end{description}
% Compare example \ref{Ex:first} with examples \ref{Ex:valigntop} and
% \ref{Ex:valignbottom}.
% \begin{example}{\protect\environmentoption{objvalign}\texttt{=top} example.}{Ex:valigntop}
% \begin{pullquote}
% {objvalign=top,%
% object=%
% {%
% \large\itshape
% \begin{tabular}{@{}l@{}}
% This is the\\pullquote text
% \end{tabular}%
% }%
% }%
% \selectlanguage{latin}\lipsum[1]
% \end{pullquote}
% \end{example}
% \begin{example}{\protect\environmentoption{objvalign}\texttt{=bottom} example.}{Ex:valignbottom}
% \begin{pullquote}
% {objvalign=bottom,%
% object=%
% {%
% \large\itshape
% \begin{tabular}{@{}l@{}}