I usually only use \parshape
primitive but not shapepar
package and I always write a metafont program for this. Here is one of my metafont programs:
mode_setup;
def showmsg (expr s, m) = message s & "--> " & decimal m; enddef;
mn#:=10/10mm#;
em#:=18mn#;
u#:=1/18em#;
zekh#=1.5u#;
baseline#=1.75dd#;
define_pixels(mn,u,em,zekh,baseline);
%********
beginchar(12,33.3mn#,22.3mn#,0);
path p[];
pickup pencircle scaled .05u;
numeric mntopt, pttodd,ddtopt;
mntopt=25.4/72.27;
pttodd=1238/1157;
ddtopt=1157/1238;
let tttt=end;
x1=0;
y1=.5[y4,y2];
x2=.5[x1,x3];
x3-x1=y2-y4=22.3mn;
y3=y1;
y4=0;
x4=x2;
p1=z1{up}..{right}z2{right}..{down}z3{down}..{left}z4{left}
..{up}z1;
draw p1;
x3-x7=2.8mn;
x6=x8;
x6-x5=12.4mn;
x8-x7=13.8mn;
y6=y5;
y7=y8;
y7-y5=12mn;
y2-y7=3.8mn;
p2=z5--z6;
p3=z7--z8;
draw p2;
draw p3;
z5n=p2 intersectionpoint p1;
z7n=p3 intersectionpoint p1;
showmsg ("last line down", (x6-x5n)/1mm);
showmsg ("1th line up ", (x8-x7n)/1mm);
% showmsg ("fasel y8-y6", (y7-y5)/1mm);
%****************"2th line up";
x9=x7; x10=x8;
y9=y10=y8-baseline;
p4=z9--z10;
draw p4;
z9n=p4 intersectionpoint p1;
showmsg ("2th line up", (x10-x9n)/1mm);
% showmsg ("dd", (y8-y10)/1dd);
% showmsg ("fasel y10-y6", (y10-y6)/1mm);
%******************************"3th line up";
x11=x7; x12=x8;
y11=y12=y10-baseline;
p5=z11--z12;
draw p5;
z11n=p5 intersectionpoint p1;
showmsg ("3th line up", (x12-x11n)/1mm);
% showmsg ("dd", (y10-y12)/1dd);
% showmsg ("fasel y12-y6", (y12-y6)/1mm);
%**********************"4th line up";
x13=x7; x14=x8;
y13=y14=y12-baseline;
p6=z13--z14;
draw p6;
z13n=p6 intersectionpoint p1;
showmsg ("4th line up", (x14-x13n)/1mm);
% showmsg ("dd", (y12-y14)/1dd);
% showmsg ("fasel y14-y6", (y14-y6)/1mm);
% showmsg (" y14", y14/1mm);
% showmsg (" y3", y3/1mm);
%**********************"5th line up";
x15=x7; x16=x8;
y15=y16=y14-baseline;
p7=z15--z16;
draw p7;
z15n=p7 intersectionpoint p1;
showmsg ("5th line up", (x16-x15n)/1mm);
% showmsg ("dd", (y14-y16)/1dd);
% showmsg ("fasel y16-y6", (y16-y6)/1mm);
% showmsg (" y16", y16/1mm);
% showmsg (" y3", y3/1mm);
%**********************"6th line up";
x17=x7; x18=x8;
y17=y18=y16-baseline;
p8=z17--z18;
draw p8;
z17n=p8 intersectionpoint p1;
showmsg ("6th line up", (x18-x17n)/1mm);
% showmsg ("dd", (y16-y18)/1dd);
% showmsg ("fasel y18-y6", (y18-y6)/1mm);
% showmsg (" y18", y18/1mm);
% showmsg (" y3", y3/1mm);
%**********************"7th line up";
x19=x7; x20=x8;
y19=y20=y18-baseline;
p9=z19--z20;
draw p9;
z19n=p9 intersectionpoint p1;
showmsg ("7th line up", (x20-x19n)/1mm);
% showmsg ("dd", (y18-y20)/1dd);
% showmsg ("fasel y20-y6", (y20-y6)/1mm);
% showmsg (" y20", y20/1mm);
% showmsg (" y3", y3/1mm);
%**********************"8th line up";
x21=x7; x22=x8;
y21=y22=y20-baseline;
p10=z21--z22;
draw p10;
z21n=p10 intersectionpoint p1;
showmsg ("8th line up", (x22-x21n)/1mm);
% showmsg ("dd", (y20-y22)/1dd);
% showmsg ("fasel y22-y6", (y22-y6)/1mm);
% showmsg (" y22", y22/1mm);
% showmsg (" y3", y3/1mm);
%**********************"9th line up";
x23=x7; x24=x8;
y23=y24=y22-baseline;
p11=z23--z24;
draw p11;
z23n=p11 intersectionpoint p1;
showmsg ("9th line up", (x24-x23n)/1mm);
% showmsg ("dd", (y22-y24)/1dd);
% showmsg ("fasel y24-y6", (y24-y6)/1mm);
% showmsg (" y24", y24/1mm);
% showmsg (" y3", y3/1mm);
%**********************"10th line up";
x25=x7; x26=x8;
y25=y26=y24-baseline;
p12=z25--z26;
draw p12;
z25n=p12 intersectionpoint p1;
showmsg ("10th line up", (x26-x25n)/1mm);
% showmsg ("dd", (y24-y26)/1dd);
% showmsg ("fasel y26-y6", (y26-y6)/1mm);
% showmsg (" y26", y26/1mm);
% showmsg (" y3", y3/1mm);
%**********************"11th line up";
x27=x7; x28=x8;
y27=y28=y26-baseline;
p13=z27--z28;
draw p13;
z27n=p13 intersectionpoint p1;
showmsg ("11th line up", (x28-x27n)/1mm);
% showmsg ("dd", (y26-y28)/1dd);
% showmsg ("fasel y28-y6", (y28-y6)/1mm);
% showmsg (" y28", y28/1mm);
% showmsg (" y3", y3/1mm);
%**********************"12th line up";
x29=x7; x30=x8;
y29=y30=y28-baseline;
p14=z29--z30;
draw p14;
z29n=p14 intersectionpoint p1;
showmsg ("12th line up", (x30-x29n)/1mm);
% showmsg ("dd", (y28-y30)/1dd);
% showmsg ("fasel y30-y6", (y30-y6)/1mm);
% showmsg (" y30", y30/1mm);
% showmsg (" y3", y3/1mm);
%**********************"13th line up";
x31=x7; x32=x8;
y31=y32=y30-baseline;
p15=z31--z32;
draw p15;
z31n=p15 intersectionpoint p1;
showmsg ("13th line up", (x32-x31n)/1mm);
% showmsg ("dd", (y30-y32)/1dd);
% showmsg ("fasel y32-y6", (y32-y6)/1mm);
if y32-y6 >= baseline :
let next=relax;
else:
def next=endgroup; tttt; enddef;
fi;
next;
% showmsg (" y32", y32/1mm);
% showmsg (" y6", y6/1mm);
%**********************"14th line up";
x33=x7; x34=x8;
y33=y34=y32-baseline;
p16=z33--z34;
draw p16;
z33n=p16 intersectionpoint p1;
showmsg ("14th line up", (x34-x33n)/1mm);
% showmsg ("dd", (y32-y34)/1dd);
% showmsg ("fasel y34-y6", (y34-y6)/1mm);
if y34-y6 >= baseline :
let next=relax;
else:
def next=endgroup; tttt; enddef;
fi;
next;
% showmsg (" y34", y34/1mm);
% showmsg (" y6", y6/1mm);
%**********************"15th line up";
x35=x7; x36=x8;
y35=y36=y34-baseline;
p17=z35--z36;
draw p17;
z35n=p17 intersectionpoint p1;
showmsg ("15th line up", (x36-x35n)/1mm);
% showmsg ("dd", (y34-y36)/1dd);
% showmsg ("fasel y36-y6", (y36-y6)/1mm);
if y36-y6 >= baseline :
let next=relax;
else:
def next=endgroup; tttt; enddef;
fi;
next;
% showmsg (" y36", y36/1mm);
% showmsg (" y6", y6/1mm);
%**********************"16th line up";
x37=x7; x38=x8;
y37=y38=y36-baseline;
p18=z37--z38;
draw p18;
z37n=p18 intersectionpoint p1;
showmsg ("16th line up", (x38-x37n)/1mm);
% showmsg ("dd", (y36-y38)/1dd);
% showmsg ("fasel y38-y6", (y38-y6)/1mm);
if y38-y6 >= baseline :
let next=relax;
else:
def next=endgroup; tttt; enddef;
fi;
next;
% showmsg (" y38", y38/1mm);
% showmsg (" y6", y6/1mm);
%**********************"17th line up";
x39=x7; x40=x8;
y39=y40=y38-baseline;
p19=z39--z40;
draw p19;
z39n=p19 intersectionpoint p1;
showmsg ("17th line up", (x40-x39n)/1mm);
% showmsg ("dd", (y38-y40)/1dd);
% showmsg ("fasel y40-y6", (y40-y6)/1mm);
message " y40"; if y40-y6 >= baseline :
let next=relax;
else:
def next=endgroup; tttt; enddef;
fi;
next;
show y40/1mm;
% showmsg (" y6", y6/1mm);
%**********************"18th line up";
x41=x7; x42=x8;
y41=y42=y40-baseline;
p20=z41--z42;
draw p20;
z41n=p20 intersectionpoint p1;
showmsg ("18th line up", (x42-x41n)/1mm);
% showmsg ("dd", (y40-y42)/1dd);
% showmsg ("fasel y42-y6", (y42-y6)/1mm);
if y42-y6 >= baseline :
let next=relax;
else:
def next=endgroup; tttt; enddef;
fi;
next;
% showmsg (" y42", y42/1mm);
% showmsg (" y6", y6/1mm);
%**********************"19th line up";
x43=x7; x44=x8;
y43=y44=y42-baseline;
p21=z43--z44;
draw p21;
z43n=p21 intersectionpoint p1;
showmsg ("19th line up", (x44-x43n)/1mm);
% showmsg ("dd", (y42-y44)/1dd);
% showmsg ("fasel y44-y6", (y44-y6)/1mm);
if y44-y6 >= baseline :
let next=relax;
else:
def next=endgroup; tttt; enddef;
fi;
next;
% showmsg (" y44", y44/1mm);
% showmsg (" y6", y6/1mm);
%**********************"20th line up";
x45=x7; x46=x8;
y45=y46=y44-baseline;
p22=z45--z46;
draw p22;
z45n=p22 intersectionpoint p1;
showmsg ("20th line up", (x46-x45n)/1mm);
% showmsg ("dd", (y44-y46)/1dd);
% showmsg ("fasel y46-y6", (y46-y6)/1mm);
if y46-y6 >= baseline :
let next=relax;
else:
def next=endgroup; tttt; enddef;
fi;
next;
% showmsg (" y46", y46/1mm);
% showmsg (" y6", y6/1mm);
%**********************"21th line up";
x47=x7; x48=x8;
y47=y48=y46-baseline;
p23=z47--z48;
draw p23;
z47n=p23 intersectionpoint p1;
showmsg ("21th line up", (x48-x47n)/1mm);
% showmsg ("dd", (y46-y48)/1dd);
% showmsg ("fasel y48-y6", (y48-y6)/1mm);
if y48-y6 >= baseline :
let next=relax;
else:
def next=endgroup; tttt; enddef;
fi;
next;
% showmsg (" y48", y48/1mm);
% showmsg (" y6", y6/1mm);
%**********************"22th line up";
x49=x7; x50=x8;
y49=y50=y48-baseline;
p24=z49--z50;
draw p24;
z49n=p24 intersectionpoint p1;
showmsg ("22th line up", (x50-x49n)/1mm);
% showmsg ("dd", (y48-y50)/1dd);
% showmsg ("fasel y50-y6", (y50-y6)/1mm);
if y50-y6 >= baseline :
let next=relax;
else:
def next=endgroup; tttt; enddef;
fi;
next;
% showmsg (" y50", y50/1mm);
% showmsg (" y6", y6/1mm);
%**********************"23th line up";
x51=x7; x52=x8;
y51=y52=y50-baseline;
p25=z51--z52;
draw p25;
z51n=p25 intersectionpoint p1;
showmsg ("23th line up", (x52-x51n)/1mm);
% showmsg ("dd", (y50-y52)/1dd);
% showmsg ("fasel y52-y6", (y52-y6)/1mm);
if y52-y6 >= baseline :
let next=relax;
else:
def next=endgroup; tttt; enddef;
fi;
next;
% showmsg (" y52", y52/1mm);
% showmsg (" y6", y6/1mm);
%**********************"24th line up";
x53=x7; x54=x8;
y53=y54=y52-baseline;
p26=z53--z54;
draw p26;
z53n=p26 intersectionpoint p1;
showmsg ("24th line up", (x54-x53n)/1mm);
% showmsg ("dd", (y52-y54)/1dd);
% showmsg ("fasel y54-y6", (y54-y6)/1mm);
if y54-y6 >= baseline :
let next=relax;
else:
def next=endgroup; tttt; enddef;
fi;
next;
% showmsg (" y54", y54/1mm);
% showmsg (" y6", y6/1mm);
%**********************"25th line up";
x55=x7; x56=x8;
y55=y56=y54-baseline;
p27=z55--z56;
draw p27;
z55n=p27 intersectionpoint p1;
showmsg ("25th line up", (x56-x55n)/1mm);
% showmsg ("dd", (y54-y56)/1dd);
% showmsg ("fasel y56-y6", (y56-y6)/1mm);
if y56-y6 >= baseline :
let next=relax;
else:
def next=endgroup; tttt; enddef;
fi;
next;
% showmsg (" y56", y56/1mm);
% showmsg (" y6", y6/1mm);
%**********************"26th line up";
x57=x7; x58=x8;
y57=y58=y56-baseline;
p28=z57--z58;
draw p28;
z57n=p28 intersectionpoint p1;
showmsg ("26th line up", (x58-x57n)/1mm);
% showmsg ("dd", (y56-y58)/1dd);
% showmsg ("fasel y58-y6", (y58-y6)/1mm);
if y58-y6 >= baseline :
let next=relax;
else:
def next=endgroup; tttt; enddef;
fi;
next;
% showmsg (" y58", y58/1mm);
% showmsg (" y6", y6/1mm);
%**********************"27th line up";
x59=x7; x60=x8;
y59=y60=y58-baseline;
p29=z59--z60;
draw p29;
z59n=p29 intersectionpoint p1;
showmsg ("27th line up", (x60-x59n)/1mm);
% showmsg ("dd", (y58-y60)/1dd);
% showmsg ("fasel y60-y6", (y60-y6)/1mm);
if y60-y6 >= baseline :
let next=relax;
else:
def next=endgroup; tttt; enddef;
fi;
next;
% showmsg (" y60", y60/1mm);
% showmsg (" y6", y6/1mm);
%**********************"28th line up";
x61=x7; x62=x8;
y61=y62=y60-baseline;
p30=z61--z62;
draw p30;
z61n=p30 intersectionpoint p1;
showmsg ("28th line up", (x62-x61n)/1mm);
% showmsg ("dd", (y60-y62)/1dd);
% showmsg ("fasel y62-y6", (y62-y6)/1mm);
if y62-y6 >= baseline :
let next=relax;
else:
def next=endgroup; tttt; enddef;
fi;
next;
% showmsg (" y62", y62/1mm);
% showmsg (" y6", y6/1mm);
%**********************"29th line up";
x63=x7; x64=x8;
y63=y64=y62-baseline;
p31=z63--z64;
draw p31;
z63n=p31 intersectionpoint p1;
showmsg ("29th line up", (x64-x63n)/1mm);
% showmsg ("dd", (y62-y64)/1dd);
% showmsg ("fasel y64-y6", (y64-y6)/1mm);
if y64-y6 >= baseline :
let next=relax;
else:
def next=endgroup; tttt; enddef;
fi;
next;
% showmsg (" y64", y64/1mm);
% showmsg (" y6", y6/1mm);
%**********************"30th line up";
x65=x7; x66=x8;
y65=y66=y64-baseline;
p32=z65--z66;
draw p32;
z65n=p32 intersectionpoint p1;
showmsg ("30th line up", (x66-x65n)/1mm);
% showmsg ("dd", (y64-y66)/1dd);
% showmsg ("fasel y66-y6", (y66-y6)/1mm);
if y66-y6 >= baseline :
let next=relax;
else:
def next=endgroup; tttt; enddef;
fi;
next;
% showmsg (" y66", y66/1mm);
% showmsg (" y6", y6/1mm);
%**********************"31th line up";
x67=x7; x68=x8;
y67=y68=y66-baseline;
p33=z67--z68;
draw p33;
z67n=p33 intersectionpoint p1;
showmsg ("31th line up", (x68-x67n)/1mm);
% showmsg ("dd", (y66-y68)/1dd);
% showmsg ("fasel y68-y6", (y68-y6)/1mm);
if y68-y6 >= baseline :
let next=relax;
else:
def next=endgroup; tttt; enddef;
fi;
next;
% showmsg (" y68", y68/1mm);
% showmsg (" y6", y6/1mm);
%**********************"32th line up";
x69=x7; x70=x8;
y69=y70=y68-baseline;
p34=z69--z70;
draw p34;
z69n=p34 intersectionpoint p1;
showmsg ("32th line up", (x70-x69n)/1mm);
% showmsg ("dd", (y68-y70)/1dd);
% showmsg ("fasel y70-y6", (y70-y6)/1mm);
if y70-y6 >= baseline :
let next=relax;
else:
def next=endgroup; tttt; enddef;
fi;
next;
% showmsg (" y70", y70/1mm);
% showmsg (" y6", y6/1mm);
%**********************"33th line up";
x71=x7; x72=x8;
y71=y72=y70-baseline;
p35=z71--z72;
draw p35;
z71n=p35 intersectionpoint p1;
showmsg ("33th line up", (x72-x71n)/1mm);
% showmsg ("dd", (y70-y72)/1dd);
% showmsg ("fasel y72-y6", (y72-y6)/1mm);
if y72-y6 >= baseline :
let next=relax;
else:
def next=endgroup; tttt; enddef;
fi;
next;
% showmsg (" y72", y72/1mm);
% showmsg (" y6", y6/1mm);
%**********************"34th line up";
x73=x7; x74=x8;
y73=y74=y72-baseline;
p36=z73--z74;
draw p36;
z73n=p36 intersectionpoint p1;
showmsg ("34th line up", (x74-x73n)/1mm);
% showmsg ("dd", (y72-y74)/1dd);
% showmsg ("fasel y74-y6", (y74-y6)/1mm);
if y74-y6 >= baseline :
let next=relax;
else:
def next=endgroup; tttt; enddef;
fi;
next;
% showmsg (" y74", y74/1mm);
% showmsg (" y6", y6/1mm);
%**********************"35th line up";
x75=x7; x76=x8;
y75=y76=y74-baseline;
p37=z75--z76;
draw p37;
z75n=p37 intersectionpoint p1;
showmsg ("35th line up", (x76-x75n)/1mm);
% showmsg ("dd", (y74-y76)/1dd);
% showmsg ("fasel y76-y6", (y76-y6)/1mm);
if y76-y6 >= baseline :
let next=relax;
else:
def next=endgroup; tttt; enddef;
fi;
next;
% showmsg (" y76", y76/1mm);
% showmsg (" y6", y6/1mm);
%**********************
endchar;
bye;
and if you run metafont
on this, you get:
last line down--> 12.01291
1th line up --> 13.76529
2th line up--> 13.23064
3th line up--> 12.77202
4th line up--> 12.37909
5th line up--> 12.04422
6th line up--> 11.76205
7th line up--> 11.52835
8th line up--> 11.33994
9th line up--> 11.19461
10th line up--> 11.09041
11th line up--> 11.02611
12th line up--> 11.00049
13th line up--> 11.01324
14th line up--> 11.06444
15th line up--> 11.15503
16th line up--> 11.28639
17th line up--> 11.45995
y40
>> 7.9702
18th line up--> 11.6781
19th line up--> 11.9436 )
\parshape
primitive takes for each line of a paragraph an indent and a length. This way only the outer shape can be modeled but not the hole. Would it be possible to use two paragraphs side by side such that the hole would be formed by the right edge of the left paragraph and the left side of the rift paragraph?