1

I am facing a problem with my LaTeX code. I receive the error message \begin{table} on input line XXX ended by \end{document}. But, I have no idea what went wrong as I actually have \end{table} in my code.

Any help?

Here's the code:

\begin{document}

\begin{table}[H]
\centering
\begin{tabular}{||c c c c c||}
...
\end{tabular}
\caption{YYY}
\label{table 7}
\end{table}

\end{document}

The used packages are the following:

\documentclass[fleqn,12pt,a4paper]{article}%leqno,fleqn,  
\usepackage[utf8]{inputenc}  
\usepackage{graphicx}  
\usepackage{array}  
\usepackage[T1]{fontenc}  
%\usepackage[ngerman]{babel}  
%\usepackage{german}  
%\usepackage{emlines}  
%\usepackage{amssymb}  
\pagestyle{myheadings}\setlength{\parindent}{0em} \sloppy  
\mathindent10mm  
\usepackage{xurl}

%packages for the table footnotes
\usepackage{footnote}
\makesavenoteenv{tabular}
\makesavenoteenv{table}
\usepackage{scrextend}

\usepackage{hyperref}

\usepackage{float}

\usepackage{color}
\usepackage{amsmath}
\usepackage{pdflscape}

\usepackage{graphicx}
\usepackage{graphics}
\usepackage{array}
\usepackage{xcolor}

\usepackage{hyperref}

\usepackage[
backend=biber,
style=apa
]{biblatex}

%\usepackage{german}
%\usepackage{emlines}
%\usepackage{amssymb}
\pagestyle{myheadings}
\setlength{\parindent}{0em}
\sloppy
\mathindent10mm

\graphicspath{ {./Images/} }

%\oddsidemargin+25mm
%\topmargin-5mm
%\textwidth145mm
%\textheight245mm
%\footskip20mm
%\renewcommand{\baselinestretch}{1.5}

Vincent
  • 20,157
Tal
  • 21
  • 4
    Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for the users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. – samcarter_is_at_topanswers.xyz Jan 21 '23 at 17:24

1 Answers1

2

You get this error because you can't use the H option with \makesavenoteenv{table}. There are other questions on this site about this, like this one or this one. If I take your code and remove the line

\makesavenoteenv{table}

from the preamble, the document compiles.

Now, do you really need (or even want) this line? It would be a good idea to make sure that you know what each line of the preamble is supposed to do, and something tells me you haven't been careful about that. For example:

  • You load graphicx, array and hyperref twice,
  • You load both graphicx and graphics and both color and xcolor, while in both cases you should really only use one of them.

Understanding what each line of the preamble is doing might certainly save you some trouble later.

Vincent
  • 20,157