我正在使用tikz
绘制一个tikzpicture
,它工作正常。但是,如果我尝试使用语法插入表格
\begin{table} ...\end{table}
我得到了错误
Too many }'s. \end{table}
\begin{document} ended by \end{table}. \end{table}
Extra \endgroup. \end{table}
我的 TeX 文档是
\documentclass[oneside,12pt,a4paper]{book}
\usepackage{UTMThesis}%------------------------------------------------------------------
\usepackage{cite} % change cite from [1,2,3] to [1-3] etc for number system
\makeatletter % change from
\renewcommand{\@biblabel}[1]{#1.} % [1] to 1. etc
\makeatother % in list of references
%----------------------------------------------------------------
\setlength{\voffset}{-2.11cm}
\setlength{\hoffset}{-.4cm}
%---------------------------------------------------------
\setlength{\textwidth}{14.5cm}
\setlength{\textheight}{24.5cm}
%-----------------------------------------------------------
%\pagestyle{plain}
%-------------------------------------------------------
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{}
\chead{}
\rhead{}
\lfoot{}
\cfoot{\vspace{-.35cm}\thepage} %
\renewcommand{\headrulewidth}{0pt}
%----------------own-----------
\usepackage{relsize}
\usepackage{tikz}
\usetikzlibrary{positioning,tikzmark}
%-------------------------------------------------------
\begin{document}
\begingroup\larger[4]
\[
\tikzmarknode{n1}{\rho\frac{D\vec V}{Dt}}~=~\tikzmarknode{n2}{-\nabla p}
+ \tikzmarknode{n3}{\rho\vec g}+\tikzmarknode{n4}{\mu\nabla^2\vec V}\]
\endgroup
\noindent
\begin{tikzpicture}[remember picture,shorten <=1mm,font=\footnotesize\sffamily]
\begin{scope}[nodes={text width=6.5em,align=left},node distance=1ex]
\node (e1) {\underline{Total derivative}};
\node[right=of e1.north east,anchor=north west] (e2) {\underline{Pressure gradient}\\[1em]
Fluid flows in the direction\dots};
\node[right=of e2.north east,anchor=north west] (e3) {\underline{Body force term}\\[1em]
External forces\dots};
\node[right=of e3.north east,anchor=north west] (e4) {\underline{Diffusion term}\\[1em]
For a Newtonian fluid it is equatl to \dots};
\end{scope}
\node[below=0.5ex of e1.south] (eq){$=$};
\node[below=0.5ex of eq] (tot) {$\rho\left[\frac{\partial \vec V}{\partial t}
+\left(\vec V\cdot\vec\nabla\right)\vec V\right]$};
\path (tot.south west) -- (tot.south east) coordinate[pos=0.25] (tot1)
coordinate[pos=0.75] (tot2);
\node[below left=2ex and 0ex of tot.south,text width=4em,align=left] (c1)
{Change of velosity};
\node[below right=2ex and 0ex of tot.south,text width=4em,align=left] (c2) {Convective term};
\draw[cyan,-stealth] (c1) -- (tot1);
\draw[cyan,-stealth] (c2) -- (tot2);
\begin{scope}[overlay]
\foreach \X in {1,...,4}
{\draw[cyan,-stealth] (e\X) -- (n\X);}
\end{scope}
\end{tikzpicture}
\begin{table}
\centering
\begin{tabular}{c c c}
\hline
a&b&c\\
d&e&f\\
\hline
\end{tabular}
\end{table}
\end{document}
并且UTMThesis.sty
是
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The package UTMthesis.sty will produce the output %
% of a thesis according to UTM Thesis Manual, %
% School of Graduate Studies, 2007. %
% Yusof Yaacob, Department of Mathematical Sciences, %
% Faculty of Science, Universiti Teknologi Malaysia %
% 81310 Johor Bahru, Malaysia %
% e-mail: [email protected] %
% 24 December 2009 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% LaTeX cod for chapter header
\makeatletter
\def\@makechapterhead#1{
%\vspace*{20\p@} % \vspace*{15\p@}
{\parindent \z@
\centering
\normalfont
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\normalsize
\bfseries \@chapapp\space \thechapter
\par\nobreak
\vskip 1.4\baselineskip
\fi
\fi
\interlinepenalty\@M
\normalsize
\bfseries #1\par\nobreak
\vskip 1.4\baselineskip %
}}
\def\@schapter#1{\if@twocolumn
\@topnewpage[\@makeschapterhead{#1}]%
\else
\@makeschapterhead{#1}
\@afterheading
\fi}
\def\@makeschapterhead#1{
%\vspace*{20\p@} % \vspace*{20\p@} %
{\parindent \z@
\centering
\normalfont
\interlinepenalty\@M
\normalsize
\bfseries #1\par\nobreak
\vskip 1.4\baselineskip
}}
\makeatother
\renewcommand{\chaptername}{CHAPTER}
%------------------------------------------------------------
% Commands for layout
%\setlength{\topmargin}{-1.2cm}
%\setlength{\oddsidemargin}{1.7cm} %\setlength{\oddsidemargin}{1.46cm}
\setlength{\textwidth}{14.5cm}
\setlength{\textheight}{24.5cm} % \setlength{\textheight}{24.5cm}
%\setlength{\headheight}{2mm}
%\setlength{\headsep}{10.175mm}
%-------------------------------------------------------------
% Command for 1.5 spacing
%\renewcommand{\baselinestretch}{1.5}
\usepackage{doublespace}
\setstretch{1.5}
%-------------------------------------------------------------
% Command for indentation
\setlength\parindent{.5in}
\usepackage{indentfirst} %1st line indented after section...
%-------------------------------------------------------------
% Command for space between paragraph
\makeatletter
%\setlength{\parskip}{1.5\baselineskip \@plus 3ex
% \@minus 2.0ex}
\setlength{\parskip}{2\baselineskip \@plus .01ex
\@minus .01ex}
\makeatother
%-------------------------------------------------------------
% Commands for no hyphenation and right justified
\hyphenpenalty=10000 \sloppy
\raggedbottom
%-------------------------------------------------------------
% Command to get rid of default running head
\pagestyle{myheadings}
%-------------------------------------------------------------
% Command for page number
% \makeatletter
% \renewcommand{\ps@plain}{%
% \renewcommand{\@oddhead}{\hfill\textrm{\thepage}}
% \renewcommand{\@evenhead}{\@oddhead}
% \renewcommand{\@evenfoot}{}
% \renewcommand{\@oddfoot}{} }
% \makeatother
%-----------------------------------------------------------------
%For section font
% \usepackage{sectsty}
% \chapterfont{\centering\normalsize\uppercase}
% \sectionfont{\normalsize\uppercase}
% \subsectionfont{\normalsize}
% \subsubsectionfont{\itshape\normalsize}
%---------------------------------------------------------
%--------------------------------------------------------------
% Commands for REFERENCES name
\renewcommand{\bibname}{REFERENCES}
%--------------------------------------------------------------
% Commands to change vertical space in section and subsection
\makeatletter
\renewcommand{\section}{\@startsection
{section}% % the name
{1} % the level
{0cm} % the indent
{1.0cm} % the beforeskip
{0.01cm} %{0.5cm} % the afterskip
{\normalfont\normalsize\bfseries} } % the style
\renewcommand{\subsection}{\@startsection
{subsection}% % the name
{2} % the leve2
{0cm} % the indent
{1.0cm} % the beforeskip
{0.01cm} %{0.5cm} % the afterskip
{\normalfont\normalsize\bfseries} } % the style
\makeatother
%--------------------------------------------------------------
% Commands to change horizontal space in section and subsection
% for times romans
\renewcommand{\thesection} % space between sect. etc.
{\thechapter.\arabic{section}\hspace{.12in}}
\renewcommand{\thesubsection}
{\thesection\hspace{-.3cm}.\arabic{subsection} \hspace{-.135cm}}
%--------------------------------------------------------------
% Commands for TocLoFT
\usepackage{tocloft}
%\cftsetrmarg{2.75cm} %
\cftsetrmarg{1.5cm} %
\cftsetpnumwidth{1.25cm}
%\cftsetpnumwidth{1.25cm}
\renewcommand{\cftdot}{} % get rid of dots
%Table of Contents
\renewcommand{\contentsname}{} % off tocname
\setlength{\cftchapindent}{.8cm} % chapter indent
\setlength{\cftsecindent}{2.3cm} % section indent
\setlength{\cftsubsecindent}{3.25cm} % subsection indent
\setlength{\cftchapnumwidth}{1.45cm} % chp number width
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \renewcommand{\cftchapafterpnum}{\rule{1.75ex}{0ex}}
% \renewcommand{\cftsecafterpnum}{\rule{1.75ex}{0ex}}
% \renewcommand{\cftsubsecafterpnum}{\rule{1.75ex}{0ex}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\cftchapafterpnum}{\rule{0.75ex}{0ex}}
\renewcommand{\cftsecafterpnum}{\rule{0.75ex}{0ex}}
\renewcommand{\cftsubsecafterpnum}{\rule{0.75ex}{0ex}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\cftchappagefont}{\normalfont}
%-------------------------------------------------------------
%List of Table
\setlength{\cfttabnumwidth}{2.5cm} %\setlength{\cfttabnumwidth}{2.5cm}
\renewcommand{\listtablename}{} % off lotname
%\setlength{\cfttabindent}{-.015cm} % table indent %%%%%%%%%%%%%%%%%%
\setlength{\cfttabindent}{-.1cm} % table indent %%%%%%%%%%%%%%%%%%
\renewcommand{\cfttabafterpnum}{\rule{2ex}{0ex}}
\cftsetrmarg{3cm}
%------------------------------------------------------------
%List of Figure
\setlength{\cftfignumwidth}{2.5cm}
\renewcommand{\listfigurename}{} % off lofname
\setlength{\cftfigindent}{-.1cm} % figure indent %%%%%%%%%%%%%%%%%%
\renewcommand{\cftfigafterpnum}{\rule{2ex}{0ex}}
%-------------------------------------------------------------
%-------------------------------------------------------------
% Command for bold caption
\makeatletter
\long\def\@makecaption#1#2{\vskip 10\p@ % caption parameter
\setbox\@tempboxa\hbox{{#1\,\,\,\,\,} #2} %%%%%
\ifdim \wd\@tempboxa >\hsize % caption parameter
{#1\,\,\,\,\,} #2\par % caption parameter
\else % caption parameter
\hbox to\hsize{\hfil\box\@tempboxa\hfil} % caption parameter
\fi} % caption parameter
\makeatother
\renewcommand{\thefigure}{\arabic{chapter}.\arabic{figure}}
\renewcommand{\thetable}{\arabic{chapter}.\arabic{table}}
%--------------------------------------------------------------
\usepackage{paralist} %refine list item
%--------------------------------------------------------------
\usepackage{latexsym,amsmath,amssymb} % math symbols
%--------------------------------------------------------------
\usepackage{graphicx} % .eps graphic
%--------------------------------------------------------------
\usepackage{lscape} % for landscape
%--------------------------------------------------------------
\usepackage{times}
%--------------------------------------------------------------
% Theorem-Like-Environment
\usepackage{theorem}
{\theorembodyfont{\upshape}
\newtheorem{lemma}{Lemma}[chapter]
\newtheorem{theorem}{\rule{0ex}{5ex}Theorem}[chapter]
\newtheorem{corollary}{Corollary}[chapter]
\newtheorem{proposition}{Proposition}[chapter]
\newtheorem{definition}{\rule{0ex}{5ex}Definition}[chapter]
\newtheorem{example}{Example}[chapter] }
%--------------------------------------------------------
\newenvironment{proof}{\begin{paragraph}
{Proof}\vspace{-1cm}}{\end{paragraph}}
\newenvironment{solution}{\begin{paragraph}
{Solution}\vspace{-1cm}}{\end{paragraph}}
%-----------------------------------------------------------
谁能帮我?
答案1
显然你不相信我,你的代码对我有用。
我如何测试你的代码:
- 所用的是您所提供 MWE 的相关副本。
- 在 MWE 中,
\usepackage{UTMThesis}
使用了其代码,您可以在问题中提供该代码。 - 测试使用 MikTeX 进行,在 Windows 10 机器上更新至 2020.02.18。
完整测试文档:
\documentclass[oneside,12pt,a4paper]{book}
%\usepackage{UTMThesis}%------------------------------------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% The package UTMthesis.sty will produce the output %
% of a thesis according to UTM Thesis Manual, %
% School of Graduate Studies, 2007. %
% Yusof Yaacob, Department of Mathematical Sciences, %
% Faculty of Science, Universiti Teknologi Malaysia %
% 81310 Johor Bahru, Malaysia %
% e-mail: [email protected] %
% 24 December 2009 %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% LaTeX cod for chapter header
\makeatletter
\def\@makechapterhead#1{
%\vspace*{20\p@} % \vspace*{15\p@}
{\parindent \z@
\centering
\normalfont
\ifnum \c@secnumdepth >\m@ne
\if@mainmatter
\normalsize
\bfseries \@chapapp\space \thechapter
\par\nobreak
\vskip 1.4\baselineskip
\fi
\fi
\interlinepenalty\@M
\normalsize
\bfseries #1\par\nobreak
\vskip 1.4\baselineskip %
}}
\def\@schapter#1{\if@twocolumn
\@topnewpage[\@makeschapterhead{#1}]%
\else
\@makeschapterhead{#1}
\@afterheading
\fi}
\def\@makeschapterhead#1{
%\vspace*{20\p@} % \vspace*{20\p@} %
{\parindent \z@
\centering
\normalfont
\interlinepenalty\@M
\normalsize
\bfseries #1\par\nobreak
\vskip 1.4\baselineskip
}}
\makeatother
\renewcommand{\chaptername}{CHAPTER}
%------------------------------------------------------------
% Commands for layout
%\setlength{\topmargin}{-1.2cm}
%\setlength{\oddsidemargin}{1.7cm} %\setlength{\oddsidemargin}{1.46cm}
\setlength{\textwidth}{14.5cm}
\setlength{\textheight}{24.5cm} % \setlength{\textheight}{24.5cm}
%\setlength{\headheight}{2mm}
%\setlength{\headsep}{10.175mm}
%-------------------------------------------------------------
% Command for 1.5 spacing
%\renewcommand{\baselinestretch}{1.5}
%\usepackage{doublespace}
%\setstretch{1.5}
%-------------------------------------------------------------
% Command for indentation
\setlength\parindent{.5in}
\usepackage{indentfirst} %1st line indented after section...
%-------------------------------------------------------------
% Command for space between paragraph
\makeatletter
%\setlength{\parskip}{1.5\baselineskip \@plus 3ex
% \@minus 2.0ex}
\setlength{\parskip}{2\baselineskip \@plus .01ex
\@minus .01ex}
\makeatother
%-------------------------------------------------------------
% Commands for no hyphenation and right justified
\hyphenpenalty=10000 \sloppy
\raggedbottom
%-------------------------------------------------------------
% Command to get rid of default running head
\pagestyle{myheadings}
%-------------------------------------------------------------
% Command for page number
% \makeatletter
% \renewcommand{\ps@plain}{%
% \renewcommand{\@oddhead}{\hfill\textrm{\thepage}}
% \renewcommand{\@evenhead}{\@oddhead}
% \renewcommand{\@evenfoot}{}
% \renewcommand{\@oddfoot}{} }
% \makeatother
%-----------------------------------------------------------------
%For section font
% \usepackage{sectsty}
% \chapterfont{\centering\normalsize\uppercase}
% \sectionfont{\normalsize\uppercase}
% \subsectionfont{\normalsize}
% \subsubsectionfont{\itshape\normalsize}
%---------------------------------------------------------
%--------------------------------------------------------------
% Commands for REFERENCES name
\renewcommand{\bibname}{REFERENCES}
%--------------------------------------------------------------
% Commands to change vertical space in section and subsection
\makeatletter
\renewcommand{\section}{\@startsection
{section}% % the name
{1} % the level
{0cm} % the indent
{1.0cm} % the beforeskip
{0.01cm} %{0.5cm} % the afterskip
{\normalfont\normalsize\bfseries} } % the style
\renewcommand{\subsection}{\@startsection
{subsection}% % the name
{2} % the leve2
{0cm} % the indent
{1.0cm} % the beforeskip
{0.01cm} %{0.5cm} % the afterskip
{\normalfont\normalsize\bfseries} } % the style
\makeatother
%--------------------------------------------------------------
% Commands to change horizontal space in section and subsection
% for times romans
\renewcommand{\thesection} % space between sect. etc.
{\thechapter.\arabic{section}\hspace{.12in}}
\renewcommand{\thesubsection}
{\thesection\hspace{-.3cm}.\arabic{subsection} \hspace{-.135cm}}
%--------------------------------------------------------------
% Commands for TocLoFT
\usepackage{tocloft}
%\cftsetrmarg{2.75cm} %
\cftsetrmarg{1.5cm} %
\cftsetpnumwidth{1.25cm}
%\cftsetpnumwidth{1.25cm}
\renewcommand{\cftdot}{} % get rid of dots
%Table of Contents
\renewcommand{\contentsname}{} % off tocname
\setlength{\cftchapindent}{.8cm} % chapter indent
\setlength{\cftsecindent}{2.3cm} % section indent
\setlength{\cftsubsecindent}{3.25cm} % subsection indent
\setlength{\cftchapnumwidth}{1.45cm} % chp number width
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% \renewcommand{\cftchapafterpnum}{\rule{1.75ex}{0ex}}
% \renewcommand{\cftsecafterpnum}{\rule{1.75ex}{0ex}}
% \renewcommand{\cftsubsecafterpnum}{\rule{1.75ex}{0ex}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\cftchapafterpnum}{\rule{0.75ex}{0ex}}
\renewcommand{\cftsecafterpnum}{\rule{0.75ex}{0ex}}
\renewcommand{\cftsubsecafterpnum}{\rule{0.75ex}{0ex}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\renewcommand{\cftchappagefont}{\normalfont}
%-------------------------------------------------------------
%List of Table
\setlength{\cfttabnumwidth}{2.5cm} %\setlength{\cfttabnumwidth}{2.5cm}
\renewcommand{\listtablename}{} % off lotname
%\setlength{\cfttabindent}{-.015cm} % table indent %%%%%%%%%%%%%%%%%%
\setlength{\cfttabindent}{-.1cm} % table indent %%%%%%%%%%%%%%%%%%
\renewcommand{\cfttabafterpnum}{\rule{2ex}{0ex}}
\cftsetrmarg{3cm}
%------------------------------------------------------------
%List of Figure
\setlength{\cftfignumwidth}{2.5cm}
\renewcommand{\listfigurename}{} % off lofname
\setlength{\cftfigindent}{-.1cm} % figure indent %%%%%%%%%%%%%%%%%%
\renewcommand{\cftfigafterpnum}{\rule{2ex}{0ex}}
%-------------------------------------------------------------
%-------------------------------------------------------------
% Command for bold caption
\makeatletter
\long\def\@makecaption#1#2{\vskip 10\p@ % caption parameter
\setbox\@tempboxa\hbox{{#1\,\,\,\,\,} #2} %%%%%
\ifdim \wd\@tempboxa >\hsize % caption parameter
{#1\,\,\,\,\,} #2\par % caption parameter
\else % caption parameter
\hbox to\hsize{\hfil\box\@tempboxa\hfil} % caption parameter
\fi} % caption parameter
\makeatother
\renewcommand{\thefigure}{\arabic{chapter}.\arabic{figure}}
\renewcommand{\thetable}{\arabic{chapter}.\arabic{table}}
%--------------------------------------------------------------
\usepackage{paralist} %refine list item
%--------------------------------------------------------------
\usepackage{latexsym,amsmath,amssymb} % math symbols
%--------------------------------------------------------------
\usepackage{graphicx} % .eps graphic
%--------------------------------------------------------------
\usepackage{lscape} % for landscape
%--------------------------------------------------------------
\usepackage{times}
%--------------------------------------------------------------
% Theorem-Like-Environment
\usepackage{theorem}
{\theorembodyfont{\upshape}
\newtheorem{lemma}{Lemma}[chapter]
\newtheorem{theorem}{\rule{0ex}{5ex}Theorem}[chapter]
\newtheorem{corollary}{Corollary}[chapter]
\newtheorem{proposition}{Proposition}[chapter]
\newtheorem{definition}{\rule{0ex}{5ex}Definition}[chapter]
\newtheorem{example}{Example}[chapter] }
%--------------------------------------------------------
\newenvironment{proof}{\begin{paragraph}
{Proof}\vspace{-1cm}}{\end{paragraph}}
\newenvironment{solution}{\begin{paragraph}
{Solution}\vspace{-1cm}}{\end{paragraph}}
%-----------------------------------------------------------
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% end of UTMThesis
\usepackage{cite} % change cite from [1,2,3] to [1-3] etc for number system
\makeatletter % change from
\renewcommand{\@biblabel}[1]{#1.} % [1] to 1. etc
\makeatother % in list of references
%----------------------------------------------------------------
\setlength{\voffset}{-2.11cm}
\setlength{\hoffset}{-.4cm}
%---------------------------------------------------------
\setlength{\textwidth}{14.5cm}
\setlength{\textheight}{24.5cm}
%-----------------------------------------------------------
%\pagestyle{plain}
%-------------------------------------------------------
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{}
\chead{}
\rhead{}
\lfoot{}
\cfoot{\vspace{-.35cm}\thepage} %
\renewcommand{\headrulewidth}{0pt}
%----------------own-----------
\usepackage{relsize}
\usepackage{tikz}
\usetikzlibrary{positioning,tikzmark}
%-------------------------------------------------------
\begin{document}
\begingroup\larger[4]
\[
\tikzmarknode{n1}{\rho\frac{D\vec V}{Dt}}~=~\tikzmarknode{n2}{-\nabla p}
+ \tikzmarknode{n3}{\rho\vec g}+\tikzmarknode{n4}{\mu\nabla^2\vec V}\]
\endgroup
\noindent
\begin{tikzpicture}[remember picture,shorten <=1mm,font=\footnotesize\sffamily]
\begin{scope}[nodes={text width=6.5em,align=left},node distance=1ex]
\node (e1) {\underline{Total derivative}};
\node[right=of e1.north east,anchor=north west] (e2) {\underline{Pressure gradient}\\[1em]
Fluid flows in the direction\dots};
\node[right=of e2.north east,anchor=north west] (e3) {\underline{Body force term}\\[1em]
External forces\dots};
\node[right=of e3.north east,anchor=north west] (e4) {\underline{Diffusion term}\\[1em]
For a Newtonian fluid it is equatl to \dots};
\end{scope}
\node[below=0.5ex of e1.south] (eq){$=$};
\node[below=0.5ex of eq] (tot) {$\rho\left[\frac{\partial \vec V}{\partial t}
+\left(\vec V\cdot\vec\nabla\right)\vec V\right]$};
\path (tot.south west) -- (tot.south east) coordinate[pos=0.25] (tot1)
coordinate[pos=0.75] (tot2);
\node[below left=2ex and 0ex of tot.south,text width=4em,align=left] (c1)
{Change of velosity};
\node[below right=2ex and 0ex of tot.south,text width=4em,align=left] (c2) {Convective term};
\draw[cyan,-stealth] (c1) -- (tot1);
\draw[cyan,-stealth] (c2) -- (tot2);
\begin{scope}[overlay]
\foreach \X in {1,...,4}
{\draw[cyan,-stealth] (e\X) -- (n\X);}
\end{scope}
\end{tikzpicture}
\begin{table}
\centering
\begin{tabular}{c c c}
\hline
a&b&c\\
d&e&f\\
\hline
\end{tabular}
\end{table}
\end{document}
我编译了两次,得到以下结果:
没有任何警告,错误,也没有崩溃。
你如何确认我的结果:
- 将上述文档复制到您的编辑器中并以某个名称保存。
- 编译两次。
- 如果你没有得到和我一样的结果,那么你的 LaTeX 安装就有些混乱了。再检查一下!如果你也有 MikTeX,并且它以管理员和用户格式安装,你需要升级两者(参见维护和更新 miktex 安装)。
- 如果您对我的文档进行编译,但您的文档仍然存在您所报告的相同问题,那么您的文档隐藏了一些未包含在有问题的文档中的内容。
你可以做什么:
- 编写新的、简单的 MWE,如下所示:
\documentclass[oneside,12pt,a4paper]{book}
\usepackage{tikz}
\usetikzlibrary{positioning,tikzmark}
\begin{document}
\[
\tikzmarknode{n1}{\rho\frac{D\vec V}{Dt}}~=~\tikzmarknode{n2}{-\nabla p}
+ \tikzmarknode{n3}{\rho\vec g}+\tikzmarknode{n4}{\mu\nabla^2\vec V}
\]
\noindent
\begin{tikzpicture}[remember picture,shorten <=1mm,font=\footnotesize\sffamily]
\begin{scope}[nodes={text width=6.5em,align=left},node distance=1ex]
\node (e1) {\underline{Total derivative}};
\node[right=of e1.north east,anchor=north west] (e2) {\underline{Pressure gradient}\\[1em]
Fluid flows in the direction\dots};
\node[right=of e2.north east,anchor=north west] (e3) {\underline{Body force term}\\[1em]
External forces\dots};
\node[right=of e3.north east,anchor=north west] (e4) {\underline{Diffusion term}\\[1em]
For a Newtonian fluid it is equatl to \dots};
\end{scope}
\node[below=0.5ex of e1.south] (eq){$=$};
\node[below=0.5ex of eq] (tot) {$\rho\left[\frac{\partial \vec V}{\partial t}
+\left(\vec V\cdot\vec\nabla\right)\vec V\right]$};
\path (tot.south west) -- (tot.south east) coordinate[pos=0.25] (tot1)
coordinate[pos=0.75] (tot2);
\node[below left=2ex and 0ex of tot.south,text width=4em,align=left] (c1)
{Change of velosity};
\node[below right=2ex and 0ex of tot.south,text width=4em,align=left] (c2) {Convective term};
\draw[cyan,-stealth] (c1) -- (tot1);
\draw[cyan,-stealth] (c2) -- (tot2);
\begin{scope}[overlay]
\foreach \X in {1,...,4}
{\draw[cyan,-stealth] (e\X) -- (n\X);}
\end{scope}
\end{tikzpicture}
\begin{table}
\centering
\begin{tabular}{c c c}
\hline
a&b&c\\
d&e&f\\
\hline
\end{tabular}
\end{table}
\end{document}
- 测试它是否有效。对我来说,它有效,并且应该给出与上面显示的类似结果(仅在等式的字体大小上有所不同)。
- 如果测试失败,则说明您的 LaTeX 安装存在问题。
- 如果测试有效,则添加
UTMThesis
。- 如果仍然有效,请继续逐步添加其他包,看看该测试文档是否仍然有效。
- 如果没有,请检查此包的内容(如果它与你在问题中显示的相同)以及你的电脑中是否只存在此包的一个版本
- 继续此过程并添加小块文档代码。
结论 您在问题中提供的代码有效。它不包含问题的原因。原因隐藏在您的文档或 LaTeX 安装中的其他地方。