如何将浮动文本及其标题的中心与前一段文本的中心对齐?

如何将浮动文本及其标题的中心与前一段文本的中心对齐?

我不知道我是否用标题正确地解释了自己,但我希望能够将浮点数和它的标题置于中心,就像在enumerate(或类似)环境中使用方程式时将其置于中心一样。

我现在有的是:

\documentclass[12pt]{report}

\usepackage{mypreamble}

\title{My Style for \LaTeX\ Documents}
\author{Andrés Moreno}
\date{28 de marzo de 2022}

\doublespacing
\begin{document}
    
    \maketitle

    \section*{Blah, blah, blah...}
        Blah, blah, blah...

    \section*{Blah, blah, blah...}
        Blah, blah, blah...

        \begin{enumerate}
            \item Blah, blah, blah...
                \begin{enumerate}
                    \item $f(x) = \dfrac{x^2 + 3}{x - 1}$
                    
                        El dominio de una función se define como el conjunto de todos los $x$ que generen una imagen $y$. Además, dividir entre $0$ no está definido. Por lo tanto, el dominio de $f$ será el conjunto de los $x$ que al meterlos en $f$ esté definido. Lo anterior es lo mismo que decir que $x - 1$ no puede ser $0$, por lo que $x - 1 = 0 \rightarrow x = 1$ es el número que no pertenece al dominio de $f$.
                        \begin{equation*}
                            \text{Dom}(f): \{x\ |\ x \in (-\infty, 1) \cup (1, \infty)\}
                        \end{equation*}
                        \begin{table}[H]
                            \centering
                            \begin{tabular}{ |c|c| }
                                \hline
                                $x$ & $f(x)$ \\
                                \hline
                                $-1.5$ & $-2.1 $ \\
                                \hline
                                $-0.5$ & $-2.1\overline{6}$ \\
                                \hline
                                $0.5$ & $-6.5$ \\
                                \hline
                                $1.5$ & $10.5$ \\
                                \hline
                                $2.5$ & $6.1\overline{6}$ \\
                                \hline
                                $3.5$ & $6.1$ \\
                                \hline
                            \end{tabular}
                            \caption{Esta tabla}
                        \end{table}
                \end{enumerate}
        \end{enumerate}
\end{document}

编译结果为:

我的结果

如果我没记错的话,表格前后留出的空间大小是相同的。但可以看出,表格并没有像方程那样居中。

我怎样才能实现它?

顺便说一下,mypreamble.sty 是:

% !TeX root = main.tex

% For project modularity. For example \import{tex/}{test}, and this would import a test.tex file.
\usepackage[subpreambles=true]{standalone}
\usepackage{import}

% To modify the dimentions of the document.
\usepackage[a4paper, margin=1in]{geometry}

% To change the main font used in the document.
\usepackage[no-math]{fontspec}
\setmainfont{STIX Two Text}

% To change the math font used in the document.
\usepackage[math-style=ISO]{unicode-math}
\setmathfont{STIX Two Math}

% To change the language of the document.
\usepackage[spanish]{babel}

% Typographic and hyphenation goodness
\usepackage[babel=true, final]{microtype}

% Bibliography management.
\usepackage{biblatex}

% For testing the whole thing before.
% \usepackage{blindtext}

% For easy quotes
\usepackage{csquotes}

%%% Math related goodness

% The best thing in history
\usepackage{amsmath}

% For improving the derivative package.
\usepackage{mleftright}

% For writing partial and ordinary derivatives in a straight forward manner.
% \odv{} (ordinary), \pdv{} (partial), \mdv{} (material, with the D), \fdv{} (functional, with the delta and not Delta), \adv{} (average rate of change, with Delta), \jdv{} (jacobian).
\usepackage{derivative}

% To be able to use singlespace in equations. This fixes some things in math mode. {\siglespacing ...} or with \begin{singlespace}
\usepackage{setspace}

%%% Other components of the document

% Support for images.
\usepackage{graphicx}
\graphicspath{images/}

% Support for exact placement of figures [H]
\usepackage{float}

% Support for multiple columns.
\usepackage{multicol}

% To be able to define the position of a caption.
% To be able to use captions outside of a float you need: \captionsetup{type=<type of float>}. For example \captionsetup{type=table or figure, etc...}
\usepackage[font=footnotesize, center]{caption}


%%%% Custom functions

相关内容