在文字中對齊 tikz 圖片

在文字中對齊 tikz 圖片

我想在文本中對齊 tikz。

可以在以下連結的第二張圖片中看到範例:圖片來自http://www.echoecho.com/htmlimages08.htm 在此輸入影像描述

這是我的審判:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=6.0em]{geometry}
\usepackage[nomessages]{fp}
\usepackage{mathtools}
\usepackage{amssymb}
\usepackage{stmaryrd }
\usepackage{graphicx}
\usepackage{tikz}
\usepackage{wrapfig}
\usepackage{enumerate}
\usepackage[turkish]{babel}

\usepackage[hidelinks]{hyperref}
\usepackage[stable]{footmisc}
\usepackage{perpage} %the perpage package
\MakePerPage{footnote} %the perpage package command

\setcounter{secnumdepth}{-1}

 \begin{document}

\begin{enumerate}
\item 
Ardışık üç pozitif tamsayının çarpımının hiçbir zaman bir tamsayının birden büyük bir kuvvetine eşit olamayacağını gösteriniz.

\item

\begin{tabular}[t]{p{4.5cm}r}

$ABCD$ kirişler dörtgeni ve $|AE|=|AD|$, $|BC|=|BE|$ dir. 
Buna göre, $EF\parallel AB$ olduğunu gösteriniz.

&


\definecolor{ffffff}{rgb}{1,1,1}
\begin{tikzpicture}[baseline=(current bounding box.north),line cap=round,line join=round,>=triangle 45,x=0.24698133918770565cm,y=0.24577572964669714cm]
\clip(-0.5,-2.72) rectangle (11.5,3.6);
\draw [line width=1.2pt] (0.06,-2.01)-- (4.43,3.26);
\draw [line width=1.2pt] (9.33,1.94)-- (4.43,3.26);
\draw [line width=1.2pt] (9.33,1.94)-- (11.14,-2.13);
\draw [line width=1.2pt] (11.14,-2.13)-- (0.06,-2.01);
\draw [line width=1.2pt] (11.14,-2.13)-- (4.43,3.26);
\draw [line width=1.2pt] (9.33,1.94)-- (0.06,-2.01);
\draw (-0.38,-2.0) node[anchor=north west] {$A$};
\draw (11.4,-2.00) node[anchor=north west] {$B$};
\draw (9.56,2.14) node[anchor=north west] {$C$};
\draw (3.96,3.48) node[anchor=north west] {$D$};
\draw (6,0.92) node[anchor=north west] {$E$};
\draw (7.90,0.87) node[anchor=north west] {$F$};
\begin{scriptsize}
\fill [color=ffffff] (0.06,-2.01) circle (2.0pt);
\fill [color=ffffff] (4.43,3.26) circle (2.0pt);
\fill [color=ffffff] (9.33,1.94) circle (2.0pt);
\fill [color=ffffff] (11.14,-2.13) circle (2.0pt);
\fill [color=ffffff] (6.36,0.67) circle (2.0pt);
\fill [color=ffffff] (7.67,0.66) circle (2.0pt);
\end{scriptsize}
\end{tikzpicture}
\end{tabular}


\item
$0<q<200$ ve $\dfrac{59}{80} < \dfrac{p}{q} <\dfrac{45}{61}$ koşullarını sağlayan bir $(p,q)$ tamsayı çifti bulunuz ve böyle tek bir $(p,q)$ tamsayı çifti olduğunu gösteriniz.

\item
$7$ arkadaşı olan bir kimse, bir hafta boyunca her akşam $3$ arkadaşını yemeğe çağırır. Farklı iki akşam yemeğe çağrılan gruplar birbirlerinden farklı olup; $7$ arkadaştan her biri en az bir akşam yemeğe çağrılmaktadır. Bu koşulları sağlayan kaç değişik çağrı programı yapılabileceğini bulunuz.

\item
\begin{tabular}[t]{p{7cm}r}

$O$ merkezli çemberin yarıçapı $R$'dir. $A$ merkezli $|AB|$ yarıçaplı çember ile $B$ merkezli $|BA|$ yarıçaplı çemberin $D$ kesim noktası alınıyor. $CD$ doğrusu, $O$ merkezli çemberi $E$ noktasında kestiğine göre $|ED|$ uzunluğunu $R$ cinsinden hesaplayınız. 

&
\begin{tikzpicture}[baseline=(current bounding box.north),line cap=round,line join=round,>=triangle 45,x=1.0cm,y=1.0cm]

\clip(-0.16,-1.88) rectangle (6.4,3.52);
\draw [line width=1.2pt] (4.02,0.3) circle (2.16cm);
\draw [line width=1.2pt] (4.55,2.4) circle (1.08cm);
\draw [line width=1.2pt] (3.47,2.39) circle (1.08cm);
\draw [line width=1.2pt] (1.93,0.87)-- (5.5,1.88);
\draw [line width=1.2pt] (1.93,0.87)-- (1.04,0.62);
\draw (4.04,0.04) node[anchor=north west] {$O$};
\draw (5.74,1.94) node[anchor=north west] {$C$};
\draw (4.78,2.58) node[anchor=north west] {$A$};
\draw (3.1,2.62) node[anchor=north west] {$B$};
\draw (1.56,1.12) node[anchor=north west] {$E$};
\draw (4.10,1.25) node[anchor=south east] {$D$};
\begin{scriptsize}
\fill [color=ffffff] (4.02,0.3) circle (2.0pt);
\fill [color=ffffff] (5.5,1.88) circle (2.0pt);
\fill [color=ffffff] (4.55,2.4) circle (2.0pt);
\fill [color=ffffff] (3.47,2.39) circle (2.0pt);
\fill [color=ffffff] (4.01,1.46) circle (2.0pt);
\fill [color=ffffff] (1.93,0.87) circle (2.0pt);
\end{scriptsize}
\end{tikzpicture}

\end{tabular}

\item
$$\sqrt{x - \dfrac{1987}{14}} + \sqrt{x - \dfrac{1988}{13}} + \sqrt{x - \dfrac{1989}{12}} = \sqrt{x - \dfrac{14}{1987}} + \sqrt{x - \dfrac{13}{1988}} + \sqrt{x - \dfrac{12}{1989}}$$
denkleminin tüm reel çözümlerini bulunuz.

\item
İki kişinin bir keki paylaşmasının her iki tarafı da hoşnut eden ve adil bir yöntemi şudur: Biri keki iki parçaya ayırır, diğeri parçalardan birini kendine seçer. Diğer bir deyişle keki $[0,1]$ aralığı gibi düşünürsek, birinci kişi $x_1\in [0,1]$ seçer; ikinci kişi ise $x_1$ ve $1-x_1$ sayılarından birini seçer. (Burada her iki tarafın da ``keksever'' olduğu varsayıldığından, ikinci kişinin $x_1$ ve $1-x_1$ sayılarından daha büyük olanını seçeceği ve dolayısıyla birincinin de $x_1 = \dfrac 12$ seçimini yapacağı kolaylıkla görülür.) Üç keksever kişi için benzer bir paylaşma yöntemi bulabilir misiniz? 



\end{enumerate}

\end{document}

答案1

\usepackage[turkish]{babel}首先,你的程式碼無論有沒有都無法編譯\shorthandoff{=}。現在我很難用這樣的 tikz 程式碼給出答案。我認為你的程式碼來自 Geogebra 或類似的東西。因此,在 A 部分中,我嘗試向您提供一些解釋,以將程式碼從地理代數轉換為更具可讀性和更容易理解的內容。下一個程式碼現在很完美,因為我嘗試讓程式碼簡單且與您的程式碼非常相似。

A部分

你面前有一張白紙和一些鉛筆。

a) 選擇鉛筆 您需要選擇顏色和尺寸。預設顏色為黑色,大小為 0.4pt。在您的程式碼中\definecolor{ffffff}{rgb}{1,1,1}定義顏色; rgb 1,1,1 是白色,很奇怪但沒有必要。 Tikz 載入 xcolor 包,該包定義了一些基本顏色,例如白色和黑色。如果您繼續執行 Geogebra,您可以使用編輯器將所有程式碼(如 ffffff)變更為白色。一個例子\definecolor{mycolor}{rgb}{.2,1,.5}。因為尺寸line width=0.5pt是在開頭給出的,因為這個尺寸用於繪圖。line width=1.2pt對我來說太大了但是...

b) 現在你需要畫小圓圈。您在紙上選擇一個點(a,b),第一個點點(0,0)就可以了。我們需要在之後使用這個點,這樣就可以將該點命名為 。您給予一個帶有座標 (a) 的名稱。之後,您用同一支鉛筆寫下標籤 $A$。使用 tikz,標籤或文字可以與節點一起放置。預設情況下,節點是一個矩形,您可以在其上寫入 $A$。您可以在此處使用錨點將矩形附加到該點anchor=north west

用同一支鉛筆添加 B、C 和 D。您可以使用選項 填滿圓圈[fill]評論 :fill=gray例如, 預設情況下,如果您想要其他顏色,則顏色為黑色。

c) 現在我們可以畫線了。與我們繪製的四邊形\draw (a) -- (b) -- (c) --(d) -- cycle;循環相同的顏色和相同的大小用於閉合路徑

d) 點E和F。使用重心座標很容易定義它。在我的範例中,E 位於兩條線 AC 和 BD 的交點處。我們將這些線(路徑)命名為name path

\draw (a) -- (b) -- (c) --(d) -- cycle;
\draw [name path=ac] (a) -- (c);
\draw [name path=bd] (b) -- (d);

我得到了與 `name junctions={of=ac and bd, by=e}`` 的交集

你可以避免最後的步驟,因為 Geogebra 可以給你 E 和 F 的座標,但我認為你需要用簡單的座標來放置 A、B、C 和 D。它更具可讀性。

圖片完整程式碼

\begin{tikzpicture}[scale=.4,line width=0.5pt]
\draw[fill] (0,0)  coordinate (a)  circle (4pt)   node[anchor=north west] {$A$}
            (11,0) coordinate (b)  circle (4pt)   node[anchor=north west] {$B$}
            (9,3)  coordinate (c)  circle (4pt)   node[anchor=south west] {$C$} 
            (3,4) coordinate (d)   circle (4pt)   node[anchor=south west] {$D$} ;
 \draw (a) -- (b) -- (c) --(d) -- cycle;
 \draw [name path=ac] (a) -- (c);
 \draw [name path=bd] (b) -- (d);
 \draw [name intersections={of=ac and bd, by=e},fill] (e) circle (4pt) node[anchor=north] {$E$};
 \draw[fill]  (barycentric cs:a=1,c=1) coordinate (f) circle (4pt) node[anchor=north] {$F$};;
\end{tikzpicture}

評論 :我刪除了該baseline選項:該框沒有相對於一條線放置。我也刪除了x= ... and y=...。使用 x 和 y 預設的 1cm,然後使用比例更簡單。

B部分

我使用該picins包將圖片放置在文字中。你可以找到它這裡

texlive 上沒有,需要下載。wrapfig包與枚舉列表不相容。

您需要載入\usepackage{mdwlist}.這個套件很有用,因為當你使用套件\parpic的巨集時picins,縮排邊距是錯誤的,所以你需要在下一項之前添加

\暫停{枚舉} \恢復{枚舉}

完整的程式碼可以幫助您:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[margin=6.0em]{geometry}
\usepackage{tikz}
\usetikzlibrary{intersections}
\usepackage{picins}
%  http://tug.ctan.org/tex-archive/macros/latex209/contrib/picins/picins.sty
\usepackage{mdwlist}
\usepackage{multicol,lipsum}
\usetikzlibrary{arrows}

\begin{document}
\begin{multicols}{2}
\begin{enumerate}

    \item 
\parpic[l]{%
\begin{tikzpicture}[scale=.25,line width=0.5pt]
\draw[fill] (0,0)  coordinate (a)  circle (4pt)   node[anchor=north west] {$A$}
            (11,0) coordinate (b)  circle (4pt)   node[anchor=north west] {$B$}
            (9,3)  coordinate (c)  circle (4pt)   node[anchor=south west] {$C$} 
            (3,4) coordinate (d)   circle (4pt)   node[anchor=south west] {$D$} ;
 \draw (a) -- (b) -- (c) --(d) -- cycle;
 \draw [name path=ac] (a) -- (c);
 \draw [name path=bd] (b) -- (d);
 \draw [name intersections={of=ac and bd, by=e},fill] (e) circle (4pt) node[anchor=north] {$E$};
 \draw[fill]  (barycentric cs:a=1,c=1) coordinate (f) circle (4pt) node[anchor=north] {$F$};;
\end{tikzpicture}
}%
\lipsum[1]
\suspend{enumerate}
\resume{enumerate}

\item   \parpic[r]{%
\begin{tikzpicture}[scale=.4,line width=0.5pt]
\draw[fill] (0,0)  coordinate (a)  circle (4pt)   node[anchor=north west] {$A$}
            (11,0) coordinate (b)  circle (4pt)   node[anchor=north west] {$B$}
            (9,3)  coordinate (c)  circle (4pt)   node[anchor=south west] {$C$} 
            (3,4) coordinate (d)   circle (4pt)   node[anchor=south west] {$D$} ;
 \draw (a) -- (b) -- (c) --(d) -- cycle;
 \draw [name path=ac] (a) -- (c);
 \draw [name path=bd] (b) -- (d);
 \draw [name intersections={of=ac and bd, by=e},fill] (e) circle (4pt) node[anchor=north] {$E$};
 \draw[fill]  (barycentric cs:a=1,c=1) coordinate (f) circle (4pt) node[anchor=north] {$F$};;
\end{tikzpicture}
}%
\lipsum[1-1]

\end{enumerate}
\end{multicols}

\begin{enumerate}

    \item 
\parpic[l]{%
\begin{tikzpicture}[scale=.8,line width=0.5pt]
\draw[fill] (0,0)  coordinate (a)  circle (4pt)   node[anchor=north west] {$A$}
            (11,0) coordinate (b)  circle (4pt)   node[anchor=north west] {$B$}
            (9,3)  coordinate (c)  circle (4pt)   node[anchor=south west] {$C$} 
            (3,4) coordinate (d)   circle (4pt)   node[anchor=south west] {$D$} ;
 \draw (a) -- (b) -- (c) --(d) -- cycle;
 \draw [name path=ac] (a) -- (c);
 \draw [name path=bd] (b) -- (d);
 \draw [name intersections={of=ac and bd, by=e},fill] (e) circle (4pt) node[anchor=north] {$E$};
 \draw[fill]  (barycentric cs:a=1,c=1) coordinate (f) circle (4pt) node[anchor=north] {$F$};;
\end{tikzpicture}
}%
\lipsum[1]
\suspend{enumerate}
\resume{enumerate}

\item   \parpic[r]{%
\begin{tikzpicture}[scale=.5,line width=0.5pt]
\draw[fill] (0,0)  coordinate (a)  circle (4pt)   node[anchor=north west] {$A$}
            (11,0) coordinate (b)  circle (4pt)   node[anchor=north west] {$B$}
            (9,3)  coordinate (c)  circle (4pt)   node[anchor=south west] {$C$} 
            (3,4) coordinate (d)   circle (4pt)   node[anchor=south west] {$D$} ;
 \draw (a) -- (b) -- (c) --(d) -- cycle;
 \draw [name path=ac] (a) -- (c);
 \draw [name path=bd] (b) -- (d);
 \draw [name intersections={of=ac and bd, by=e},fill] (e) circle (4pt) node[anchor=north] {$E$};
 \draw[fill]  (barycentric cs:a=1,c=1) coordinate (f) circle (4pt) node[anchor=north] {$F$};;
\end{tikzpicture}
}%  
\lipsum[1-1]

\end{enumerate}
\end{document}  

當我更改圖片的比例時,您可以看到一個小問題,圓圈更大,這是標籤的問題。這就是為什麼程式碼並不完美,但我試圖獲得類似於 geogebra 程式碼的程式碼。

在此輸入影像描述

答案2

看包裝wrapfig(文件還在線提供)。

相關內容