表の前後のスペースが消える

表の前後のスペースが消える

ボックスの前後のスペースに問題がありますtabular。テーブルに 1 行しかない場合は、すべて問題ありません。

\documentclass{article}
\usepackage{setspace}

\begin{document}
\doublespacing
Some text.

\begin{tabular}{|l|}
\hline
Some text.\\
\hline
\end{tabular}

Some text.
\end{document}

1行

しかし、新しい行を追加すると、表の前後の間隔が消えてしまいます。

\begin{tabular}{|l|}
\hline
Some text.\\ \hline
Some text.\\
\hline
\end{tabular}

2列

これを修正するにはどうすればいいでしょうか?

答え1

flushleftまたは が気に入らない場合はcenter、 を使用できます\vspace

\documentclass{article}
\usepackage{setspace}

\begin{document}
    \doublespacing
    \noindent I think the best solution is with \texttt{flushleft} (or \texttt{center}) environment:

    \begin{flushleft}
        \begin{tabular}{|l|}
            \hline
            Some text.\\
            \hline
            Some text.\\
            \hline
        \end{tabular}
    \end{flushleft}
    Some text.

    \noindent However, you could use \textbackslash\texttt{vspace*} and set any spacing you want:\vspace*{.1\baselineskip}

    \noindent
    \begin{tabular}{|l|}
        \hline
        Some text.\\
        \hline
        Some text.\\
        \hline
    \end{tabular}\vspace*{.2\baselineskip}  

    \noindent Some text.
\end{document}

ここに画像の説明を入力してください

関連情報