在他的书中印刷风格的要素中,Bringhurst 提出了一种六边形图案,用于几何构建页面布局的元素。
问题:可以使用以下方法简单地提取几何尺寸吗蒂克兹,tkz-euclide,Metafont/post或者类似的 LaTeX 软件包? (几何优雅在这里是关键,而不仅仅是强力解决方案,证明 TeX 是图灵完备的,因此可以解决隐含问题。)
我原本以为这将是一个很好的例子,可以通过几何方法来实现,例如,tkz-euclide,但无法得出明确的构造。当然,人们可以通过构造得到一组具有唯一解的隐式方程,我已使用该方程来计算以下代码中的参数,但人们能否使用这些包中的几何方法优雅地解决问题?
\documentclass{standalone}
\usepackage{tikz}
\usepackage{tkz-euclide}
\usetikzlibrary{decorations.pathmorphing}
\begin{document}
\begin{tikzpicture}[scale=5.2in/1cm/2]
\path (0,0) coordinate[label=below:{ll}] (ll)
-- (1,0) coordinate[label=below:{lr}] (lr)
-- ++(60:1) coordinate[label=right:{r}] (r)
-- ++(120:1) coordinate[label=above:{ur}] (ur)
-- ++(180:1) coordinate[label=above:{ul}] (ul)
-- ++(240:1) coordinate[label=left:{l}] (l)
-- ++(300:1) coordinate (ll);
\coordinate[label=below right:{a}]
(a) at (1.27106916798686, 0.469505571318668);
\coordinate (tll) at (0.117300021398114, 0.294835256924744);
\coordinate (tlr) at (0.798192881206518, 0.294835256924744);
\coordinate (tur) at (0.798192881206518, 1.61553741320908);
\coordinate (tul) at (0.117300021398114, 1.61553741320908);
\coordinate[label=below:{x}] (x) at (0.435936138301, 0);
\coordinate[label=above:{y}] (y) at (0.689095323638, 1.73205080756888);
\tkzInit[ymin=0,ymax=2,xmin=-0.5,xmax=2]
\tkzInterLL(l,ur)(a,ul) \tkzGetPoint{A}
\tkzInterLL(ll,y)(ul,a) \tkzGetPoint{B}
\tkzInterLL(l,ur)(ll,y) \tkzGetPoint{C}
\tkzInterLL(ll,a)(l,x) \tkzGetPoint{D}
\tkzDefCircle[in](A,B,C) \tkzGetPoint{U} \tkzGetLength{rU}
\tkzDefCircle[in](tll,tlr,D) \tkzGetPoint{L} \tkzGetLength{rL}
% Locate page number
\tkzDefShiftPoint[L](1,0){Lr}
\tkzInterLL(L,Lr)(tur,tlr) \tkzGetPoint{pagenumber}
% Locate running header
\tkzDefShiftPoint[U](0,\rU pt){Uu}
\tkzDefShiftPoint[Uu](1,0){Uur}
\tkzInterLL(Uu,Uur)(y,r) \tkzGetPoint{header}
\color{black};
\draw (ll) -- (lr) -- (r) -- (ur) -- (ul) -- (l) -- cycle;
\color{gray};
\draw (ur) -- (l) -- (x) -- (r) -- (y) -- (ll) -- (a) -- (ul);
\draw (l) -- (ur);
\draw (tul) -- (tur) -- (tlr) -- (tll) -- cycle;
\draw (ul) -- (ur) -- (lr) -- (ll) -- cycle;
\tkzSetUpLine[color=gray]
\tkzDrawCircle[R](U, \rU pt)
\tkzDrawCircle[R](L, \rL pt)
\tkzDrawSegments(Uu,header L,pagenumber)
\end{tikzpicture}
\end{document}
更新:为了澄清问题,除了图片中隐含的交叉约束之外,还必须强制文本块为具有严格垂直/水平方向的矩形。这一点,以及点位于六边形内(而不是外部某处)的约束,足以确保解决方案在整体缩放范围内是唯一的,该缩放范围由 Bringhurst 的书使用的大约 5.2"x9" 的物理纸张尺寸固定。(正如 @percusse 所提到的,六边形给出了精确的比率5.2:5.2*2*cos(30º)
= 5.2:9.006664202...
。)
y
如果指定了两个数字,则可以使用简单的几何交点等来完全指定构造。特别是,可以指定沿ul--ur
和x
沿 的分数ll--lr
(在 metapost 符号中z.y=y[z.ul,z.ur]
为 和)。z.x=x[z.ll,z.lr]
可以用代数方法找到精确的解:
q = (81 - √3186)^(1/3)
y = q/3 - 2 + 5/q ≈ 0.689095323637659465372247907...
x = (y^2 + 4*y + 3)/(-2*y^2 - 4*y + 18) ≈ 0.4359361383008273751170828497...
存在其他一致的解决方案,但点x
和y
位于六边形的相应边之外:这是文本块位于页面内的唯一解决方案。由于这些是三次方程的解,我怀疑完整的解决方案是否在 Metapost 的线性求解能力范围内,但我认为仍然可能存在一个很好的几何构造。
参考:这个答案这个问题:布林赫斯特回忆录中的章节风格
答案1
为了让事情顺利进行(并开始使用 MetaPost),以下是我目前所拥有的:(更新虽然我有一些想法,但我仍然需要测试 Barbara 和 mforbes 的提示和想法)
beginfig(1);
defaultscale := .8; % make the text a little smaller
u := 1.5in;
phi := 1.618033988749895;
for i:= 0 upto 5: z.hexc[i] = right scaled u rotated (i*360/6); endfor;
path hexa; hexa := for i:=0 upto5: z.hexc[i]--endfor cycle;
fill hexa withcolor .9[green,white]; draw hexa;
dotlabel.rt("r", z.hexc0); dotlabel.urt("ur", z.hexc1);
dotlabel.ulft("ul", z.hexc2); dotlabel.lft("l", z.hexc3);
dotlabel.llft("ll", z.hexc4); dotlabel.lrt("lr", z.hexc5);
path recto; recto := z.hexc1--z.hexc2--z.hexc4--z.hexc5--cycle;
path verso; verso := recto shifted (-1u,0);
for i:=verso,recto:%,recto shifted (1u,0):
draw i withpen pencircle scaled 1.2; endfor;
picture mforbes; mforbes :=
image(
z.a = (1.27106916798686u, 0.469505571318668u);
z.tll = (0.117300021398114u, 0.294835256924744u);
z.tlr = (0.798192881206518u, 0.294835256924744u);
z.tur = (0.798192881206518u, 1.61553741320908u);
z.tul = (0.117300021398114u, 1.61553741320908u);
z.x = (0.435936138301u, 0);
z.y = (0.689095323638u, 1.73205080756888u);
dotlabels.lrt(a,tll,tlr,tur,tul,x,y);
);
drawoptions( withcolor .5 red );
draw mforbes shifted llcorner recto;
% Bringhurst's lines:
draw z.hexc1--z.hexc3--z.x shifted llcorner recto--z.hexc0--
z.y shifted llcorner recto--z.hexc4--z.a shifted llcorner recto--z.hexc2
%dashed evenly
;
drawoptions();
% Van de Graaf: http://en.wikipedia.org/wiki/Canons_of_page_construction
picture van_de_Graaf; van_de_Graaf := image(
path Van_de_Graaf[];
Van_de_Graaf0 := ulcorner verso--lrcorner recto--ulcorner recto
--llcorner verso--urcorner recto;
draw Van_de_Graaf0 dashed evenly;
% subpath (0,1) is the first line, (1,2) is the second, etc.
z.vdG0 = (subpath(3,4) of Van_de_Graaf0) intersectiontimes
(subpath(3,4) of hexa);
z.vdG1 = point xpart z.vdG0 of subpath(3,4) of hexa; % show this point
z.vdG2 = point ypart z.vdG0 of subpath(1,2) of hexa; % on this path
% ypart(z.vdG1) == xpart(z.vdG1) ?
dotlabel.lft("vdG1", z.vdG1);
dotlabel.urt("vdG2", z.vdG2);
% Close, but no cigar. Back to the drawing board.
% van de Graaf continued to project lines from the intersections:
z.vdG3 = (subpath(1,2) of Van_de_Graaf0) intersectionpoint
(subpath(3,4) of Van_de_Graaf0);
z.vdG4 = (xpart z.vdG3, ypart urcorner recto);
z.vdG5 = (subpath(0,1) of Van_de_Graaf0) intersectionpoint
(subpath(2,3) of Van_de_Graaf0);
z.vdG6 = (xpart z.vdG5, ypart urcorner verso);
dotlabels.ulft(vdG3, vdG4, vdG5, vdG6);
Van_de_Graaf1 := (z.vdG5)--(z.vdG4);
Van_de_Graaf2 := (z.vdG6)--(z.vdG3);
drawoptions( dashed evenly );
draw Van_de_Graaf1; draw Van_de_Graaf2;
drawoptions();
% Nope. Not even close.
z.guess_a = whatever[z.vdG6,z.vdG3] = whatever[z.hexc0,z.hexc5];
% Did I hit it? Pleasepleasepleasepleaseplease...
dotlabel.lrt("guess a", z.guess_a);
% Nope.
% That intersection of cross-page vdG's looks promising
);
draw van_de_Graaf withcolor .5 white;
z.golden1 = point 1/phi of subpath(5,4) of hexa;
z.golden2 = point 1/phi of subpath(2,1) of hexa;
drawoptions( withcolor .5[green,red] );
dotlabel.bot(btex $\phi$ etex, z.golden1);
dotlabel.top(btex $\phi$ etex, z.golden2);
drawoptions();
endfig;
end
(我很少使用 MetaPost,因此如果您有改进建议,请分享)