字幕问题

字幕问题

我遇到了这个图的标题的一个恼人的问题:

\documentclass[11pt,a4paper]{article}

\usepackage[utf8]{inputenc}

\usepackage[T1]{fontenc}

\usepackage{fix-cm,relsize}

\usepackage[sort&compress,numbers]{natbib}

\usepackage{amsmath,kbordermatrix,amsthm,amssymb,subfigure,mathrsfs,rotating,array,graphicx,url,booktabs, multirow,eurosym,color}

\usepackage[shortlabels]{enumitem}

\usepackage{boldline}

\usepackage[thinlines]{easytable}

\usepackage{makecell}

\setdescription{style=multiline,topsep=10pt,leftmargin=2.1cm,font=\normalfont}

\usepackage[font=footnotesize,labelfont=bf,singlelinecheck=false]{caption}

\usepackage[a4paper, includeheadfoot, left=2cm,right=2cm,top=1cm,bottom=1cm,headheight=0cm]{geometry}

\usepackage[pdftex,pdfstartview=FitBH,bookmarks=true,bookmarksnumbered=true]{hyperref}

\usepackage{pdflscape}

\begin{document}

\renewcommand{\kbldelim}{(}% Left delimiter

\renewcommand{\kbrdelim}{)}% Right delimiter

    \begin{figure}[!b]
      \centering
      \parbox{5cm}{
        \begin{eqnarray*}
              \kbordermatrix{
                & t_1 & t_2 & t_3 & t_4 & t_5 \\
                t_1 & 0 & 2 & 3 & 3 & 2 \\
                t_2 & 2 & 0 & 2 & 2 & 3 \\
                t_3 & 3 & 2 & 0 & 2 & 3 \\
                t_4 & 3 & 2 & 2 & 0 & 2 \\
                t_5 & 2 & 3 & 3 & 2 & 0
              }
        \end{eqnarray*}
        }
        \quad
        \begin{minipage}{5cm}
            \centering
               \begin{tabular}{|c|ccc|}
                 \hline
                 Taxon & \multicolumn{3}{c|}{\small{Sequence}} \\
                 \hline
                 $t_1$ & A     & A     & A \\%& \ldots\\
                 $t_2$ & A     & C     & C \\%& \ldots\\
                 $t_3$ & C     & G     & C \\%& \ldots\\
                 $t_4$ & C     & C     & G \\%& \ldots\\
                 $t_5$ & G     & A     & G \\%& \ldots\\
                 \hline
               \end{tabular}
        \end{minipage}
        \caption{The Balanced Minimum Evolution Model (BMEM) is an alternative example of a phylogenetic estimation model that can be described as an optimization problem. The BMEM arises from the distance methods and, as for the MPM, it represents a phylogeny of a given set $\Gamma$ of taxa as an UBT having $\Gamma$ as leaf-set. The BMEM assumes the existence of a measure of dissimilarity (or \emph{distance}) $d_{ij}$ for each pair of distinct taxa $i,j\in\Gamma$. When the observed heritable traits are molecular sequences, such a measure can be computed by using, e.g., one of the nucleotide substitution models described in \citep{Daniele1, FelsenBook, HKY, Lanave, JC, Kimura,  Rodri, Waddell, Beyer,Kidd,Fitch03, Galtier01, Huelsen05, Lopez,Kidd}. As an example, if we would just use the Hamming distance to measure the dissimilarity among the molecular sequences shown in Figure~\protect\ref{Figure02}, we would obtain the symmetric distance matrix shown on the left of this figure. Based on this information, the BMEM states that the phylogeny of a given set $\Gamma$ of taxa can be computed by solving the following combinatorial optimization problem:
        \[
          \protect\min_{T\in \mathcal{T} } \; \displaystyle \sum_{\substack{i,j\in\Gamma\\i\neq j}} \frac{d_{ij}}{2^{\tau_{ij}}}
        \]
        where $\mathcal{T}$ represents the set of the $(2n-5)!!$ possible phylogenies of $\Gamma$ \citep{FelsenBook,Daniele10} and the \emph{path-length} (or \emph{topological distance}) $\tau_{ij}$ represents the number of edges belonging to the (unique) path from taxon $i$ to taxon $j$ in a phylogeny $T\in\mathcal{T}$ \citep{Pauplin,GascuelBook,Daniele11}. The optimal solution to this optimization problem when considering the above distance matrix is shown on the right of this figure.}\label{Figure03}
    \end{figure}


\end{document}

具体来说,latex 写道,存在以下错误:

/Users/darkstar/Dropbox/Ricerca/Progetti/2017/2017 - 01 - ERC/A - Latex sources/ERCB2.tex:125: Argument of \caption@ydblarg has an extra
}. [...ix is shown on the right of this figure.}]
/Users/darkstar/Dropbox/Ricerca/Progetti/2017/2017 - 01 - ERC/A - Latex sources/ERCB2.tex:125: Paragraph ended before \caption@ydblarg
was complete. [...ix is shown on the right of this figure.}]
/Users/darkstar/Dropbox/Ricerca/Progetti/2017/2017 - 01 - ERC/A - Latex sources/ERCB2.tex:125: Missing $ inserted. [...ix is shown on
the right of this figure.}]
/Users/darkstar/Dropbox/Ricerca/Progetti/2017/2017 - 01 - ERC/A - Latex sources/ERCB2.tex:125: Missing $ inserted. [...ix is shown on
the right of this figure.}]

但是,所有 $ 和 } 都是正确的!问题出在哪里?

答案1

请始终发布重现错误的完整文档,但在标准类中\caption设置为水平模式来测量其宽度,这将导致显示数学收缩等\[失败。

caption禁用该功能的最简单的方法是使用

singlelinecheck=false

运行没有错误

\documentclass[11pt,a4paper]{article}

\usepackage[utf8]{inputenc}

\usepackage[T1]{fontenc}

\usepackage{fix-cm,relsize}

\usepackage[sort&compress,numbers]{natbib}

\usepackage{amsmath,kbordermatrix,amsthm,amssymb,subfigure,mathrsfs,rotating,array,graphicx,url,booktabs, multirow,eurosym,color}

\usepackage[shortlabels]{enumitem}

\usepackage{boldline}

\usepackage[thinlines]{easytable}

\usepackage{makecell}

\setdescription{style=multiline,topsep=10pt,leftmargin=2.1cm,font=\normalfont}

\usepackage[font=footnotesize,labelfont=bf,singlelinecheck=false]{caption}

\usepackage[a4paper, includeheadfoot, left=2cm,right=2cm,top=1cm,bottom=1cm,headheight=0cm]{geometry}

\usepackage[pdftex,pdfstartview=FitBH,bookmarks=true,bookmarksnumbered=true]{hyperref}

\usepackage{pdflscape}

\begin{document}

\renewcommand{\kbldelim}{(}% Left delimiter

\renewcommand{\kbrdelim}{)}% Right delimiter

    \begin{figure}[!b]
      \centering
      \parbox{5cm}{
        \[
              \kbordermatrix{
                & t_1 & t_2 & t_3 & t_4 & t_5 \\
                t_1 & 0 & 2 & 3 & 3 & 2 \\
                t_2 & 2 & 0 & 2 & 2 & 3 \\
                t_3 & 3 & 2 & 0 & 2 & 3 \\
                t_4 & 3 & 2 & 2 & 0 & 2 \\
                t_5 & 2 & 3 & 3 & 2 & 0
              }
        \]
        }
        \quad
        \begin{minipage}{5cm}
            \centering
               \begin{tabular}{|c|ccc|}
                 \hline
                 Taxon & \multicolumn{3}{c|}{\small{Sequence}} \\
                 \hline
                 $t_1$ & A     & A     & A \\%& \ldots\\
                 $t_2$ & A     & C     & C \\%& \ldots\\
                 $t_3$ & C     & G     & C \\%& \ldots\\
                 $t_4$ & C     & C     & G \\%& \ldots\\
                 $t_5$ & G     & A     & G \\%& \ldots\\
                 \hline
               \end{tabular}
        \end{minipage}
        \caption[The Balanced Minimum Evolution Model]{The Balanced Minimum Evolution Model (BMEM) is an alternative example of a phylogenetic estimation model that can be described as an optimization problem. The BMEM arises from the distance methods and, as for the MPM, it represents a phylogeny of a given set $\Gamma$ of taxa as an UBT having $\Gamma$ as leaf-set. The BMEM assumes the existence of a measure of dissimilarity (or \emph{distance}) $d_{ij}$ for each pair of distinct taxa $i,j\in\Gamma$. When the observed heritable traits are molecular sequences, such a measure can be computed by using, e.g., one of the nucleotide substitution models described in \citep{Daniele1, FelsenBook, HKY, Lanave, JC, Kimura,  Rodri, Waddell, Beyer,Kidd,Fitch03, Galtier01, Huelsen05, Lopez,Kidd}. As an example, if we would just use the Hamming distance to measure the dissimilarity among the molecular sequences shown in Figure~\protect\ref{Figure02}, we would obtain the symmetric distance matrix shown on the left of this figure. Based on this information, the BMEM states that the phylogeny of a given set $\Gamma$ of taxa can be computed by solving the following combinatorial optimization problem:
        \[
          \min_{T\in \mathcal{T} } \;  \sum_{\substack{i,j\in\Gamma\\i\neq j}} \frac{d_{ij}}{2^{\tau_{ij}}}
        \]
        where $\mathcal{T}$ represents the set of the $(2n-5)!!$ possible phylogenies of $\Gamma$ \citep{FelsenBook,Daniele10} and the \emph{path-length} (or \emph{topological distance}) $\tau_{ij}$ represents the number of edges belonging to the (unique) path from taxon $i$ to taxon $j$ in a phylogeny $T\in\mathcal{T}$ \citep{Pauplin,GascuelBook,Daniele11}. The optimal solution to this optimization problem when considering the above distance matrix is shown on the right of this figure.}\label{Figure03}
    \end{figure}


\end{document}

答案2

我认为在 的参数中包含多行显示(包括显示方程式)没有任何理由\caption。简短的标题,例如,

\caption{Balanced Minimum Evolution Model (BMEM)}

对读者来说几乎更有帮助。其余材料可以排版为普通图例。以这种方式简化标题还可以摆脱这两个\protect语句,并自动摆脱您遇到的错误消息。

另外,不要使用eqnarray*。一个简单的\[ ...\]构造就足够了。

\documentclass[demo]{article} % remove 'demo' option in real doc.
\usepackage{graphicx,natbib,amsmath,kbordermatrix}
\begin{document}

\begin{figure}[!b]
\begin{minipage}{5cm}
\[
      \kbordermatrix{
        & t_1 & t_2 & t_3 & t_4 & t_5 \\
        t_1 & 0 & 2 & 3 & 3 & 2 \\
        t_2 & 2 & 0 & 2 & 2 & 3 \\
        t_3 & 3 & 2 & 0 & 2 & 3 \\
        t_4 & 3 & 2 & 2 & 0 & 2 \\
        t_5 & 2 & 3 & 3 & 2 & 0
      }
\]
\end{minipage}
\quad
\begin{minipage}{5cm}
    \centering
    \includegraphics[scale=0.5]{Fig03-SolutionBME}
\end{minipage}
\caption{Balanced Minimum Evolution Model (BMEM)} \label{Figure03}

\bigskip
The Balanced Minimum Evolution Model (BMEM) is an alternative example of a phylogenetic estimation model that can be described as an optimization problem. The BMEM arises from the distance methods and, as for the MPM, it represents a phylogeny of a given set~$\Gamma$ of taxa as an UBT having $\Gamma$ as leaf-set. The BMEM assumes the existence of a measure of dissimilarity (or \emph{distance}) $d_{ij}$ for each pair of distinct taxa~$i,j\in\Gamma$. When the observed heritable traits are molecular sequences, such a measure can be computed by using, e.g., one of the nucleotide substitution models described in \citep{Daniele1, FelsenBook, HKY, Lanave, JC, Kimura,  Rodri, Waddell, Beyer, Kidd, Fitch03, Galtier01, Huelsen05, Lopez, Kidd}. As an example, if we would just use the Hamming distance to measure the dissimilarity among the molecular sequences shown in Figure~\ref{Figure02}, we would obtain the symmetric distance matrix shown on the left of this figure. Based on this information, the BMEM states that the phylogeny of a given set~$\Gamma$ of taxa can be computed by solving the following combinatorial optimization problem:
\[
    \min_{T\in\mathcal{T}} 
    \sum_{\substack{i,j\in\Gamma \\ i\neq j}}
    \frac{d_{ij}}{2^{\tau_{ij}}}
\]
where $\mathcal{T}$ represents the set of the $(2n-5)!!$ possible phylogenies of~$\Gamma$ \citep{FelsenBook,Daniele10} and the \emph{path-length} (or \emph{topological distance}) $\tau_{ij}$ represents the number of edges belonging to the (unique) path from taxon~$i$ to taxon~$j$ in a phylogeny $T\in\mathcal{T}$ \citep{Pauplin, GascuelBook, Daniele11}. The optimal solution to this optimization problem when considering the above distance matrix is shown on the right of this figure.
\end{figure}
\end{document} 

相关内容