[OS X TeX] A tikzpic problem

Don Green Dragon fergdc at Shaw.ca
Wed Jan 15 03:15:40 CET 2014

Hello Vivianne,

On 12Jan2014, at 3:47 PM, Vivianne Vilar <viviannevilar at gmail.com> wrote:
<<big snip>>

> I think this is a good question for tex.stackexchange.com . You will, as Herbert said, need to say what you include in the full preample, because without that it is hard to guess what the problem might be. 

Thank you for the reference to <tex.stackexchange.com> which I was not aware of, particularly the tikz-??? part. I’ll see what the people on this list say before taking the problem there. 

In my response to Herb, I’ve attached a file which includes a good part of my preamble and still causes the print errors that I mentioned.

> One way to solve the problem, though possibly not what you are after, is to create a pdf of the figure first and include this compiled pdf as a figure in your document. You can do this with the standalone package, code below. When you insert the compiled pdf figure in your document, you need the 
> \begin{figure} 
> \includegraphics{figure}
> \caption{} 
> \end{figure}
> Here is the code for the figure to be compiled separately.
> \documentclass{standalone}
> \usepackage{tikz}
> \begin{document}
> \begin{tikzpicture}
>     \draw (-0.5, 0) -- (7.5,0) ; % horiz segment
>     \filldraw (0,0) circle (2pt) node[anchor=north east] {A}; % label point (0,0) as A
>     \filldraw (7,0) circle (2pt) node[anchor=north west] {B}; % label point (7,0) as B
>     \draw [dotted] (0,0) -- (50:9);
>     \filldraw (50:9) circle (2pt) node [anchor= north west] {$C$};        % draw diagonal segment
>     \foreach \i in {1,...,7}      % place dots along diagonal
>     \filldraw (50:\i) circle (2pt) node [anchor=south east] {\i};
>     \draw [dashed] (7,0) -- (50:7);     %  draw segment from 7 to B
>     % draw lines through 1, 2,..., 6 parallel to line from 7 to B
>     \foreach \m in {1,...,6}
>     \draw (50:\m) -- (\m, 0);
>     \foreach \t in {1,...,6}      % label the points n/7
>     \filldraw [red] (\t,0) circle (2pt) node [below] {\t/7};
>     % describe construction process
>     \draw [xshift=6.8cm, yshift=5cm]
>     node[right, text width = 7.5cm,fill=green!20]
>     {The points are constructed as follows:\\
>         \hspace*{9pt}First the segment $A$ to $B$ is drawn so that the distance from $A$ to $B$ is 1 unit
>         of length. Next construct the diagonal segment from $A$  to $C$ which we will denote by
>         $\mathcal{S}$. Then along $\mathcal{S}$ construct the points labelled $1,\dots,7$ so that if $d$ is
>         the distant from $A$ to 1, then the distance from $n$ to $n+1$ is also $d$ --- use compass!\\
>         \hspace*{9pt}Now the dashed segment from 7 to $B$, call it $\mathcal{T}$. Finally, construct a
>         line through point $n$ (= 1, 2, \dots, 6) which is parallel to $\mathcal{T}$. The resulting line
>         intersects the segment from $A$ to $B$ at a  point representing the fraction $n/7$. So $A$ is 0/7
>         and $B$ is 7/7.\\
>         \hspace*{9pt}The Greeks were capable of carrying out the constructions above using only a straight
>         edge (not a ruler) and a compass.
>     };
> \end{tikzpicture}
> \end{document}

If I understand your suggestion above, which I thank you for as I was not so aware, your solution is not what I prefer. I’d like to be able to use the TikZ code directly in the source code. There is a good chance that I’ve bungled somewhere. However, I must try out your suggestion in order to be able to compare file sizes of the TikZ code and compare that with the PDF's file size.  

don green dragon
fergdc at shaw.ca

More information about the macostex-archives mailing list