summaryrefslogtreecommitdiff
path: root/macros/generic/infpic
diff options
context:
space:
mode:
authorNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
committerNorbert Preining <norbert@preining.info>2019-09-02 13:46:59 +0900
commite0c6872cf40896c7be36b11dcc744620f10adf1d (patch)
tree60335e10d2f4354b0674ec22d7b53f0f8abee672 /macros/generic/infpic
Initial commit
Diffstat (limited to 'macros/generic/infpic')
-rw-r--r--macros/generic/infpic/incpic.mf339
-rw-r--r--macros/generic/infpic/incpic.tex438
-rw-r--r--macros/generic/infpic/mf180.bat6
-rw-r--r--macros/generic/infpic/mf300.bat6
-rw-r--r--macros/generic/infpic/sipky.mf27
-rw-r--r--macros/generic/infpic/voting1.cs269
6 files changed, 1085 insertions, 0 deletions
diff --git a/macros/generic/infpic/incpic.mf b/macros/generic/infpic/incpic.mf
new file mode 100644
index 0000000000..4399517f77
--- /dev/null
+++ b/macros/generic/infpic/incpic.mf
@@ -0,0 +1,339 @@
+% do uverejneni clanku o INCPIC.TEX v TeX bulletinu mohou podlehat makra
+% INCPIC.MF a INCPIC.TEX vyvojovym zmenam. Jakekoliv chyby, ktere se
+% vyskytnou, mi laskave sdelte. Dekuji
+%
+% Macro for drawing simple pictures in METAFONT
+% For each character the width and height is given also in user's units.
+% All points are expressed in user's unit (without length units).
+% For more comment see end of this file.
+% Detail description appeared (in Czech) in TeXbulletin 1992, No 2,3
+%
+% Prague, July 29, 1992 Oldrich Ulrych
+% Mathematical institute of Charles University
+% email: oulrych@cspguk11.bitnet
+%
+% new definition for screen window
+%
+def openit = openwindow currentwindow
+ from origin to (640,480) at (-50,350); enddef;
+%
+% neither mesh nor rounding box are generated by default
+%
+showmesh:=0; % don't show given mesh
+showbox:=0; % don't make box around
+ou_showmesh:=0;
+ou_showbox:=0;
+%
+% private mode for intial suggestion of pictures;
+%
+mode_def ouproof =
+ proofing:=2; % yes, we're making full proofs
+ fontmaking:=0; % no, we're not making a font
+ tracingtitles:=1; % yes, show titles online
+ pixels_per_inch:=100;% original is that's 36 pixels per pt
+ blacker:=0; % no additional blackness
+ fillin:=0; % no compensation for fillin
+ o_correction:=1; % no reduction in overshoot
+ showmesh:=1; % show given mesh
+ showbox:=1; % make box around
+ ou_showmesh:=1;
+ ou_showbox:=1;
+ enddef;
+%
+% choosing the mode
+%
+if unknown mode: mode=ouproof; fi % selection of private mode for proofing
+%
+% redefined beginch and endch for plotting pictures
+%
+def beginch(expr c, % code of character
+ w_sharp, % sharp width
+ h_sharp, % sharp height
+ d_sharp, % sharp depth
+ number_of_xunits, % width of char in user's units
+ number_of_yunits)= % height of char in user's units
+ begingroup
+ transform end_of_beginch;
+ charcode:=if known c: byte c else: 0 fi;
+ charwd:=w_sharp; charht:=h_sharp; chardp:=d_sharp; charic:=0;
+ w:=hround(charwd*hppp); h:=vround(charht*hppp); d:=vround(chardp*hppp);
+ fontdimen byte c-63 : w_sharp/number_of_xunits; %% measure of x-unit
+ fontdimen byte c-43 : h_sharp/number_of_yunits; %% measure of y-unit
+ x_unit:=w/number_of_xunits; nx_unit:=number_of_xunits; % auxiliary x-unit
+ y_unit:=h/number_of_yunits; ny_unit:=number_of_yunits; % auxiliary y-unit
+ w:=number_of_xunits; h:=number_of_yunits;
+ d:=h*d_sharp/h_sharp;
+ charic:=0; clearxy; clearit; clearpen; scantokens extra_beginchar;
+ aux_sx:=x_unit; aux_sy:=y_unit;
+ currenttransform:=identity xscaled aux_sx yscaled aux_sy;
+ shiftorigin(0,0);
+ end_of_beginch:=currenttransform;
+ enddef;
+%
+def endch =
+ currenttransform:=end_of_beginch;
+ gl_showmesh:=showmesh;
+ gl_showbox :=showbox;
+ showmesh:=ou_showmesh;
+ showbox :=ou_showbox;
+ if proofing>0: makebox(proofrule); fi % I don't like rules
+ if gl_showmesh>0: mesh; fi % show given mesh
+ if gl_showbox>0: roundingbox; fi % make box around
+ chardx:=w; % desired width of the character in pixels
+ charic:=orig_x_shift*charwd/nx_unit;
+ if orig_x_shift<>0: fontdimen charcode-23 : orig_y_shift*charht/ny_unit; fi;
+ scantokens extra_endchar;
+ shipit;
+ if displaying>0: showit; fi
+ endgroup enddef;
+%
+% macros used in endch;
+%
+def roundingbox =
+ pickup pencircle scaled 0.4pt;
+ draw(0,-d)--(w,-d)--(w,h)--(0,h)--(0,-d);
+ draw(0,0)--(w,0);
+ enddef;
+def mesh =
+ pickup pencircle scaled 0.4pt;
+ for i=0 step 1 until w: draw (i,-d)--(i,h); endfor;
+ for i=0 step 1 until h: draw (0,i)--(w,i); endfor;
+ if d>0: for i=0 step 1 until d: draw (0,-i)--(w,-i); endfor; fi;
+ enddef;
+%
+% macro for shift of user's origin
+%
+def shiftorigin(expr x,y) =
+ orig_x_shift:=x; orig_y_shift:=y;
+ currenttransform:=currenttransform shifted
+ (-orig_x_shift*aux_sx,-orig_y_shift*aux_sy);
+enddef;
+%
+% path for plotting arrow and axes;
+%
+path sharparrow;
+sharparrow:=(-3,1)..{right}(0,0)&(0,0){left}..(-3,-1);
+def axes expr bod =
+ draw (0+orig_x_shift,ypart bod)--(w+orig_x_shift,+ypart bod);
+ draw (xpart bod,-d+orig_y_shift)--(xpart bod,h+orig_y_shift);
+ filldraw arrow(hround(3mm#*hppp),90) shifted (xpart bod,h+orig_y_shift);
+ filldraw arrow(hround(3mm#*hppp), 0) shifted (w+orig_x_shift,ypart bod);
+enddef;
+def vector(expr poc,kon) =
+ draw poc--kon;
+ filldraw arrow(hround(2mm#*hppp),angle(kon-poc)) shifted kon;
+enddef;
+def arrow (expr delka, smer)=
+ begingroup turningcheck:=0;
+ ((-delka,-2/7delka){dir45}..{right}(0,0)&(0,0){left}..{dir135}
+ (-delka, 2/7delka)&(-delka, 2/7delka)..controls (-3/4delka,0)..cycle)
+ rotated smer xscaled (1/aux_sx) yscaled (1/aux_sy)
+ endgroup
+enddef;
+%
+% macro for dotted and dashed lines
+%
+s__r:=10;
+def add_slen(expr a,b) =
+ s__x:=(xpart(b)-xpart(a))*x_unit/(hppp*s__r);
+ s__y:=(ypart(b)-ypart(a))*y_unit/(hppp*s__r);
+ s__:=s__+length((s__x,s__y));
+enddef;
+def cerchovane (expr a,b)=
+ s__:=0; add_slen(a,b);
+ ju:=round(s__);
+ for i=1 upto ju:
+ t1:=(2*i-2)/(2*ju-1);
+ t2:=(2*i-1)/(2*ju-1);
+ draw t1[a,b]--t2[a,b];
+ t1:=(2*i)/(2*ju-1);
+ if i<ju: drawdot (0.5t1+0.5t2)[a,b]; fi;
+ endfor;
+ enddef;
+def dashed(expr a,b)=
+ s__:=0; add_slen(a,b);
+ ju:=round(s__);
+ for i=4 step 4 until 4*ju:
+ t1:=i/(4*ju); t2:=(i-1)/(4*ju); t3:=(i-3)/(4*ju); t4:=(i-4)/(4*ju);
+ draw t1[a,b]--t2[a,b]; draw t3[a,b]--t4[a,b];
+ endfor;
+ enddef;
+eps_:=0.001; len_given:=1;
+def dashedpath expr g_path =
+ p_count:=length(g_path);
+ t_left:=0; t_right:=0.1p_count;
+ forever: pair aa_; aa_=point t_left of g_path;
+ forever:
+ t_middlea:=1/4[t_left,t_right]; t_middleb:=3/4[t_left,t_right];
+ pair ab_,ac_,ad_;
+ ab_=point t_middlea of g_path;
+ ac_=point t_middleb of g_path; ad_=point t_right of g_path;
+ s__:=0; add_slen(aa_,ab_); add_slen(ab_,ac_); add_slen(ac_,ad_);
+ len_dash:=s__;
+ exitunless (abs(len_dash-len_given)>eps_);
+ exitunless (t_right<p_count);
+ len_dash:=len_given/len_dash;
+ t_right:=len_dash[t_left,t_right];
+ if (t_right>p_count): t_right:=p_count; fi;
+ endfor;
+ tenkepero;
+ draw subpath (t_left,t_middlea) of g_path;
+ draw subpath (t_middleb,t_right) of g_path;
+ last_dif:=t_right-t_left;
+ t_left:=t_right;
+ exitunless (t_right<p_count);
+ t_right:=t_left+last_dif;
+ if (t_right>p_count): t_right:=p_count; fi;
+ endfor;
+enddef;
+%
+% various pens
+%
+def penfordots = pickup pencircle scaled 10thinestline; enddef;
+def thickpen = pickup pencircle scaled 4thinestline; enddef;
+def middlepen = pickup pencircle scaled 2thinestline; enddef;
+def thinpen = pickup pencircle scaled thinestline; enddef;
+def drawdots (text t) = for $=t: drawdot $; endfor; enddef;
+def cdrawdot expr bod =
+ drawdot bod; pickup currentpen scaled 2/3; erase drawdot bod;
+ pickup currentpen scaled 1.5;
+enddef;
+def cdrawdots (text t) =
+ for $=t: drawdot $; endfor;
+ pickup currentpen scaled 2/3;
+ for $=t: erase drawdot $; endfor;
+ pickup currentpen scaled 1.5;
+enddef;
+%
+% Czech equivalents and equivalents of previous versions
+%
+let peronatecky=penfordots;
+let peronapuntiky=penfordots;
+let tenkepero=thinpen;
+let strednipero=middlepen;
+let tlustepero=thickpen;
+let puntiky=drawdots;
+let krouzek=cdrawdot;
+let drawcontourdot=cdrawdot;
+let drawcontourdots=cdrawdots;
+let krouzky=cdrawdots;
+let carkovane=dashed;
+let carkovanacesta=dashedpath;
+%
+% call mode_setup
+%
+font_size 100mm#;
+mode_setup;
+thinestline:=0.4pt;
+
+%endinput;
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% The overview of the preparation of the picture is following:
+% - make a chart of the picture on the paper with the regular scale.
+% - put down the coordinate system (using mesh on the paper --- units
+% correspond to the mesh)
+% - mark the significant points for drawing
+% - put the description into the picture
+% - make oblong around the picture (using the mesh on the paper)
+% in such a way that the description in the picture is included;
+% this oblong corresponds to the rounding box of the the character
+% in which the picture will be placed
+% - choose the reference point (on the left side of the rounding box)
+% of the character
+% - create metafont source of the chart --- besides the usual commands
+% of metafont the definitions from this package can simplify
+% the writing of metafont source (see below) and enable to transfer
+% some important information through font to the TeX document
+% - place the character from the new font created into the TeX document;
+% some significant dimensions are stored in fontdimens, so they can
+% simplify the placing of the description into the picture
+%
+% Useful definitions from this macro package (with the context of the
+% procedure described above):
+%
+% beginch(char,width,height,depth,x_units,y_units); introduces the
+% created character; the parameters have the following meaning:
+% char - code of the character (admissible values are: "A" to "I",
+% (or "A" to "S" if macro shiftorigin is not used))
+% width - width of the character in sharp units (for example 20mm#)
+% height - height of the character in sharp units
+% depth - depth of the character in sharp units
+% x_units - width of the picture expressed in the number of the
+% "squares" of the mesh on the paper (i.e. natural number
+% just number without any units)
+% y_units - height of the character (not depth) expressed in the
+% number of the "squares" of the mesh on the paper (i.e.
+% natural number just number without any units)
+% Using this macro as the begin of the character, all points can be
+% given in the number of the "squares" of the mesh on the paper (no
+% measures are needed). (If c denotes code of the given character,
+% then values width/x_units, height/y_units are stored in the
+% fontdimen c-63, fontdimen c-43, respectively).
+% endch; closing command for character.
+% If before endch the variable showmesh is positive, then
+% the character contains the mesh corresponding to the mesh on the
+% paper.
+% If before endch the variable showbox is positive, then
+% the character contains the rounding box.
+% Macros beginch and endch create group, so that changes
+% betweenthem are local.
+% shiftorigin(x,y); says the origin of the choosen coordinate system
+% with respect to the reference point of the character is (x,y)
+% (expressed in the "squares" of the mesh on the paper).
+% Corresponding sharp value in the vertical direction is stored
+% in the italic correction of the character. If value x is nonzero,
+% than the corresponding sharp value is stored in the fontdimen c-23
+% (see beginch above);
+% sharparrow is the path --- simple arrow with the tip
+% in the origin, the length of three units and width of two units,
+% it has direstion of the x-axe
+% axes z; puts the coordinate system into the picture; the
+% intersection of axes is at the point z
+% arrow (len,ang) is the outline of the arrow with the tip
+% in the origin, with given length len and in given direction ang
+% vector(sta,sto); is the vector from the point sta to the point sto
+% cerchovane(sta,sto); plots dashed and dotted line from the point sta
+% to the point sto
+% dashed(sta,sto); plots dashed line from the point sta to the point sto
+% dashedpath pat; plots dashed path pat
+% penfordots; chooses circle pen of the width diameter 10*thinestline
+% (for the value of thinnestline see below);
+% thinpen; chooses circle pen of the width diameter thinestline
+% middlepen; chooses circle pen of the width diameter 2*thinestline
+% thickpen; chooses circle pen of the width diameter 4*thinestline
+% drawdots(poi); draws dots (with choosen pen) from the list poi of
+% points
+% cdrawdot(poi); draws only contour of dot at the point poi
+% cdrawdots(poi); at each point of the list poi draws contour of dot
+%
+% Default values of some variables:
+% showmesh:=0; mesh is not shown
+% showbox:=0; rounding box is not shown
+% mode=ouproof; if no mode is specified (the output is shown on the
+% screen and the values showmesh, showbox are set
+% positive in the definition of beginch)
+% eps_:=0.001; tolerance for iterativ process when the length of the
+% dashes is computed (in dashedpath)
+% len_given:=2; experimental value determining the length of the dashes
+% (in dashedpath)
+% s__r:=10; experimental value determining the length of the dashes
+% (in dashed and cerchovane)
+% font_size 100mm#; no value in the picture will be greater than 1.6m
+% thinestline:=0.4pt; the thickness of the thinnest pen
+%
+% Czech equivalents for some macros:
+% peronatecky is the same as penfordots
+% peronapuntiky is the same as penfordots
+% tenkepero is the same as thinpen
+% strednipero is the same as middlepen
+% tlustepero is the same as thickpen
+% puntiky is the same as drawdots
+% krouzek is the same as cdrawdot
+% drawcontourdot is the same as cdrawdot
+% krouzky is the same as cdrawdots
+% drawcontourdots is the same as cdrawdots
+% carkovane is the same as dashed
+% carkovanacesta is the same as dashedline
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
diff --git a/macros/generic/infpic/incpic.tex b/macros/generic/infpic/incpic.tex
new file mode 100644
index 0000000000..00dcfa065d
--- /dev/null
+++ b/macros/generic/infpic/incpic.tex
@@ -0,0 +1,438 @@
+% Macro for more comfortable treating pictures (pictures placed
+% on left or right side of page are imbedded into paragraphs, pictures
+% that are centered can be imbedded between lines of paragraph).
+% For more details see the end of this file.
+%
+% Oldrich Ulrych July 30, 1992, Prague
+%
+%
+\edef\catcodeat{\the\catcode`\@ } \catcode`\@=11
+%
+\newbox\p@ctbox % box for the current picture to be placed in
+\newbox\t@mpbox % box for temporary storing
+\newbox\@uxbox % auxiliary box
+\newbox\s@vebox % stack of scanned pictures
+%
+\newtoks\desct@ks \desct@ks={} % stack for of descriptions under pictures
+\newtoks\@ppenddesc % toks for appended local description
+\newtoks\sh@petoks % token for description of picture
+%
+\newif\ifallfr@med \allfr@medfalse % true if all picture are being fr@med
+\newif\if@ddedrows % true if round brackets appeared
+\newif\iffirstp@ss \firstp@ssfalse % flag for paragraph test
+\newif\if@mbeeded % flag to indicate just to copy picture
+\newif\ifpr@cisebox % flag to copy picture in natural width
+\newif\ifvt@p % inserted picture is \vtop
+\newif\ifvb@t % inserted picture is \vbot
+\newif\iff@nished \f@nishedtrue % text is around the picture
+\newif\iffr@med % picture will be framed
+\newif\ifj@stbox \j@stboxfalse % only framed box is shown
+%
+\newcount\helpc@unt % auxiliary counter
+\newcount\p@ctpos % position of the picture (0-l,1-c,2-r)
+%
+\newdimen\r@leth \r@leth=0.4pt % thickness of rules
+\newdimen\x@nit % x-size of user's horizontal units
+\newdimen\y@nit % y-size of user's vertical units
+\newdimen\xsh@ft % x-shift of user's coordinates
+\newdimen\ysh@ft % y-shift of user's coordinates
+\newdimen\@uxdimen % auxiliary dimension
+\newdimen\t@mpdimen % auxiliary dimension
+\newdimen\t@mpdimeni % auxiliary dimension
+\newdimen\b@tweentandp % marginal space between text and picture
+\newdimen\b@ttomedge % bottom edge of the picture on page
+\newdimen\@pperedge % upper edge of the picture on page
+\newdimen\@therside % space on the outer side of picture
+\newdimen\d@scmargin % space around marks inside picture
+\newdimen\p@ctht % height+depth of picture
+\newdimen\l@stdepth
+\newdimen\in@tdimen
+\newdimen\l@nelength
+\newdimen\re@lpictwidth
+%
+\def\justframes{\global\j@stboxtrue} % only framed empty place is shown
+\def\picturemargins#1#2{\b@tweentandp=#1\@therside=#2\relax}
+\def\allframed{\global\allfr@medtrue} % all picturew will be fr@med
+\def\emptyplace#1#2{\pl@cedefs % the empty vbox will be created
+ \setbox\@uxbox=\vbox to#2{\n@llpar% all paragraph values are reset
+ \hsize=#1\vfil \vrule height0pt width\hsize}% vbox to prescribed dimensions
+ \e@tmarks}
+\def\boxplace{\pl@cedefs\afterassignment\re@dvbox\let\n@xt= }
+\def\re@dvbox{\setbox\@uxbox=\vbox\bgroup% all is stored in vbox
+ \n@llpar\aftergroup\e@tmarks}
+\def\fontcharplace#1#2{\pl@cedefs % picture is in font
+ \setbox\@uxbox=\hbox{#1\char#2\/}%
+ \xsh@ft=-\wd\@uxbox % width of character and shift of origin
+ \setbox\@uxbox=\hbox{#1\char#2}%
+ \advance\xsh@ft by \wd\@uxbox % horizontal shift of the origin
+ \helpc@unt=#2
+ \advance\helpc@unt by -63 % fontdimen code-63: size of user's x-unit
+ \x@nit=\fontdimen\helpc@unt#1%
+ \advance\helpc@unt by 20 % fontdimen code-43: size of user's y-unit
+ \y@nit=\fontdimen\helpc@unt#1%
+ \advance\helpc@unt by 20 % fontdimen code-23: y-shift of origin
+ \ifnum\helpc@unt<51
+ \ysh@ft=-\fontdimen\helpc@unt#1%
+ \fi
+ \e@tmarks}
+\def\n@llpar{\parskip0pt \parindent0pt% paragraph values are reset
+ \leftskip=0pt \rightskip=0pt
+ \everypar={}}
+\def\pl@cedefs{\xsh@ft=0pt\ysh@ft=0pt}% by default user's origin is not shifted
+\def\e@tmarks#1{\setbox\@uxbox=\vbox{ % reset the box with picture
+ \n@llpar
+ \hsize=\wd\@uxbox % to preserve its width
+ \noindent\copy\@uxbox % the box itself
+ \kern-\wd\@uxbox % jump to the left margin
+ #1\par}% % mark into the picture
+ \st@redescription}
+\def\t@stprevpict#1{\ifvoid#1\else % if previous picture is not finished
+ \errmessage{Previous picture is not finished yet.}\fi} % then error message
+
+\def\st@redescription#1\par{% % puts picture's description on the stack
+ \global\setbox\s@vebox=\vbox{\box\@uxbox\unvbox\s@vebox}%
+ \desct@ks=\expandafter{\the\desct@ks#1\@ndtoks}}%remembers the description
+%\def\@ndtoks{}
+\def\def@ultdefs{\p@ctpos=1 % picture is centered by default
+ \def\lines@bove{0}% % no full lines above picture by default
+ \@ddedrowsfalse % no extra full lines read by default
+ \@mbeededfalse % paragraph flows around picture by default
+ \pr@ciseboxfalse
+ \vt@pfalse % output box will be vbox
+ \vb@tfalse % output box will be vbox
+ \@ppenddesc={}% % no append to description
+ \ifallfr@med\fr@medtrue\else\fr@medfalse\fi
+ }
+
+\def\descriptionmargins#1{\global\d@scmargin=#1\relax}
+\def\@dddimen#1#2{\t@mpdimen=#1\advance\t@mpdimen by#2#1=\t@mpdimen}
+\def\placemark#1#2 #3 #4 #5 {\unskip % ignore previous spaces
+ \setbox1=\hbox{\kern\d@scmargin#5\kern\d@scmargin}% form the mark
+ \@dddimen{\ht1}\d@scmargin % add some space above mark
+ \@dddimen{\dp1}\d@scmargin % add some space below mark
+ \ifx#1l\dimen3=0pt\else % the correction
+ \ifx#1c\dimen3=-0.5\wd1\else
+ \ifx#1r\dimen3=-\wd1
+ \fi\fi\fi
+ \ifx#2u\dimen4=-\ht1\else % and @dd the correction
+ \ifx#2c\dimen4=-0.5\ht1\advance\dimen4 by 0.5\dp1\else
+ \ifx#2b\dimen4=0pt\else
+ \ifx#2l\dimen4=\dp1
+ \fi\fi\fi\fi
+ \advance\dimen3 by #3% % x position
+ \advance\dimen4 by #4% % y position
+ \advance\dimen4 by-\dp1
+ \advance\dimen3 by \xsh@ft % influence of shifting of the origin
+ \advance\dimen4 by \ysh@ft % influence of shifting of the origin
+ \kern\dimen3\vbox to 0pt{\vss\copy1\kern\dimen4}% put the mark
+ \kern-\wd1 % jump back of the width of mark
+ \kern-\dimen3 % jump back of the x position
+ \ignorespaces} % ignore following spaces
+\def\fontmark #1#2 #3 #4 #5 {\placemark #1#2 #3\x@nit{} #4\y@nit{} {#5} }
+\def\fr@msavetopict{\global\setbox\s@vebox=\vbox{\unvbox\s@vebox
+ \global\setbox\p@ctbox=\lastbox}%
+ \expandafter\firstt@ks\the\desct@ks\st@ptoks}
+\def\firstt@ks#1\@ndtoks#2\st@ptoks{%
+ \global\desct@ks={#2}%
+ \def\t@mpdef{#1}%
+ \@ppenddesc=\expandafter\expandafter\expandafter
+ {\expandafter\t@mpdef\the\@ppenddesc}}
+\def\testf@nished{{\let\s@tparshape=\relax
+ \s@thangindent}}
+\def\inspicture{\t@stprevpict\p@ctbox
+ \def@ultdefs % set default values
+ \fr@msavetopict
+ \iff@nished\else\testf@nished\fi
+ \iff@nished\else
+ \immediate\write16{Previes picture is not finished yet}%
+ \fi
+ \futurelet\N@xt\t@stoptions} % look ahead
+\def\t@stoptions{\let\n@xt\@neletter% scans parameters
+ \ifx\N@xt l\p@ctpos=0\else % picture on left inside par
+ \ifx\N@xt c\p@ctpos=1\else % picture copied centered
+ \ifx\N@xt r\p@ctpos=2\else % picture on right inside par
+ \ifx\N@xt(\let\n@xt\e@tline\else % number of full row above
+ \ifx\N@xt!\@mbeededtrue\else % just copy the picture
+ \ifx\N@xt|\fr@medtrue\else % picture will be framed
+ \ifx\N@xt^\vt@ptrue\vb@tfalse\else % picture as vtop
+ \ifx\N@xt_\vb@ttrue\vt@pfalse\else % picture as vbot
+ \ifx\N@xt\bgroup\let\n@xt\@ddgrouptodesc\else
+ \let\n@xt\@dddescription % all parameters are read
+ \fi\fi\fi\fi\fi\fi\fi\fi\fi\n@xt}
+\def\e@tline(#1){\def\lines@bove{#1}% define number of full rows above picture
+ \@ddedrowstrue
+ \futurelet\N@xt\t@stoptions}
+\def\@neletter#1{\futurelet\N@xt\t@stoptions} % eats one parameter
+\def\@ddgrouptodesc#1{\@ppenddesc={#1}\futurelet\N@xt\t@stoptions}
+\def\fr@medpict{\setbox\p@ctbox=
+ \vbox{\n@llpar\hsize=\wd\p@ctbox
+ \iffr@med\else\r@leth=0pt\fi
+ \ifj@stbox\r@leth=0.4pt\fi
+ \hrule height\r@leth \kern-\r@leth
+ \vrule height\ht\p@ctbox depth\dp\p@ctbox width\r@leth \kern-\r@leth
+ \ifj@stbox\hfill\else\copy\p@ctbox\fi
+ \kern-\r@leth\vrule width\r@leth\par
+ \kern-\r@leth \hrule height\r@leth}}
+\def\@dddescription{\fr@medpict % adds description to the picture
+ \re@lpictwidth=\the\wd\p@ctbox
+ \advance\re@lpictwidth by\@therside
+ \advance\re@lpictwidth by\b@tweentandp
+ \ifhmode\ifinner\pr@ciseboxtrue\fi\fi
+ \createp@ctbox
+ \let\N@xt\tr@toplacepicture
+ \ifhmode % if inside paragraph then use \vadjust
+ \ifinner\let\N@xt\justc@py
+ \else\let\N@xt\vjustc@py
+ \fi
+ \else
+ \ifnum\p@ctpos=1 % if centered then just copy the box
+ \let\N@xt\justc@py
+ \fi
+ \fi
+ \if@mbeeded\let\N@xt\justc@py\fi % if forced to copy, just copy the box
+ \firstp@sstrue
+ \N@xt}
+\def\createp@ctbox{\global\p@ctht=\ht\p@ctbox
+ \advance\p@ctht by\dp\p@ctbox
+ \advance\p@ctht by 6pt
+ \setbox\p@ctbox=\vbox{% % make new vbox
+ \n@llpar % reset par's parameters
+ \t@mpdimen=\@therside % and set the leftskip and rightskip
+ \t@mpdimeni=\hsize % according to the position of picture
+ \advance\t@mpdimeni by -\@therside
+ \advance\t@mpdimeni by -\wd\p@ctbox
+ \ifpr@cisebox
+ \hsize=\wd\p@ctbox
+ \else
+ \ifcase\p@ctpos
+ \leftskip=\t@mpdimen \rightskip=\t@mpdimeni
+ \or \advance\t@mpdimeni by \@therside
+ \leftskip=0.5\t@mpdimeni \rightskip=\leftskip
+ \or \leftskip=\t@mpdimeni \rightskip=\t@mpdimen
+ \fi
+ \fi
+ \hrule height0pt % invisible rule and nobreak penalty
+ \kern6pt % small space above
+ \penalty10000
+ \noindent\copy\p@ctbox\par % put the picture with marks
+ \kern3pt % small space between pict and description
+ \hrule height0pt
+ \hbox{}%
+ \penalty10000
+ \interlinepenalty=10000
+ \the\@ppenddesc\par % follows text of description
+ \penalty10000 % prohibite page break
+ \kern3pt % small space below
+ }%
+ \ifvt@p
+ \setbox\p@ctbox=\vtop{\unvbox\p@ctbox}%
+ \else
+ \ifvb@t\else
+ \@uxdimen=\ht\p@ctbox
+ \advance\@uxdimen by -\p@ctht
+ {\vfuzz=\maxdimen
+ \global\setbox\p@ctbox=\vbox to\p@ctht{\unvbox\p@ctbox}%
+ }%
+ \dp\p@ctbox=\@uxdimen
+ \fi
+ \fi
+ }
+\def\picname#1{\unskip\setbox\@uxbox=\hbox{\bf\ignorespaces#1\unskip\ }%
+ \hangindent\wd\@uxbox\hangafter1\noindent\box\@uxbox\ignorespaces}
+\def\justc@py{\ifinner\box\p@ctbox\else\kern\parskip\unvbox\p@ctbox\fi
+ \global\setbox\p@ctbox=\box\voidb@x}
+\def\vjustc@py{\vadjust{\kern0.5\baselineskip\unvbox\p@ctbox}%
+ \global\setbox\p@ctbox=\box\voidb@x}
+\def\tr@toplacepicture{% % tries to find the good place
+ \ifvmode\l@stdepth=\prevdepth % remember the depth of last box
+ \else \l@stdepth=0pt % otherwise the depth of last box is zero
+ \fi
+ \vrule height.85em width0pt\par% to define exact totalpage
+ \r@memberdims % remembers the significant dimensions
+ \global\t@mpdimen=\pagetotal
+ \t@stheightofpage % tests if the picture fits here
+ \ifdim\b@ttomedge<\pagegoal % if the picture ends on the current page
+ \let\N@xt\f@gurehere % the picture can be placed here
+ \global\everypar{}% % clear up the everypar token
+ \else
+ \let\N@xt\relax % we must wait till the new page
+ \penalty10000
+ \vskip-\baselineskip % but jump back to the reference point
+ \vskip-\parskip % of the last line of the previous par
+ \immediate\write16{Picture will be shifted down.}%
+ \global\everypar{\sw@tchingpass}% % check the begin of every paragraph
+ \fi
+ \penalty10000
+ \N@xt}
+\def\sw@tchingpass{% % on every odd pass t@sts the possibility
+ \iffirstp@ss % to place picture here
+ \let\n@xt\relax
+ \firstp@ssfalse % on every even pass does nothing
+ \else
+ \let\n@xt\tr@toplacepicture
+ \firstp@sstrue
+ \fi \n@xt}
+\def\r@memberdims{\global\in@tdimen=0pt
+ \ifnum\p@ctpos=0
+ \global\in@tdimen=\re@lpictwidth
+ \fi
+ \global\l@nelength=\hsize
+ \global\advance\l@nelength by-\re@lpictwidth
+ }
+\def\t@stheightofpage{%
+ \global\@pperedge=\t@mpdimen
+ \advance\t@mpdimen by-0.7\baselineskip % jump back to the begin of par
+ \advance\t@mpdimen by \lines@bove\baselineskip % and down by full lines
+ \advance\t@mpdimen by \ht\p@ctbox % and down by the height of new box
+ \advance\t@mpdimen by \dp\p@ctbox % and down by the depth of new box
+ \advance\t@mpdimen by-0.3\baselineskip % and down by the depth of last box
+ \global\b@ttomedge=\t@mpdimen % and remember bottom edge
+ }
+\def\f@gurehere{\global\f@nishedfalse
+ \t@mpdimen=\lines@bove\baselineskip % and remember the amount of used
+ \advance\t@mpdimen-0.7\baselineskip % space
+ \kern\t@mpdimen
+ \advance\t@mpdimen by\ht\p@ctbox
+ \advance\t@mpdimen by\dp\p@ctbox
+ {\t@mpdimeni=\baselineskip
+ \offinterlineskip
+ \unvbox\p@ctbox
+ \global\setbox\p@ctbox=\box\voidb@x
+ \penalty10000 \kern-\t@mpdimen % and jump back to the reference
+ \penalty10000 \vskip-\parskip % point of the last line of previous
+ \kern-\t@mpdimeni % paragraph
+% \hbox{\vrule height\l@stdepth width0pt}%
+ }%
+ \penalty10000 % prevent page breaking
+ \global\everypar{\s@thangindent}% % and mark that paragraph is special
+ }
+\def\s@thangindent{%
+ \ifdim\pagetotal>\b@ttomedge\global\everypar{}%
+ \global\f@nishedtrue % if we continue under the picture
+ \else
+ \advance\@pperedge by -1.2\baselineskip
+ \ifdim\@pperedge>\pagetotal\global\everypar{}%
+ \global\f@nishedtrue
+ \else
+ \s@tparshape % if we continue around the picture
+ \fi
+ \advance\@pperedge by 1.2\baselineskip
+ \fi}
+\def\s@tparshape{\t@mpdimen=-\pagetotal% minus upperedge of the picture
+ \advance\t@mpdimen by\b@ttomedge % plus bottomedge of the pictured
+ \divide\t@mpdimen by\baselineskip % divided by baselineskip gives the
+ \helpc@unt=\t@mpdimen % number of shorter lines
+ \advance \helpc@unt by 2 % rounding correction and one line more
+ \sh@petoks=\expandafter{\the\helpc@unt\space}% \sh@petoks is for \parshape
+ \t@mpdimeni=\lines@bove\baselineskip
+ \t@mpdimen=\pagetotal
+ \gdef\lines@bove{0}% % in next paragraphs no lines are full
+ \loop \ifdim\t@mpdimeni>0.999\baselineskip % counts the full lines
+ \advance\t@mpdimen by \baselineskip
+ \advance\t@mpdimeni by-\baselineskip
+ \sh@petoks=\expandafter{\the\sh@petoks 0pt \the\hsize}%
+ \repeat
+ \loop \ifdim\b@ttomedge>\t@mpdimen % counts the shorter lines
+ \advance\t@mpdimen by \baselineskip
+ \sh@petoks=\expandafter{\the\sh@petoks \in@tdimen \l@nelength }%
+ \repeat
+ \sh@petoks=\expandafter
+ {\the\sh@petoks 0pt \the\hsize}% % and next lines are full again
+ \expandafter\parshape\the\sh@petoks
+ }
+
+\descriptionmargins{2pt}
+\picturemargins{15pt}{0pt}
+
+\catcode`\@=\catcodeat \let\catcodeat=\undefined
+
+\endinput
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+% Short syntax of control sequences:
+%
+% \allframed all following pictures will be framed by thin line
+%
+% \picturemargins{<dimen1>}{<dimen2>} sets the space between text
+% of paragraph and picture to the value <dimen1> and space on the
+% other side of picture to the value <dimen2>. Default values are
+% 15pt and 0pt. These values are taken into account only when
+% pictures are placed inside paragraphs.
+%
+% \descriptionmargins{<dimen>} sets the space around marks to the value
+% <dimen> (so the mark seems a little bigger and doesn't stick to the
+% point where placed (if placed by point on its border). Default
+% value is 1pt.
+%
+% \justframes means that all following pictures will be shown only by
+% the outlines.
+%
+% Control sequences that create object and put it onto the stack of pictures
+%
+% \emptyplace{<width><whatever>}{<height>}{<marks>}<description>\par
+%
+% \boxplace{<vbox>}{<marks>}<description>\par
+%
+% \fontcharplace{<font>}{<char>}{<marks>}<description>\par
+% <width> is the width of free place
+% <whatever> material placed into created vbox
+% <height> is the height of free place
+% <vbox> the vbox with picture
+% <font> is the cs of font with picture
+% <char> number of char with picture (65,66,...
+% <marks> are either \placemark's with their parameters
+% or \fontmark's with their parameters (in the case of
+% \fontcharplace)
+% <description> is text that will be placed under the picture
+% as the description of the picture
+%
+% \placemark <ph><pv> <xdim> <ydim> <mark>
+%
+% \fontmark <ph><pv> <xrel> <yrel> <mark>
+% <ph> one of the letter l, c, r indicates that the left
+% margin, center or right margin (after adding value
+% determined by \descriptionmargins) will be placed into
+% the prescribed position.
+% <pv> one of the letter u, c, b, l indicates that the upper
+% edge, center, bottom line or lower edge (after adding value
+% determined by \descriptionmargins) will be placed into
+% the prescribed position.
+% <xdim> or <ydim> are dimensions describing the position of
+% mark with respect to the lower left corner of
+% picture (this corner can be seen when you use
+% \allframed at the begin of your file)
+% <xrel> or <yrel> are relative dimensions describing the
+% position of mark with respect to the origin of user's
+% coordinate system (as specified in METAFONT macro
+% INCPIC.MF). It works only in \fontcharplace and for
+% pictures that are created by METAFONT using macro INCPIC.MF.
+% <mark> (terminated by space) is the text of mark.
+%
+% \picname{<title>} the <title> is set in bold face font in front of
+% the <description> from the left margin of the picture and the
+% <description> is indented by the width of the title. (This macro
+% could be used in the description of the picture.)
+%
+% Control sequences take the picture from the stack and put it into text.
+%
+% \inspicture lcr(<n>)!|^_{<description>} takes the first picture from
+% the stack and puts it into the text. All parameters are optional
+% and their meaning is:
+% l the picture is placed on the left side of the pages
+% c the picture is centered (this is default)
+% r the picture is placed on the right side of the pages
+% <n> number of full rows (default is 0)
+% above the picture when the picture is placed on the
+% left or right side of page.
+% ! forces to copy the picture here. In this case the
+% options lrc(<n>) are ignored.
+% | picture will be framed by thin line
+% ^ the picture forms \vtop (influnces the aligning with
+% surrounding text.
+% _ the picture forms \vbox with zero depth
+% (influnces the aligning with surrounding text.
+% When \inspicture is used inside a paragraph, it is
+% recomended to put empty group after its last parameter.
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+ \ No newline at end of file
diff --git a/macros/generic/infpic/mf180.bat b/macros/generic/infpic/mf180.bat
new file mode 100644
index 0000000000..8a465a3b84
--- /dev/null
+++ b/macros/generic/infpic/mf180.bat
@@ -0,0 +1,6 @@
+mf &plain \mode=lqlores; mag=1.0; input %1
+gftopk %1.180 c:\tex\pixel180\dpi180\%1.pk
+copy %1.tfm c:\tex\fonttfms\%1.tfm
+mf &plain \mode=lqlores; mag=1.2; input %1
+gftopk %1.216 c:\tex\pixel180\dpi216\%1.pk
+ \ No newline at end of file
diff --git a/macros/generic/infpic/mf300.bat b/macros/generic/infpic/mf300.bat
new file mode 100644
index 0000000000..37cf9fbda6
--- /dev/null
+++ b/macros/generic/infpic/mf300.bat
@@ -0,0 +1,6 @@
+mf &plain \mode=hplaser; mag=1.0; input %1
+gftopk %1.300 c:\tex\pixel300\dpi300\%1.pk
+copy %1.tfm c:\tex\fonttfms\%1.tfm
+rem mf &plain \mode=hplaser; mag=1.2; input %1
+rem gftopk %1.360 c:\tex\pixel300\dpi360\%1.pk
+ \ No newline at end of file
diff --git a/macros/generic/infpic/sipky.mf b/macros/generic/infpic/sipky.mf
new file mode 100644
index 0000000000..cc9fe93fba
--- /dev/null
+++ b/macros/generic/infpic/sipky.mf
@@ -0,0 +1,27 @@
+
+input incpic
+
+beginch("A",30mm#,10mm#,0mm#,3,1);
+strednipero;
+draw(0,0)--(1,1);
+draw(1,0)--(2,1);
+draw(2,0)--(3,1);
+draw(0,1)--(3,1);
+endch;
+
+beginch("B",50mm#,30mm#,0mm#,5,3);
+strednipero;
+draw(0,0)--(1,1);
+draw(1,0)--(2,1);
+draw(2,0)--(3,1);
+draw(0,1)--(4,1);
+draw(4,3)--(5,1.5);
+draw(4,1)--(5,1.5);
+draw(0,2)--(1,3);
+draw(1,2)--(2,3);
+draw(2,2)--(3,3);
+draw(0,3)--(4,3);
+
+endch;
+
+end
diff --git a/macros/generic/infpic/voting1.cs b/macros/generic/infpic/voting1.cs
new file mode 100644
index 0000000000..0c615e7691
--- /dev/null
+++ b/macros/generic/infpic/voting1.cs
@@ -0,0 +1,269 @@
+\input my.tex
+\input incpic
+\font\sipky=sipky
+
+\fontcharplace{\sipky}{`\A}{
+ \fontmark rc 0 1 {\strut a}
+ \fontmark rc 0 0 {\strut b}
+ \fontmark rc 1 0 {\strut c}
+ \fontmark rc 2 0 {\strut d}
+ }
+
+\podtitul 1: Hlasov n¡ a la Condorcet: Postupn‚ vˆt¨inov‚ porovn v n¡
+
+ V˜bˆr z dvojice, kde mus¡ b˜t vybr n jeden ze dvou
+ kandid t–, je univers lnˆ vy©e¨en vˆt¨inovou volbou. Celkov˜
+ pocit n m napov¡d , ‘e jedinˆ takov˜ v˜bˆr je spravedliv˜,
+ a teorie potvrzuje, ‘e nelze postupovat jinak, pokud chceme
+{ \item {(i)} spravedlnost: ‘ dn  p©edem ur‡en  diskriminace voli‡– ani
+ kandid t–, a
+ \item {(ii)} odolnost proti pou‘it¡ strategi¡: ka‘d˜
+ voli‡ m  motiv volit svobodnˆ -- ‘ dn˜ osamˆl˜ voli‡ (bez
+ £‡asti v nˆjak‚ koalici) nem–‘e £spˆ¨nˆ ovliv¤ovat pr–bˆh
+a v˜sledek voleb.}
+ Tato charakteristika je zn ma jako May–v
+ teor‚m (May [1952]).
+
+ Pokud je t©eba vybrat z v¡ce ne‘ dvou kandid t–, je obvykle
+ situace ponˆkud slo‘itˆj¨¡. Vˆt¨inov‚ porovn v n¡ m–‘e
+ poslou‘it k vytvo©en¡ bin rn¡ relace, tzv. vˆt¨inov‚ relace,
+ kter  vyjad©uje kolektivn¡ preference mezi p ry kandid t–.
+ Bohu‘el, v t‚to relaci se mohou objevit cykly, tato
+ skute‡nost je naz˜v na "Condorcet–v paradox". P©edpokl dejme
+ t©i voli‡e $\{1,2,3\} = N$, kte©¡ maj¡ n sleduj¡c¡ preference:
+
+\vskip 1cm
+\centerline {\hbox {
+\vbox{
+\offinterlineskip
+\halign
+{\strut \ # \quad & \vrule \quad # \quad & # \quad & # \ \cr
+ voli‡ & 1 & 2 & 3 \cr
+ \noalign {\hrule}
+ vrchol & a & c & b \cr
+ & b & a & c \cr
+ dno & c & b & a \cr
+ }} }}
+\vskip 1 cm
+
+ Pokud se vytvo©¡ cykly, nemus¡ ve vˆt¨inov‚m porovn v n¡
+ dvojic existovat Condorcet–v v¡tˆz: ka‘d˜ kandid t je pora‘en
+ nejm‚nˆ jedn¡m jin˜m kandid tem ve vˆt¨inov‚m porovn v n¡.
+ Takto m–‘eme nazvat Condorcetov˜m v¡tˆzem kandid ta $a$, kter˜
+ p©i porovn v n¡ s kter˜mkoliv jin˜m kandid tem $x$ z¡sk 
+ nejm‚nˆ stejnˆ hlas– jako jeho protivn¡k.
+
+ €etnost v˜skytu paradoxu je p©ekvapivˆ vysok .
+ P©edpokl dejme, ‘e voli‡i maj¡ uspo© dan‚ preference a ‘e
+ v˜skyt jednotliv˜ch uspo© d n¡ kandid t– je rovnomˆrnˆ
+ a nez visle rozlo‘en, pak pravdˆpodobnost, ‘e ‘ dn˜ kandid t
+ nen¡ Condorcetov˜m v¡tˆzem m–‘e b˜t spo‡tena nebo
+ p©inejmen¨¡m odhadnuta.
+
+ Pokud ‘ dn˜ Condorcet–v v¡tˆz neexistuje, hled  se
+ zpravidla takov˜ kandid t, kter˜ by jej nahradil (a m  pro to
+ rozumn‚ d–vody). Jako p©¡kld lze uv‚st zn m˜ postup u‘¡van˜
+ v Kongresu USA p©i hlasov n¡ mezi n vrhem z kona a jeho
+ p©¡davky (zn m˜ jako tzv. n vrhov  {\sl (amendment)} procedura, viz
+ Riker [1982], str. 70, pro podrobnosti).
+
+ Hlasov n¡ postupn˜m vylu‡ov n¡m {\sl (succesive elimination)}:
+
+\vskip 1cm
+\inspicture
+\vskip 1cm
+
+ Neprve se vˆt¨inou rozhodne mezi $a$ a $b$, potom se v¡tˆz
+ porovn v  s $c$, atd. V p©¡padˆ nerozhodnutelnosti hlasov n¡
+ (rem¡za) kandid t zdola prohr v .
+
+ V n vrhov‚ procedu©e $a$ znamen  p©¡davek k pozmˆ¤ovac¡mu
+ n vrhu, $b$ p©¡davek k p©¡davku, $c$ je pozmˆ¤ovac¡ n vrh
+ a $d$ platn˜ z kon. Samoz©ejmˆ po©ad¡ v˜bˆru m  sv–j v˜znam:
+ kandid ti nejsou pova‘ov ni za rovnocenn‚ (©¡k me, ‘e
+ hlasovac¡ pravidlo nen¡ neutr ln¡).
+
+\vfill\eject
+
+\def\*{$^*$}
+\def\mez{\hskip 2ex$\vdots$}
+\centerline{ \hbox {
+\vbox{\offinterlineskip
+\halign
+{ \quad # \ & \vrule height 2em depth 1em \qquad # \quad & # \quad
+ & # \quad & # \quad & # & \ # \ & # \quad \cr
+\hskip4em \rlap {\raise 1ex \hbox {po‡et}} \leavevmode \lower 1ex
+ \hbox {voli‡–} & \ 3 & \ 5 & \ 7 & \ 9 & \ 11 && limit \cr
+\noalign {\vskip -1.5em}
+\rlap {\raise 1ex \hbox {po‡et}} \leavevmode \lower 1ex
+ \hbox {kandid t–} &\cr
+\noalign {\hrule}
+\hskip3em 3 & .056 & .069 & .075 & .078 & .080 &.....& .088 \cr
+\hskip3em 4 & .111 & .139 & .150 & .156 & .160 &.....& .176 \cr
+\hskip3em 5 & .160 & .200 & .215 & .230 & .251 &.....& .251 \cr
+\hskip3em 6 & .202 & .255\* & .258\* & .284\* & .294\* &.....& .315 \cr
+\hskip3em 7 & .239\* & .299\* & .305\* & .342\* & .343\* &.....& .369 \cr
+\noalign {\vskip -1em}
+ &\mez &\mez &\mez &\mez &\mez &&\mez \cr
+\noalign {\vskip -1em}
+\hskip2.5em limit & \ 1 & \ 1 & \ 1 & \ 1 & \ 1 &.....& \ 1 \cr
+}}}}
+\vskip .5cm
+\centerline {—daje zna‡en‚ \* jsou odhadnut‚}
+\vskip 3mm
+\centerline { Tabulka 1: Pravdˆpodobnost neexistence Condorcetova v¡tˆze}
+\centerline { Zdroj: Fishburn [1973], str. 95.}
+
+ Tato metoda v‘dy spl¤uje Condorcet–v axiom: jestli‘e a je
+ Condorcet–v v¡tˆz, vyhraje (nehledˆ na pravdˆpodobnost
+ rem¡z). Ve skute‡nosti je to d–sledek vˆt¨inov‚ho porovn v n¡
+ v daleko ¨ir¨¡m smyslu:
+
+
+ Smithova podm¡nka: jestli‘e se mno‘ina A kandid t– rozdˆl¡
+ na dvˆ disjuktn¡ podmno‘iny $B_1,\, B_2$ a ka‘d˜ kandid t $b_1$ z $B_1$
+ poraz¡ (bez rem¡z) ka‘d‚ho $b_2$ z $B_2$, potom v¡tˆz mus¡ b˜t
+ z mno‘iny $B_1$.
+
+ V¨echny hlasovac¡ metody odvozen‚ z bin rn¡ho stromu
+ (v¨echny p©edv dˆn‚ v t‚to ‡ sti jsou tohoto typu) vyhovuj¡
+ Smithovˆ podm¡nce. Bohu‘el nˆkter‚ z nich poru¨uj¡
+ d–le‘itˆj¨¡ p‘adavky kolektivn¡ho v˜bˆru, p©edev¨¡m
+ jednomyslnost neboli Paretovo krit‚rium:
+
+
+ Paretovo krit‚rium: jestli‘e ka‘d˜ voli‡ d v  p©ednost
+ kandid tu $a$ p©ed $b$, kandid t $b$ nem–‘e b˜t vybr n.
+
+ Hlasov n¡ postupn˜m vylu‡ov n¡m m–‘e vybrat Paretova
+ hor¨¡ho kandid ta.
+
+ P©edpokl dejme preference voli‡– n sledovnˆ
+
+\vskip 1cm
+\centerline {\hbox {
+\vbox{
+\offinterlineskip
+\halign
+{\strut \ # \quad & \vrule \quad # \quad & # \quad & # \ \cr
+ voli‡ & 1 & 2 & 3 \cr
+ \noalign {\hrule}
+ vrchol & b & a & c \cr
+ & a & d & b \cr
+ & d & c & a \cr
+ dno & c & b & d \cr
+ }} }}
+\vskip 1 cm
+
+ potom postupn˜ v˜bˆr v po©ad¡ $abcd$ postupuje
+
+\vskip 1cm
+\fontcharplace{\sipky}{`\A}{
+ \fontmark cc 0 1 {\strut a}
+ \fontmark rc 0 0 {\strut b}
+ \fontmark rc 1 0 {\strut c}
+ \fontmark rc 2 0 {\strut d}
+ \fontmark cd 1 1 {\strut b}
+ \fontmark cd 2 1 {\strut c}
+ \fontmark lc 3 1 {\strut d}
+ }
+\inspicture
+\vskip 1cm
+
+ A‡koliv $a$ je Paret–v lep¨¡ kandid t {\sl (Pareto superior)}, ‡ili
+ je jednomyslnˆ preferov n oproti $d$.
+
+ V hlasov n¡ postupn˜m v˜bˆrem m  kandid t, kter˜ vstupuje
+ posledn¡ (jmenovitˆ $d$), o‡ividnou v˜hodu: m–‘e vyhr t
+ pora‘en¡m jenom jednoho (dob©e vybran‚ho) oponenta (toto
+ znamen , ‘e nez le‘¡ na preferenc¡m v–‡i ostatn¡m
+ kandid t–m).
+
+ K zachov n¡ spravedlnosti je mo‘n‚ sestavit dvˆ symetrick‚
+ hlasov n¡ postupn˜m v˜bˆrem n sledovnˆ:
+
+\bye
+
+ a____________________________________
+ / / / \
+ / / / \
+ b/ c/ d/ \
+ /
+ /
+ d____________________________________/
+ / / /
+ / / /
+ c/ b/ a/
+
+ Tabulka 2: Paraleln¡ v˜bˆrov  metoda
+
+ Nyn¡ bˆ‘¡ dvˆ paraleln¡ v˜bˆrov‚ procedury. Dva finalist‚
+ kone‡nˆ soutˆ‘¡ o v¡tˆzstv¡.
+
+ Je dobr‚ cvi‡en¡ ovˆ©it si, ‘e p©i tomto postupu v¡tˆz
+ nem–‘e b˜t Paret–v hor¨¡ kandid t {\sl (Pareto inferior)}. Pro
+ jednoduchost p©edpokl dejme, ‘e v¨echny dvojice je vˆt¨inov‚
+ porovn v n¡ jednozna‡n‚ (pro ka‘dou dvojici $x,\, y$ existuje
+ jednozna‡n  vˆt¨ina preferuj¡c¡ $x$ p©ed $y$ nebo naopak $y$ p©ed
+ $x$). Jestli‘e je zde Condorcet–v v¡tˆz, mus¡ z©ejmˆ vyhr t.
+ Pokud toto neplat¡, zv¡tˆz¡ Copeland–v v¡tˆz, kandid t, kter˜
+ vyhraje pr vˆ dvakr t (a prohraje jednou) v soutˆ‘¡ch dvojic.
+ Mohou se zde vyskytnout nejv˜¨e dva Copelandovi v¡tˆzov‚.
+ Ovˆ©te si, ‘e ‘ dn˜ z nich nem–‘e b˜t Paret–v hor¨¡ kandid t.
+ Pak si v¨imnˆte, ‘e pokud v¡tˆz paraleln¡ho v˜bˆru --- ©eknˆme
+ $x$ --- nen¡ Copeland–v v¡tˆz, pak mus¡ porazit alespo¤ jednoho
+ Copelandova v¡tˆze a to zaru‡uje, ‘e $x$ nen¡ Paret–v hor¨¡
+ kandid t.
+
+ Ale bˆda, paraleln¡ v˜bˆr m  jinou perverzn¡ vlastnost,
+ kter  jej znev˜hod¤uje oproti n sleduj¡c¡m metod m:
+
+ Algoritmus slo‘it‚ho jedn n¡
+{\sl (The Sophisticated Agenda Algorithm)}
+
+ Mˆjme kandid ty $a_1,...,a_n$. Definujme indukc¡
+\def\a {\alpha}
+\hskip 1 cm $\a _{i+1}=a_{i+1}$ pokud $a_{i+1}$ poraz¡
+ $\a _1,\a _2,...,\a _i$
+
+ $\a _1=a_1,
+
+ \hskip 1cm $ a_ {i+1}=\a _i$ pokud nejm‚nˆ jeden $\a _j$, $1<j<i$,
+ rem¡zuje s $a_{i+1}$, nebo jej poraz¡.
+
+ V˜sledek algoritmu je kandid t $\a _n$.
+
+ Nyn¡ m me zaru‡eno:
+\item {a.} algoritmus slo‘it‚ho jedn n¡ vybere stejn‚ho kandid ta,
+ jako v¡cestup¤ov  v˜bˆrov  procedura;
+\item {b.} tento kandid t poraz¡, aŸ p©¡mo ‡i nep©¡mo, ka‘d‚ho
+ jin‚ho kandid ta;
+\item {c.} proto nem–‘e b˜t ani Paret–v hor¨¡ kandid t; a
+\item {d.} tato v˜bˆrov  metoda je monotonn¡.
+
+ Toto jsou v˜sledky z kladn¡ho v˜znamu, a‡koli se v literatu©e
+ o hlasov n¡ objevily teprve ned vno (Miller [1980]; Shepsle
+ a Weingast [1982]; Moulin [1983], ‡ st 5; Banks [1984]).
+
+ Copelandovo hlasovac¡ pravidlo je jin‚ pravidlo zalo‘en‚
+ na vˆt¨inov‚m porovn v n¡ dvojic, kter‚ vyhovuje uveden˜m
+ podm¡nk m b,c,d.
+
+ Copelandovo pravidlo: Copeland [1951].
+
+ Porovnejme ka‘d‚ho kandid ta s ka‘d˜m jin˜m kandid tem
+ a vyberme toho kandid ta, kter˜ vyhr l nej‡astˆji; p©i
+ stejn‚m po‡tu v¡tˆzstv¡ u v¡ce kandid t– vyberme jednoho
+ podle p©edem ur‡en‚ho libovoln‚ho po© dku.
+
+ Navzdory sv‚ jednoduchosti, tato metoda vy‘aduje v¡ce
+ porovn v n¡ dvojic, ne‘ algoritmus slo‘it‚ho jedn n¡: pokud
+ m me $p$ kandid t–, v¨ech $p(p-1)/2$ souboj– mus¡ b˜t rozhodnuto;
+ oproti algoritmu slo‘it‚ho jedn n¡, kde je pot©eba nejv˜¨e
+$p(p-1)/2$ takov˜ch porovn n¡. Pokud m me 13~kandid t– nebo
+ v¡ce, je mo‘n‚ nal‚zt takov˜ soubor preferenc¡, kde dvˆ
+ metody (Copelandova a slo‘it‚ho jedn n¡) vyberou radik lnˆ
+ odli¨n‚ v¡tˆze (Moulin [1984]). Tak‚ lze dok zat, ‘e
+ Copelandovo pravidlo se ned  odvodit z bin rn¡ho stromu,
+ jakkoliv rozs hl‚ho (Moulin [1984]).
+ \ No newline at end of file