1

I have tried to compile the following on my own MAC machine through both my text editor and the latexit app, as well as on sharelatex. On my machine I have to quit after a long time, and sharelatex timed out. Im not sure exactly why this isnt quitting with an error or something. I copied and pasted an example from the tikz documentation and put it in a sample beamer slide.

\documentclass{beamer}

% Note - to make this an article/handout we would use:
% \documentclass{article} 
% \usepackage{beamerarticle}

\usepackage{pgfpages}
\usepackage{blindtext}
\usepackage{tikz}
\blindmathtrue
\usepackage{multicol}
% \setbeameroption{show notes on second screen}
\usetheme[progressbar=frametitle]{metropolis}           % Use metropolis theme
% \setbeamertemplate{frame numbering}[none]
\metroset{block=fill}
\setbeamercovered{transparent=15}

\usepackage{amsmath,amssymb,amsthm,mathrsfs,bbm,bm}
\usepackage{graphicx,subcaption,float,enumerate}


\title[short title]{Functions Testing}
\subtitle{Lecture 1}
\date{}
\author{}
\institute{School}


\begin{document}
\maketitle
% \setbeameroption{show notes on second screen}



\begin{frame}[Tea]

\begin{tikzpicture}[thick,help lines/.style={thin,draw=black!50}]

\def\A{\textcolor{input}{$A$}} \def\C{\textcolor{output}{$C$}} \def\E{$E$}

\colorlet{input}{blue!80!black} \colorlet{triangle}{orange}

\def\B{\textcolor{input}{$B$}} \def\D{$D$}

\colorlet{output}{red!70!black}

\coordinate [label=left:\A]

(A) at ($ (0,0) + .1*(rand,rand) $); \coordinate [label=right:\B] (B) at ($ (1.25,0.25) + .1*(rand,rand) $);

\draw [input] (A) -- (B);

\node [name path=D,help lines,draw,label=left:\D]

\node [name path=E,help lines,draw,label=right:\E]

(D) at (A) [circle through=(B)] {};

(E) at (B) [circle through=(A)] {};

\path [name intersections={of=D and E,by={[label=above:\C]C}}];

\draw [output] (A) -- (C) -- (B);

\foreach \point in {A,B,C} \fill [black,opacity=.5] (\point) circle (2pt);

\begin{pgfonlayer}{background} \fill[triangle!80] (A) -- (C) -- (B) -- cycle;

\end{pgfonlayer}

\node [below right, text width=10cm,align=justify] at (4,3) { \small\textbf{Proposition I}\par \emph{To construct an \textcolor{triangle}{equilateral triangle} on a given \textcolor{input}{finite straight line}.} \par\vskip1em Let \A\B\ be the given \textcolor{input}{finite straight line}.

}; \end{tikzpicture}

\end{frame}

\end{document}
  • 1
    Quickly glancing through your code I'd suggest to move (D) at (A) [circle through=(B)] {}; two lines up. Also, I can't see where you are loading tikz and the relevant libraries. – user121799 Apr 20 '18 at 1:12
  • 1
    There is nothing coming after \node [name path=D,help lines,draw,label=left:\D] – percusse Apr 20 '18 at 1:14
  • This example is a copy/paste from page 62 of the tikz doc – user79950 Apr 20 '18 at 1:19
  • 1
    It cannot be like this there is surely a copy/paste error – percusse Apr 20 '18 at 1:20
  • I see some errors sure, but my question is more why does it compile forever without exiting and telling me those errors? – user79950 Apr 20 '18 at 1:21
3

Many errors are due to missing TikZ and its libraries but the initial neverending loop comes from copy/paste error of

\node [name path=D,help lines,draw,label=left:\D]

\node [name path=E,help lines,draw,label=right:\E]

(D) at (A) [circle through=(B)] {};

(E) at (B) [circle through=(A)] {};

Here TikZ never stops looking for the content of the node but encounters another node command and all bets are off. It might have been an error too but since the behavior is not well defined anything can happen. Cleaning up the code and running with Lua|XeLaTeX gives

\documentclass{beamer}
\usepackage{tikz}
\usetikzlibrary{calc, intersections,through,backgrounds}
\usetheme[progressbar=frametitle]{metropolis}
\metroset{block=fill}
\setbeamercovered{transparent=15}

\title[short title]{Functions Testing}
\subtitle{Lecture 1}
\date{}
\author{}
\institute{School}

\begin{document}
\maketitle

\begin{frame}{Tea}
\begin{tikzpicture}[thick,help lines/.style={thin,draw=black!50}]
\def\A{\textcolor{input}{$A$}} \def\C{\textcolor{output}{$C$}} \def\E{$E$}
\colorlet{input}{blue!80!black} \colorlet{triangle}{orange}
\def\B{\textcolor{input}{$B$}} \def\D{$D$}
\colorlet{output}{red!70!black}

\coordinate [label=left:\A] (A) at ($ (0,0) + .1*(rand,rand) $); 
\coordinate [label=right:\B] (B) at ($ (1.25,0.25) + .1*(rand,rand) $);
\draw [input] (A) -- (B);
\node [name path=D,help lines,draw,label=left:\D](D) at (A) [circle through=(B)] {};
\node [name path=E,help lines,draw,label=right:\E](E) at (B) [circle through=(A)] {};
\path [name intersections={of=D and E,by={[label=above:\C]C}}];
\draw [output] (A) -- (C) -- (B);
\foreach \point in {A,B,C}{\fill [black,opacity=.5] (\point) circle (2pt);}
\begin{pgfonlayer}{background}
\fill[triangle!80] (A) -- (C) -- (B) -- cycle;
\end{pgfonlayer}

\node [below right, text width=5.2cm,align=justify] at (4,3) 
  { \small\textbf{Proposition I}\\\emph{To construct an 
    \textcolor{triangle}{equilateral triangle} 
  on a given \textcolor{input}{finite straight line}.} \\[1em] Let \A\B\ be the 
  given \textcolor{input}{finite straight line}.
  };
\end{tikzpicture}
\end{frame}
\end{document}

enter image description here

  • Thank you @percusse - Is this a bug in tikz that I should report somewhere? Or is it just a strange corner case that came out because of copy/paste that should be left as is? – user79950 Apr 20 '18 at 1:27
  • 1
    @user79950 This is your copy/paste went wrong. There is nothing wrong with TikZ in this example. – percusse Apr 20 '18 at 1:27
  • I know. Im just saying that when a user makes a mistake, the desired behavior is to stop compiling and return an error (no matter how cryptic). This example does not do that - it keeps going forever... which seems like a bug... – user79950 Apr 20 '18 at 1:31
  • 1
    @user79950 There is no error here it just keeps on looking because how TeX works. You don't report to C maintainers when your program gets stuck in recursion. – percusse Apr 20 '18 at 1:33
  • Was just about to post the same answer (except that I had text width=5cm instead of 5.2 ;-) BTW, what's the difference between your first comment and mine above? I was trying to say the same thing... – user121799 Apr 20 '18 at 1:33

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.