5
\documentclass{article}
\usepackage[letterpaper]{geometry}  
\usepackage[utf8]{inputenc}
\usepackage{blindtext}
\usepackage[spanish]{babel} 
\usepackage{tabularx}
\usepackage{array}
\usepackage{adjustbox}
\usepackage{mathtools}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{multirow}
 \usepackage{caption}
\graphicspath{ {images/} }
\special{papersize=8.5in,11in}
\usepackage{float}
\usepackage{multicol}
\usepackage[caption = false]{subfig}
\usepackage{geometry}

\begin{table}[h!]
\centering
\begin{tabular}{|c c|}
\hline
    Parameter & Intensity [mW] \\ 
 \hline \hline 
 $I_0(0,0)$ & $0.23$ \\
 \hline
 $I_0(0,0)$ & $0.23$ \\
 \hline
 $I_0(0,0)$ & $0.23$ \\
 \hline
 $I_0(0,0)$ & $0.23$ \\
 \hline
 $I_0(0,0)$ & $0.23$ \\
 \hline
 $I_0(0,0)$ & $0.23$ \\
 \hline
\end{tabular}
    \caption{Intensidades}
    \label{intSt}
 \end{table}

When I remove \begin{table} & \end{table} the tables does appear, however I cant add \caption or \label. Does anyone knows how to make the table appear with \begin{table} & \end{table}?

11
  • 2
    Welcome to TeX.SE! The table is there on my machine after adding \begin{document} and \end{document}.
    – user121799
    Commented Feb 19, 2018 at 3:41
  • I got the same results as @marmot - are you sure it's disappeared and not moved?
    – Au101
    Commented Feb 19, 2018 at 3:42
  • 100% sure, I use \ref{insSt} somewhere else and it appears as: '??', just as if the table didnt exists
    – Ivan
    Commented Feb 19, 2018 at 3:45
  • I also began a new documment and it works, very stange!
    – Ivan
    Commented Feb 19, 2018 at 3:48
  • 2
    If you put a table inside a multicols environment the .log file will tell you that Package multicol Warning: Floats and marginpars not allowed inside 'multicols' environment!. Commented Feb 19, 2018 at 8:06

2 Answers 2

2

I am unable to replicate the problem you describe once I add the instructions \begin{document} and \end{document} to your code. I can only assume (and hope...) that the table which you're actually trying to typeset different from the "dummy" table you posted.

At any rate, I'd make an effort to improve the intelligibility of the table, say, by omitting all \hline directives and, instead, loading the booktabs package and drawing far fewer, but well-spaced lines. Switching from a tabular to an array environment would improve the readability of the code, by allowing a serious reduction in the number of $ symbols used throughout the table.

enter image description here

\documentclass{article}
\usepackage[letterpaper]{geometry}  
\usepackage[utf8]{inputenc}
\usepackage{blindtext} % do you really need this?
\usepackage[spanish]{babel} 
\usepackage{tabularx}
%%\usepackage{array} % is loaded automatically by 'tabularx'
\usepackage{adjustbox} % do you reall need this package?
\usepackage{mathtools}
\usepackage{graphicx}
\usepackage{caption}
\usepackage{multirow}
%%\usepackage{caption}
\graphicspath{ {images/} }
%%\special{papersize=8.5in,11in}
\usepackage{float}
\usepackage{multicol}
%%\usepackage[caption = false]{subfig}
%%\usepackage{geometry}
\usepackage{booktabs} % <-- new
\begin{document}

\begin{table}[h!]
\centering
$\begin{array}{@{}cc@{}}
  \toprule
  $Parameter$ & $Intensity [mW]$ \\ 
  \midrule 
  I_0(0,0) & 0.23 \\
  I_1(0,0) & 0.23 \\
  I_2(0,0) & 0.23 \\[0.75ex] 
  I_4(0,0) & 0.23 \\ 
  I_4(0,0) & 0.23 \\ 
  I_5(0,0) & 0.23 \\
  \bottomrule
\end{array}$
\caption{Intensidades}\label{intSt}
 \end{table}

\end{document}
4
  • 1
    so far i didn't see the use $Parameter$ & $Intensity [mW]$ \\ for making Parameter and Intensity [mW] normal text. is this somewehere described?
    – Zarko
    Commented Feb 19, 2018 at 9:57
  • @Zarko - Since I'm using an array environments, the contents of a c-type column is in math mode by default. Writing $Parameter$ exits math mode at the start and re-enters it at the end of the cell. Another way to achieve the objective of rendering "Parameter" in text mode would be to input it as \mbox{Parameter} -- 5 keystrokes more than $Parameter$...
    – Mico
    Commented Feb 19, 2018 at 10:19
  • thank you very much. i suspect this, but i was not sure, if this is allowed. good to know :-)
    – Zarko
    Commented Feb 19, 2018 at 10:31
  • @Zarko: Ah... I will remove my comment then.
    – user31729
    Commented Feb 19, 2018 at 14:00
1

fixed using:

    \begin{wraptable}{l}{0.7\linewidth}
    \centering
    \begin{tabular}{|c | c|}
    \hline
    Parámetros & Intensidades [mW] \\ 
    \hline  
    $I(0,0)$ & $0.23$ \\
     $I(\frac{\pi}{4},0)$ & $0.25$ \\
     $I(\frac{\pi}{2},0)$ & $0.27$ \\
     $I(\frac{3\pi}{4},0)$ & $0.26$ \\
     $I(\frac{\pi}{4},\frac{\pi}{2})$ & $0.23$ \\
     $I(\frac{3\pi}{4},\frac{\pi}{2})$ & $0.23$ \\
     \hline
    \end{tabular}
         \caption{Intensidades}
          \label{intSt}
\end{wraptable}
1
  • 2
    how is your answer related to your question? please first make your code example in question as well in answer compilable.
    – Zarko
    Commented Feb 19, 2018 at 4:22

You must log in to answer this question.

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