0

Don't know where to start. When I use a large preamble I can draw some straight lines in tikz but then it stops drawing without error indication. Also the first example at https://tikz.dev/tutorial using controls doesn't work at all.

\draw (0,0) .. controls (1,1) and (2,1) .. (2,0);

It responds:


See the tikz package documentation for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.43 \draw 
             (0,0) .. controls (1,1) and (2,1) .. (2,0);

Then I thought that I'd better start with fewer packages and just go as simple as possible so I picked the first example in the tutorial as is

\documentclass{article} % say
\usepackage{tikz}
\begin{document}
We are working on
\begin{tikzpicture}
  \draw (-1.5,0) -- (1.5,0);
  \draw (0,-1.5) -- (0,1.5);
\end{tikzpicture}.
\end{document}```


But it complains


```! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help. 
 ...                                              
                                                  
l.2 \documentclass{article}�
                            ��% say

Going back to my first document with some 20 packages included, I can still draw a couple of straight lines but it refuses further drawings and gives no errors!?!?

I've cleaned out all temporary files .aux, .out etc. re-ran everything but it won't draw the last line.

\draw [thick] (1,3.5) -- (1,1.5);

Below is this first document of mine, the one with several packages included which at least draws something albeit it doesn't draw my last straight line and definitely not the one with "controls"


\documentclass[twocolumn]{book}
\usepackage{parskip}
\usepackage[bottom=1in]{geometry}
\usepackage{supertabular}
\usepackage[utf8]{inputenc}
%\usepackage{geometry}   % Setup for page and paper dimensions
\usepackage{wrapfig}
\usepackage{caption}
\captionsetup{
  font=small,
  labelfont=bf,
  tableposition=top
}

\usepackage[swedish]{babel}
\usepackage{hyperref}
\hypersetup{
    colorlinks,
    citecolor=black,
    filecolor=black,
    linkcolor=black,
    urlcolor=black,
    pdfborder = {0 0 0}
}
\usepackage{subcaption}
\usepackage{verbatimbox}
\usepackage{multicol}
\usepackage{graphicx}   
\usepackage{lipsum}  
\usepackage{amsmath}
\usepackage{listings}   
\usepackage{tikz}
%\usepackage{pgfplots}
%\pgfplotsset{compat=newest} 
%\date{} % Activate to display a given date or no date (if empty),
         % otherwise the current date is printed 
 
\begin{document}
    \begin{tikzpicture}
        %\draw (0, 0) grid (4, 4);
        % x-axis
        \draw [thick,->] (0,0) -- (4,0);
        % y-axis
        \draw [thick,->] (0, 0) -- (0,4);
        % x-axis label
        \node at (-0.5, 4) {$p$};
        % y-axis label
        \node at (4, -0.5) {$V$};
        % origin point
        \draw [color=black, fill=black] (0, 0) circle (0.05);
        %Isokor uppvärmning
        \draw [thick](1,1.5) -- (1,3.5);
%       \draw (1,3.5) ..  controls (1,1) and (2,1) .. (3,0.5);
        %\draw [thick,->] (1,3.5) ..  controls (2.5,2) and (2,1) .. (3,0.5);
        %%\draw [thick] (3,0.5) parabola (1,3.5);
        \draw [thick] (3,0.5) -- (1,3.5);
        \draw [thick] (1,3.5) -- (1,1.5);
\end{tikzpicture}
\begin{tikzpicture}
%Doesn't work
%\draw (0,0) .. controls (1,1) and (2,1) .. (2,0);
\end{tikzpicture}
\end{document}```
6
  • 2
    The complete error in your small example actually starts with "! LaTeX Error: Unicode character   (U+2007) not set up for use with LaTeX." You have some invisible characters in the preamble that causes that, I think. Commented May 15, 2022 at 10:26
  • 1
    Indeed the whole thing is just a silly typo/invisible Unicode character error thing. Just retype the text with your keyboard, it will work.
    – user202729
    Commented May 15, 2022 at 10:29
  • 1
    In line, \draw(0,0) .. controls (1,1) and (2,1) .. (2,0); it's the same problem.
    – pascal974
    Commented May 15, 2022 at 10:31
  • 1
    Since one cannot (or at least should not) nest tikzpictures, you could say that it collides with itself ;-) Commented May 15, 2022 at 13:41
  • 1
    Thanks for reporting this issue. I have now fixed tikz.dev and it doesn't use weird unicode symbols for indentation anymore. Commented May 19, 2022 at 21:01

0

You must log in to answer this question.

Browse other questions tagged .