0

Everything is normal, until I inserted a table in Appendix as

\documentclass[a4paper,12pt]{article}
    \makeatletter
    \let\@fnsymbol\@arabic
    \makeatother
\usepackage{geometry}
 \geometry{
 left=20mm,
 top=20mm,
 bottom=40mm
 }
\usepackage{amsmath}
\usepackage{mathtools}

\DeclarePairedDelimiter\abs{\lvert}{\rvert}%
\DeclarePairedDelimiter\norm{\lVert}{\rVert}%

\makeatletter
\newenvironment{mcases}[1][l]
 {\let\@ifnextchar\new@ifnextchar
  \left\lbrace
  \def\arraystretch{1.2}%
  \array{@{}l@{\quad}#1@{}}}
 {\endarray\right.}
\makeatother

% Swap the definition of \abs* and \norm*, so that \abs
% and \norm resizes the size of the brackets, and the 
% starred version does not.
\makeatletter
\let\oldabs\abs
\def\abs{\@ifstar{\oldabs}{\oldabs*}}
%
\let\oldnorm\norm
\def\norm{\@ifstar{\oldnorm}{\oldnorm*}}
\makeatother
\usepackage{stackrel}
\usepackage{lmodern}
\usepackage{mathrsfs}
\usepackage{graphicx}
\usepackage{setspace}
\usepackage{natbib}
\usepackage{arydshln}
\usepackage{fixmath}
\usepackage{subcaption}
\usepackage{caption}
\usepackage{longtable}
\usepackage{answers}
\usepackage{enumerate}
\usepackage[T1]{fontenc}
\doublespacing
\usepackage[utf8]{inputenc}
\usepackage[titletoc,title]{appendix}
\usepackage{bm}
\usepackage{multirow}
\usepackage{cleveref}
\usepackage{algorithmic}
\usepackage[ruled, vlined, linesnumbered]{algorithm2e}
\usepackage[affil-it]{authblk}
\usepackage{float}
\renewcommand\Authfont{\fontsize{12}{14.4}\selectfont}
\renewcommand\Affilfont{\fontsize{9}{10.8}\itshape} 
\topmargin 0.0cm
\oddsidemargin 0.2cm
\textwidth 16cm 
\textheight 21cm
\footskip 1.0cm
\setlength{\affilsep}{0em}
\begin{document}
XXXXX




\begin{appendices}
\section{XX1}
xxxxxx
\section{XX2}
\begin{table}[ht]
\caption{some caption}
\begin{subtable}{.5\linewidth}
\caption{some caption}
\centering
\begin{tabular}{c c c}
\hline
$\hat{\tau}$ & $\hat{P}(\hat{\tau}|\bm{D})$ & $r_{T,\tau}$\\
\hline
$\ast\tau$& 0.998& 1\\
\hline
\end{tabular}
\end{subtable}%
\begin{subtable}{.5\linewidth}
\caption{some caption}
\centering
\begin{tabular}{c c c}
\hline
$\hat{\tau}$ & $\hat{P}(\hat{\tau}|\bm{D})$ & $r_{T,\tau}$\\
\hline
$\ast\tau$&0.992& 0.998\\
\hline
\end{tabular}
\end{subtable}
\end{table}
\normalsize\doublespace
\small \singlespace
\end{appendices}
\end{document}

When I remove the table, everything is normal. The table is copied from the previous place of the file, and it works normally there. What is the problem with this table?

1 Answer 1

1

If you remove the lines \normalsize\doublespace \small \singlespace it will compile correctly. They have really no sense in this context.

8
  • Thanks, it works. Why the lines caused the problem? I used the lines outside Appendix environment to control the distance.
    – Bs He
    Commented Jan 24, 2018 at 20:18
  • If you want to add space, you should use \vspace. You should accept the answer if it solved your problem :)
    – bmv
    Commented Jan 24, 2018 at 20:20
  • 2
    You're right about the fact that the removed lines are not really useful but you missed the explanation: doublespace is an environment, not an 'ordinary' macro, so the compilation fails because \enddoublespace or better: \end{doublespace} is never called, the same is true for `\singlespace
    – user31729
    Commented Jan 24, 2018 at 20:31
  • @ChristianHupfer then why \singlespace does not cause troubles out side Appendix environment?
    – Bs He
    Commented Jan 24, 2018 at 20:32
  • @Christian Hupfer Thank you for giving this important explanation.
    – bmv
    Commented Jan 24, 2018 at 20:34

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .