计数器过大,但不应出现此错误

计数器过大,但不应出现此错误

我的 Latex 文档突然停止编译,并无缘无故地出现“!LaTeX 错误:计数器太大。”错误。它之前编译过,包含相同数量的图形和子图形,但即使删除了自上次编译以来添加的内容,它仍然无法正常工作。

我知道通常是什么原因导致此错误 => 当为超过 26 个子图添加标题时,它会用尽字母来标记子图并引发此错误。这不是我的情况。我最大的图只有 8 个子图,所以我不知道为什么它不起作用。

这是我的代码的一部分(之前还有更多图):

\documentclass[11pt, oneside]{Thesis} % The default font size and one-sided printing (no margin offsets)

\graphicspath{{./Pictures/}} % Specifies the directory where pictures are stored

\usepackage[T1]{fontenc}
\usepackage{mathtools}  % loads »amsmath«
\usepackage{amsmath}
\usepackage{physics}
\usepackage{float}

\usepackage{tabularx}
\usepackage{adjustbox}
\usepackage[english]{babel}
\usepackage[table]{xcolor}
\usepackage{tabularx}
%\usepackage{showframe} % for demo
\usepackage{lmodern}
\usepackage{microtype}
\usepackage{ragged2e}
\usepackage{lua-visual-debug}

\usepackage{placeins}
\usepackage{multirow}
\usepackage{graphicx} 
\usepackage{caption} 
\usepackage{subcaption}
\usepackage[square, numbers, comma, sort&compress]{natbib} 

\usepackage{booktabs}
%\usepackage[table,xcdraw]{xcolor}

\hypersetup{urlcolor=blue, colorlinks=true} % Colors hyperlinks in blue - change to black if annoying
\title{\ttitle} % Defines the thesis title - don't touch this

\begin{document}

\FloatBarrier
\section{Influence of solid exits}
%compare 5wg and 6wg. REG and SIDE sections, velocity vectors, turbulence, velocity contours?, ... Explain "vortex air-wall" in both, and why it's a clear advantage in 6wg.

\begin{table}[h]
\centering
\hspace*{-2cm}\makebox[\linewidth][c]{%
\begin{tabularx}{1.4\textwidth}{c*{2}{>{\centering\arraybackslash}X}@{}}
&   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{SE_5wg_REG_VV}
        \caption{In-plane velocity vectors [m/s] - 5-wheels geometry}
        \medskip
    \end{subfigure}
&   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{SE_6wg_REG_VV}
        \caption{In-plane velocity vectors [m/s]] - 6-wheels geometry}
        \medskip
    \end{subfigure}     \\
&   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{SE_5wg_REG_VVz}
        \caption{In-plane velocity vectors [m/s] - 5-wheels geometry close-up}
        \medskip
    \end{subfigure}
&   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{SE_6wg_REG_VVz}
        \caption{In-plane velocity vectors [m/s] - 6-wheels geometry close-up}
        \medskip
    \end{subfigure}  \\
&   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{SE_5wg_REG_TANz}
        \caption{Tangential velocity contours [m/s] - 5-wheels geometry close-up}
        \medskip
    \end{subfigure}
&   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{SE_6wg_REG_TANz}
        \caption{Tangential velocity contours [m/s] - 6-wheels geometry close-up}
        \medskip
    \end{subfigure}  \\
    &   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{SE_5wg_REG_TURBz}
        \caption{Subgrid turbulent viscosity ratio [kg/m.s] - 5-wheels geometry close-up}
        \medskip
    \end{subfigure}
&   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{SE_6wg_REG_TURBz}
        \caption{Subgrid turbulent viscosity ratio [kg/m.s] - 6-wheels geometry close-up}
        \medskip
    \end{subfigure}  \\
\end{tabularx}}
\caption{Influence of the solid exits: 5-wheels geometry (left) and 6-wheels geometry (right)}
\label{solid_exits}
\end{table}


\FloatBarrier
\section{Influence of chimneys}
%Chimneys as turbulence creators?
%Chimney diameter? => central reflux! show in both 5wg and 6wg!
%Possible solution => conic chimneys, show with 6wg.

\begin{table}[h]
\centering
\hspace*{-2cm}\makebox[\linewidth][c]{%
\begin{tabularx}{1.4\textwidth}{c*{2}{>{\centering\arraybackslash}X}@{}}
&   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{CH_5wg_REG_VV}
        \caption{In-plane velocity vectors [m/s] - 5-wheels geometry}
        \medskip
    \end{subfigure}
&   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{CH_6wg_REG_VV}
        \caption{In-plane velocity vectors [m/s]] - 6-wheels geometry}
        \medskip
    \end{subfigure}     \\
&   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{CH_5wg_REG_VVz2}
        \caption{In-plane velocity vectors [m/s] - 5-wheels geometry close-up}
        \medskip
    \end{subfigure}
&   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{CH_6wg_REG_VVz2}
        \caption{In-plane velocity vectors [m/s] - 6-wheels geometry close-up}
        \medskip
    \end{subfigure}  \\
&   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{CH_5wg_REG_AXIz}
        \caption{Axial velocity contours [m/s] - 5-wheels geometry close-up}
        \medskip
    \end{subfigure}
&   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{CH_6wg_REG_AXIz}
        \caption{Axial velocity contours [m/s] - 6-wheels geometry close-up}
        \medskip
    \end{subfigure}  \\
    &   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{CH_5wg_REG_TURBz2}
        \caption{Subgrid turbulent viscosity ratio [kg/m.s] - 5-wheels geometry close-up}
        \medskip
    \end{subfigure}
&   \begin{subfigure}{\hsize} 
        \includegraphics[width=\hsize]{CH_6wg_REG_TURBz2}
        \caption{Subgrid turbulent viscosity ratio [kg/m.s] - 6-wheels geometry close-up}
        \medskip
    \end{subfigure}  \\
\end{tabularx}}
\caption{Influence of the chimneys: 5-wheels geometry (left) and 6-wheels geometry (right)}
\label{chimneys}
\end{table}

\end{document}

我知道我没有使用最直接的方法来创建表格,我本可以使用迷你页面来显示我的子图。但如果可能的话,我希望保留这些“带有子图的表格”原样(如果需要修复问题,可以进行微小的更改)。

答案1

如果我删除,我不会收到任何错误,并且子图编号也会重置tabularx,这可能是问题的原因。

您根本就不需要它来设置多个子图。

我也改为Thesisbook,因为不可能知道您正在加载什么类。

\PassOptionsToPackage{demo}{graphicx} % just for this example
\documentclass[11pt, oneside]{book} % The default font size and one-sided printing (no margin offsets)

\usepackage[T1]{fontenc}
\usepackage{mathtools}  % loads »amsmath«
\usepackage{amsmath}
\usepackage{physics}
\usepackage{float}

\usepackage{adjustbox}
\usepackage[english]{babel}
\usepackage[table]{xcolor}
%\usepackage{showframe} % for demo
\usepackage{lmodern}
\usepackage{microtype}
\usepackage{ragged2e}
\usepackage{lua-visual-debug}

\usepackage{placeins}
\usepackage{multirow}
\usepackage{graphicx} 
\usepackage{caption} 
\usepackage{subcaption}
\usepackage[square, numbers, comma, sort&compress]{natbib} 

\usepackage{booktabs}
%\usepackage[table,xcdraw]{xcolor}
\usepackage{hyperref}

\hypersetup{urlcolor=blue, colorlinks=true} % Colors hyperlinks in blue - change to black if annoying

\graphicspath{{./Pictures/}} % Specifies the directory where pictures are stored

\title{\ttitle} % Defines the thesis title - don't touch this

\begin{document}

\FloatBarrier
\section{Influence of solid exits}
%compare 5wg and 6wg. REG and SIDE sections, velocity vectors, turbulence, velocity contours?, ... Explain "vortex air-wall" in both, and why it's a clear advantage in 6wg.

\begin{table}[htp]
\centering
\makebox[\columnwidth][c]{%
  \begin{minipage}{1.4\linewidth}
  \centering
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{SE_5wg_REG_VV}
        \caption{In-plane velocity vectors [m/s] - 5-wheels geometry}
        \medskip
    \end{subfigure}\hfill
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{SE_6wg_REG_VV}
        \caption{In-plane velocity vectors [m/s]] - 6-wheels geometry}
        \medskip
    \end{subfigure}     \\
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{SE_5wg_REG_VVz}
        \caption{In-plane velocity vectors [m/s] - 5-wheels geometry close-up}
        \medskip
    \end{subfigure}\hfill
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{SE_6wg_REG_VVz}
        \caption{In-plane velocity vectors [m/s] - 6-wheels geometry close-up}
        \medskip
    \end{subfigure}  \\
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{SE_5wg_REG_TANz}
        \caption{Tangential velocity contours [m/s] - 5-wheels geometry close-up}
        \medskip
    \end{subfigure}\hfill
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{SE_6wg_REG_TANz}
        \caption{Tangential velocity contours [m/s] - 6-wheels geometry close-up}
        \medskip
    \end{subfigure}  \\
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{SE_5wg_REG_TURBz}
        \caption{Subgrid turbulent viscosity ratio [kg/m.s] - 5-wheels geometry close-up}
        \medskip
    \end{subfigure}\hfill
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{SE_6wg_REG_TURBz}
        \caption{Subgrid turbulent viscosity ratio [kg/m.s] - 6-wheels geometry close-up}
        \medskip
    \end{subfigure}  \\
  \end{minipage}}
\caption{Influence of the solid exits: 5-wheels geometry (left) and 6-wheels geometry (right)}
\label{solid_exits}
\end{table}


\FloatBarrier\clearpage
\section{Influence of chimneys}
%Chimneys as turbulence creators?
%Chimney diameter? => central reflux! show in both 5wg and 6wg!
%Possible solution => conic chimneys, show with 6wg.

\begin{table}[htp]
\centering
\makebox[\textwidth][c]{%
  \begin{minipage}{1.4\textwidth}
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{CH_5wg_REG_VV}
        \caption{In-plane velocity vectors [m/s] - 5-wheels geometry}
        \medskip
    \end{subfigure}
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{CH_6wg_REG_VV}
        \caption{In-plane velocity vectors [m/s]] - 6-wheels geometry}
        \medskip
    \end{subfigure}     \\
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{CH_5wg_REG_VVz2}
        \caption{In-plane velocity vectors [m/s] - 5-wheels geometry close-up}
        \medskip
    \end{subfigure}
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{CH_6wg_REG_VVz2}
        \caption{In-plane velocity vectors [m/s] - 6-wheels geometry close-up}
        \medskip
    \end{subfigure}  \\
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{CH_5wg_REG_AXIz}
        \caption{Axial velocity contours [m/s] - 5-wheels geometry close-up}
        \medskip
    \end{subfigure}
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{CH_6wg_REG_AXIz}
        \caption{Axial velocity contours [m/s] - 6-wheels geometry close-up}
        \medskip
    \end{subfigure}  \\
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{CH_5wg_REG_TURBz2}
        \caption{Subgrid turbulent viscosity ratio [kg/m.s] - 5-wheels geometry close-up}
        \medskip
    \end{subfigure}
    \begin{subfigure}[t]{.49\textwidth} 
        \includegraphics[width=\textwidth,height=2cm]{CH_6wg_REG_TURBz2}
        \caption{Subgrid turbulent viscosity ratio [kg/m.s] - 6-wheels geometry close-up}
        \medskip
    \end{subfigure}  \\
  \end{minipage}}
\caption{Influence of the chimneys: 5-wheels geometry (left) and 6-wheels geometry (right)}
\label{chimneys}
\end{table}

\end{document}

在示例中,我使用了height=2cm以避免浮点数过大。

在此处输入图片描述

答案2

正如 @egreg 发现的,问题的根源是tabularx如果你使用tabular它,一切都会按预期进行。请参阅下面的代码。

为了使图形与文本宽度一样宽,我建议您使用changepage包。我将此选项包含到我的 MWE 中:

\documentclass[11pt,oneside]{book}%{Thesis} % The default font size and one-sided printing
%\usepackage{showframe} % for demo

%\graphicspath{{./Pictures/}} % Specifies the directory where pictures are stored
    \usepackage{lmodern}
    \usepackage[T1]{fontenc}
    \usepackage{microtype}
    \usepackage[square, numbers, comma, sort&compress]{natbib}
    \usepackage[english]{babel}

    \usepackage[strict]{changepage}
    \usepackage{lipsum}

    \usepackage{mathtools}  % loads »amsmath«
    \usepackage{amsmath}
%\usepackage{physics}

    \usepackage{tabularx}
    \usepackage{multirow}
    \usepackage{booktabs}
    \usepackage[table]{xcolor}
%    \usepackage{adjustbox}

    \usepackage{ragged2e}
%    \usepackage{lua-visual-debug}

    \usepackage{float}
    \usepackage{placeins}
    \usepackage{graphicx}
    \usepackage{caption}
    \usepackage{subcaption}

    \usepackage{hyperref}
\hypersetup{urlcolor=blue,colorlinks=true} % Colors hyperlinks in blue - change to black if annoying
%\title{\ttitle} % Defines the thesis title - don't touch this

\begin{document}

\FloatBarrier
\section{Influence of solid exits}
%compare 5wg and 6wg. REG and SIDE sections, velocity vectors, turbulence, velocity contours?, ... Explain "vortex air-wall" in both, and why it's a clear advantage in 6wg.

\begin{table}[hbt]
\begin{adjustwidth*}{-21mm}{}
\begin{tabular}{@{}>{\raggedright\arraybackslash}p{0.49\linewidth}
                   >{\raggedleft \arraybackslash}p{0.49\linewidth}@{}}   
   \begin{subfigure}{\hsize}
    \includegraphics[width=\hsize,height=17mm]{example-image}
    \caption{In-plane velocity vectors [m/s] - 5-wheels geometry}
    \medskip
\end{subfigure}
&      \begin{subfigure}{\hsize}
        \includegraphics[width=\hsize,height=17mm]{example-image}
        \caption{In-plane velocity vectors [m/s]] - 6-wheels geometry}
        \medskip
    \end{subfigure}     \\
   \begin{subfigure}{\hsize}
        \includegraphics[width=\hsize,height=17mm]{example-image}
        \caption{In-plane velocity vectors [m/s] - 5-wheels geometry close-up}
        \medskip
    \end{subfigure}
&   \begin{subfigure}{\hsize}
        \includegraphics[width=\hsize,height=17mm]{example-image}
        \caption{In-plane velocity vectors [m/s] - 6-wheels geometry close-up}
        \medskip
    \end{subfigure}  \\
   \begin{subfigure}{\hsize}
        \includegraphics[width=\hsize,height=17mm]{example-image}
        \caption{Tangential velocity contours [m/s] - 5-wheels geometry close-up}
        \medskip
    \end{subfigure}
&   \begin{subfigure}{\hsize}
        \includegraphics[width=\hsize,height=17mm]{example-image}
        \caption{Tangential velocity contours [m/s] - 6-wheels geometry close-up}
        \medskip
    \end{subfigure}  \\
   \begin{subfigure}{\hsize}
        \includegraphics[width=\hsize,height=17mm]{example-image}
        \caption{Subgrid turbulent viscosity ratio [kg/m.s] - 5-wheels geometry close-up}
        \medskip
    \end{subfigure}
&   \begin{subfigure}{\hsize}
        \includegraphics[width=\hsize,height=17mm]{example-image}
        \caption{Subgrid turbulent viscosity ratio [kg/m.s] - 6-wheels geometry close-up}
        \medskip
    \end{subfigure}  
\end{tabular}
\end{adjustwidth*}
\caption{Influence of the solid exits: 5-wheels geometry (left) and 6-wheels geometry (right)}
\label{solid_exits}
\end{table}

    \lipsum[1]

\FloatBarrier
\section{Influence of chimneys}
%Chimneys as turbulence creators?
%Chimney diameter? => central reflux! show in both 5wg and 6wg!
%Possible solution => conic chimneys, show with 6wg.

\begin{table}[h]
\begin{adjustwidth*}{-21mm}{}
\begin{tabular}{@{}>{\raggedright\arraybackslash}p{0.49\linewidth}
                   >{\raggedleft \arraybackslash}p{0.49\linewidth}@{}}
        \begin{subfigure}{\hsize}
            \includegraphics[width=\hsize,height=17mm]{example-image}
            \caption{In-plane velocity vectors [m/s] - 5-wheels geometry}
            \medskip
        \end{subfigure}
&   \begin{subfigure}{\hsize}
        \includegraphics[width=\hsize,height=17mm]{example-image}
        \caption{In-plane velocity vectors [m/s]] - 6-wheels geometry}
        \medskip
    \end{subfigure}     \\
\begin{subfigure}{\hsize}
    \includegraphics[width=\hsize,height=17mm]{example-image}
    \caption{In-plane velocity vectors [m/s] - 5-wheels geometry close-up}
    \medskip
\end{subfigure}
&   \begin{subfigure}{\hsize}
        \includegraphics[width=\hsize,height=17mm]{example-image}
        \caption{In-plane velocity vectors [m/s] - 6-wheels geometry close-up}
        \medskip
    \end{subfigure}  \\
\begin{subfigure}{\hsize}
    \includegraphics[width=\hsize,height=17mm]{example-image}
    \caption{Axial velocity contours [m/s] - 5-wheels geometry close-up}
    \medskip
\end{subfigure}
&   \begin{subfigure}{\hsize}
        \includegraphics[width=\hsize,height=17mm]{example-image}
        \caption{Axial velocity contours [m/s] - 6-wheels geometry close-up}
        \medskip
    \end{subfigure}  \\
   \begin{subfigure}{\hsize}
    \includegraphics[width=\hsize,height=17mm]{example-image}
    \caption{Subgrid turbulent viscosity ratio [kg/m.s] - 5-wheels geometry close-up}
    \medskip
\end{subfigure}
&   \begin{subfigure}{\hsize}
        \includegraphics[width=\hsize,height=17mm]{example-image}
        \caption{Subgrid turbulent viscosity ratio [kg/m.s] - 6-wheels geometry close-up}
        \medskip
    \end{subfigure}
\end{tabular}
\caption{Influence of the chimneys: 5-wheels geometry (left) and 6-wheels geometry (right)}
\label{chimneys}
\end{adjustwidth*}
\end{table}
    \end{document}

Thesis我使用而不是book。我确信使用Thesis会改变下图。

在此处输入图片描述

相关内容