有没有办法将图形放置在文本行中?

有没有办法将图形放置在文本行中?

我正在考虑复制这种几何演示风格;

答案1

Slyusarev Sergey 使用 Metapost 在 ConTeXt 中完整复制了 Byrne 的 Euclid(您也可以在 LaTeX 中使用 Metapost),可在此处找到https://github.com/jemmybutton/byrne-euclid。您可以从发布部分

最重要的文件是https://github.com/jemmybutton/byrne-euclid/blob/master/byrne.mp其中包含所有图片的 metapost 定义(即主文件中使用的宏)。最基本绘图的宏以 为前缀by,例如byNamedLine

向您展示一些代码(https://github.com/jemmybutton/byrne-euclid/blob/2762f9300837eab75273ca8cf0205cdeaf1658f4/byrne_context.tex#L2799-L2837):

\startProposition[title={Prop XXXIV. Theor.}, reference=prop:I.XXXIV]
\defineNewPicture{
pair A, B, C, D, d[];
d1 := (5/2u, 0);
d2 := (-7/8u, -3u);
A := (0, 0);
B := A shifted d1;
C := A shifted d2;
D := C shifted d1;
byAngleDefine(B, A, D, byblue, 0);
byAngleDefine(D, A, C, byred, 0);
byAngleDefine(C, D, A, byyellow, 0);
byAngleDefine(A, D, B, byred, 0);
byAngleDefine(A, C, D, byblack, 0);
byAngleDefine(D, B, A, byblack, 0);
draw byNamedAngleResized();
draw byLine(A, D, byblack, 0, 0);
byLineDefine(A, B, byred, 0, 0);
byLineDefine(C, D, byred, 1, 0);
byLineDefine(A, C, byyellow, 0, 0);
byLineDefine(B, D, byblue, 0, 0);
draw byNamedLineSeq(0)(AB,BD,CD,AC);
draw byLabelsOnPolygon(A, B, D, C)(0, 0);
}
\drawCurrentPictureInMargin
\problemNP{T}{he}{opposite sides and angles of any parallelogram are equal, and the diagonal (\drawUnitLine{AD}) divides it into two equal parts.}

\startCenterAlign
Since $\left\{\eqalign{\drawAngle{BAD} &= \drawAngle{CDA}\cr\drawAngle{DAC} &= \drawAngle{ADB}\cr}\right\}$ \inprop[prop:I.XXIX]\\
and \drawUnitLine{AD} common to the two triangles.

$\therefore \left\{\eqalign{\drawUnitLine{AB} &= \drawUnitLine{CD}\cr \drawUnitLine{AC} &= \drawUnitLine{BD}\cr \drawAngle{B} &= \drawAngle{C}\cr}\right\}$ \inprop[prop:I.XXVI]\\
and $\drawAngle{BAD,DAC} = \drawAngle{CDA,ADB}$ \inax[ax:I.II].
\stopCenterAlign

Therefore the opposite sides and angles of the parallelogram are equal: and as the triangles \drawLine{AD,CD,AC} and \drawLine{AB,BD,AD} are equal in every respect \inprop[prop:I.IV], the diagonal divides the parallelogram into two equal parts.

\qed
\stopProposition

这是你在问题中展示的命题的代码。它呈现为

伯恩的欧几里得

答案2

除了包含图形之外,正如 Ulrike 所提到的,您还可以只放tikzpictures。(这主要是出于我自己的好奇心而写的。我知道字体并不完全匹配。)这样您就可以在文本中的小图片中获得平行四边形的精确角度。甚至,TiZ 为您计算角度,即如果您选择不同的平行四边形,角度将自动调整。

\documentclass{article}
\usepackage[right = 3in]{geometry}
\usepackage[utf8]{inputenc}
\usepackage{chancery}
\usepackage[T1]{fontenc}
\usepackage{lettrine}
\usepackage{GoudyIn} % use texdoc cfr-initials to see alternatives
\usepackage{amssymb}
\usepackage{tikzpagenodes}
\usetikzlibrary{calc}

\renewcommand{\LettrineFontHook}{\GoudyInfamily{}}
\LettrineTextFont{\itshape}
\setcounter{DefaultLines}{3}
\setlength{\DefaultNindent}{0pt}
\setlength{\DefaultFindent}{1pt}

\newcommand\CenterObject[1]{\vcenter{\hbox{#1}}}
\newcommand\CenterTikz[1]{\vcenter{\hbox{\begin{tikzpicture}
#1
\end{tikzpicture}}}}
\definecolor{dull}{RGB}{249,243,217}
\pagecolor{dull}
\begin{document}
\begin{tikzpicture}[overlay,remember picture]
\path ([xshift=-1.5cm,yshift=-1cm]current page.east|-current page text area.north)
 coordinate (tr) ++ (180:3cm) coordinate (tl)
  ++ (-110:3cm) coordinate (bl) ++ (0:3cm) coordinate (br);
 \path[fill=blue] let \p1=($(br)-(tl)$), \n1={atan2(\y1,\x1)} in
  \pgfextra{\pgfmathsetmacro{\myAngleTLA}{\n1}\xdef\myAngleTLA{\myAngleTLA}}
  (tl) -- ++ (1,0) arc[start angle=0,end angle=\myAngleTLA,radius=1];
 \path[fill=red] let \p1=($(bl)-(tl)$), \n1={atan2(\y1,\x1)} in
  \pgfextra{\pgfmathsetmacro{\myAngleTLB}{\n1}\xdef\myAngleTLB{\myAngleTLB}}
  (tl) -- ++ (\myAngleTLA:1) arc[start angle=\myAngleTLA,end angle=\myAngleTLB,radius=1];
 \path[fill=yellow!50!orange] 
  (br) -- ++ (-1,0) arc[start angle=180,end angle=180+\myAngleTLA,radius=1];
 \path[fill=red] 
  (br) -- ++ (180+\myAngleTLA:1) arc[start angle=180+\myAngleTLA,end angle=180+\myAngleTLB,radius=1];
 \path[fill=black] (tr) -- ++ (180:1)
  arc[start angle=180,end angle=360+\myAngleTLB,radius=1]
  (bl) -- ++ (0:1)
  arc[start angle=0,end angle=\myAngleTLB+180,radius=1];
 \path[ultra thick,line cap=round] (tr) edge[red] (tl) 
 (tl) edge[yellow!50!orange] (bl)  
 (bl) edge[red,densely dashed] (br)  
 (tr) edge[blue] (br) (tl) edge (br);
\end{tikzpicture}

\lettrine{T}{HE} opposite sides and angles of any parallelogram are equal, and
the diagonal $(\CenterTikz{\draw[very thick] (0,0) --(2em,0);})$ divides it into equal parts.\bigskip

\noindent
Since $\left\{\begin{array}{@{}r@{\,}c@{\,}l@{}}
\CenterTikz{%
 \fill[blue] (0,0) -- (0.5,0) arc[start angle=0,end angle=\myAngleTLA,radius=0.5];
} &= &
\CenterTikz{%
 \fill[yellow!50!orange] (0,0) -- (-0.5,0) 
 arc[start angle=180,end angle=180+\myAngleTLA,radius=0.5];
}\\[2ex]
\CenterTikz{%
 \fill[red] (0,0) -- (\myAngleTLA:0.5) arc[start angle=\myAngleTLA,end angle=\myAngleTLB,radius=0.5];
} &= &
\CenterTikz{%
 \fill[red] (0,0) -- (180+\myAngleTLA:0.5) arc[start angle=180+\myAngleTLA,end angle=180+\myAngleTLB,radius=0.5];
}\\
\end{array}\right\}$ and $\vcenter{\hbox{\begin{tikzpicture}\draw[very thick] (0,0) --
(2em,0);\end{tikzpicture}}}$ are common to the two triangles, 
\[
 \therefore\left\{\begin{array}{@{}r@{\,}c@{\,}l@{}}
 \CenterTikz{\draw[very thick,red] (0,0) --(2em,0);}
 &=&
 \CenterTikz{\draw[very thick,red,densely dashed] (0,0) --(2em,0);}\\
 \CenterTikz{\draw[very thick,yellow!50!orange] (0,0) --(2em,0);}
 &=&
 \CenterTikz{\draw[very thick,blue] (0,0) --(2em,0);}\\
 \CenterTikz{\path[fill=black] (0,0) -- ++ (180:0.5)
  arc[start angle=180,end angle=360+\myAngleTLB,radius=0.5];}
 &=&
 \CenterTikz{\path[fill=black] (0,0) -- ++ (0:0.5)
  arc[start angle=0,end angle=180+\myAngleTLB,radius=0.5];}\\
 \end{array}\right\}
\]
and
\[
\CenterTikz{%
 \fill[blue] (0,0) -- (0.5,0) arc[start angle=0,end angle=\myAngleTLA,radius=0.5];
 \fill[red] (0,0) -- (\myAngleTLA:0.5) arc[start angle=\myAngleTLA,end angle=\myAngleTLB,radius=0.5];
 }
=
\CenterTikz{%
 \fill[yellow!50!orange] (0,0) -- (-0.5,0) 
 arc[start angle=180,end angle=180+\myAngleTLA,radius=0.5];
 \fill[red] (0,0) -- (180+\myAngleTLA:0.5) arc[start angle=180+\myAngleTLA,end angle=180+\myAngleTLB,radius=0.5];
 }\;.
\]
\end{document}

在此处输入图片描述

相关内容