0

i need to remove this vertical space from the text and the table. Here are a screen of the results that i want to change enter image description here

See the space between the word "sono" and the table, it's too much and i want it to get closer to the table. I will also add the script:

\uppercase{è} stato inoltre effettuato  il calcolo dei  valori della funzione Quantile Loss per i due modelli, i risultati sono:

\begin{table}[H]
    \centering
    \begin{tabular}{|c|c|c|c|}
        \hline

I've tried different solutions like \vspace{-0.5em} or \vspace*{-\baselineskip} or \vfill but this didn't change anything. Can you help me?

EDIT 1: I was trying to do a whole new document to answer some of your question, while doing that i found out that if i add only a portion of the whole work i don't have the issue, i don't know why. I didn't change a single line of code,Any idea now? I add screen of the new results enter image description here

8
  • Welcome to TeX.SX!
    – cabohah
    Commented Sep 19, 2023 at 16:37
  • 1
    The primary function of [H] format is to cause large gaps in your document. Forcing the table to follow immediately is a side effect ;-) Commented Sep 19, 2023 at 18:53
  • 1
    [H] certainly do not help to reduce document gaps, but your chunk of code completed with the minimum to obtain a compilable code do not show that problem. Our divination skills end here. We need see a whole document where we can reproduce the issue, but obviously short. Remove everything in your working document as long as it does not prevent the compilation and will not change that gap. Then replace your minimal required text with dummy text (very easy with the help of the lipsum package, search examples in this site) and post the whole document.
    – Fran
    Commented Sep 19, 2023 at 21:56
  • 1
    What follows the table? If it is something that won't fit on the page, so it goes to the next page, that is a very frequent reason for excess space above a float positioned [H], and it usually can't be fixed just by tinkering with the spacing. We don't have enough information to give an informed or useful answer. Commented Sep 20, 2023 at 3:03
  • \uppercase{è}? Are you really sure? Why not È? If your editor or keyboard doesn't allow to type it, change them. Anyway, please, provide a full compilable example showing the issue.
    – egreg
    Commented Sep 20, 2023 at 8:59

1 Answer 1

-1

I suspect the table environment is messing with the spacing. Without seeing all the code, I would suggest removing the \begin{table} \centering. I would then put the remaining \begin{tabular} ... \end{tabular} inside a \begin{center} ... \end{center}. That way you would have more control over the vertical spacing.

So something like

\uppercase{è} stato inoltre effettuato il calcolo dei valori della funzione Quantile Loss per i due modelli, i risultati sono:

\begin{center} \begin{tabular}{|c|c|c|c|} \hline ... \end{tabular} \end{center}

Hope this helps.

2
  • Thank you so much for your help, this helped with the spacing but now i cant give a name to the table, is there a way to mix the solutions?
    – marco
    Commented Sep 22, 2023 at 19:28
  • Hy, can you see the update and help me ?
    – marco
    Commented Sep 23, 2023 at 14:51

You must log in to answer this question.

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