I am trying to use tikz to make a field tower. I have \usepackage{tikz}at the top, and when I comment out my tikz section, the file compiles with no problem. The section using tikz looks like this:

\node (Q1) at (0,0) {$\mathbb{Q}$};
\node (Q2) at (2,2) {$\mathbb{Q}\Big[\sqrt{7}\Big]$};
\node (Q3) at (0,4) {$\mathbb{Q}\Big[\sqrt{3}, \sqrt{7}\Big]$};
\node (Q4) at (-2,2) {$\mathbb{Q}\Big[\sqrt{3}\Big]$};

\draw (Q1)--(Q2)
\draw (Q1)--(Q4)
\draw (Q3)--(Q2)
\draw (Q3)--(Q4)

The error I am getting is "Sorry, your compile took too long to run and timed out." I know that usually means a fatal error, but the rest of my document compiles totally fine and I am not sure what is wrong with my tikz. I am using Overleaf and have never really had this problem before.

  • 6
    Welcome to TeX.SX! You need to add a semicolon ; after every \draw (as well as after every \fill, \node and similar) macro in a TikZ environment. So, in your code, you need to write \draw (Q1)--(Q2); etc. Oct 25, 2022 at 17:40
  • 1
    Lines between nodes you can write as \draw (Q1)--(Q2)-- (Q3)--(Q4) -- (Q1);
    – Zarko
    Oct 25, 2022 at 18:13
  • The reason for the timeout is that nested \draw (or node, fill, etc) commands create infinite loops.
    – Rmano
    Oct 25, 2022 at 20:16

2 Answers 2

  • In Overleaf you can compile tikzpictures without any problems
  • but your picture code is erroneous. Each command in code had to be terminated with ; as mentioned @Jasper Habich in his comment. -Your code you ba srite also on the following way:

\node (Q1) at (0,0)     {$\mathbb{Q}$};
\node (Q2) at (2,2)     {$\mathbb{Q}\Big[\sqrt{7}\Big]$};
\node (Q3) at (0,4)     {$\mathbb{Q}\Big[\sqrt{3}, \sqrt{7}\Big]$};
\node (Q4) at (-2,2)    {$\mathbb{Q}\Big[\sqrt{3}\Big]$};

\draw (Q1)--(Q2)-- (Q3)--(Q4) -- (Q1);

Result is the same if you compile above MWE with local LaTeX installation or use Overleaf service:

enter image description here


Using (off-topic) tikz-cd package you will have the same effect.



\begin{tikzcd}[row sep=2cm, arrows=dash]
  &&   \mathbb{Q}\Big[\sqrt{3}, \sqrt{7}\Big] &  \\
   & \mathbb{Q}\Big[\sqrt{3}\Big] \arrow[ur] &&  \mathbb{Q}\Big[\sqrt{7}\Big] \arrow[ul] & \\
  &&   \arrow[ul] \mathbb{Q} \arrow[ur]  


enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .