tikz 是否与某些包冲突?

tikz 是否与某些包冲突?

不知道从哪里开始。当我使用较大的前导时,我可以在 tikz 中绘制一些直线,但随后它会停止绘制且不显示错误。第一个例子也是https://tikz.dev/tutorial使用控件根本不起作用。

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

它回应:


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);

然后我想我最好从更少的包开始,尽可能简单,所以我选择了教程中的第一个示例

\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

回到我的第一个包含大约 20 个包的文档,我仍然可以画几条直线,但它拒绝进一步绘图并且没有给出任何错误!?!?

我已清理所有临时文件 .aux、.out 等。重新运行所有内容,但仍未画出最后一行。

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

下面是我的第一份文档,其中包含几个包,虽然它没有画出我的最后一条直线,而且肯定不是带有“控件”的那个,但它至少可以绘制一些东西


\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}```

相关内容