试图阻止表格移动到两列中的下一列

试图阻止表格移动到两列中的下一列

决定开始学习 LaTeX,为秋季的研究生学习做准备。我正在尝试创建一个包含两列的文档,其中两列内有表格。经过大量搜索,我解决了问题,前三个表格运行正常。对前三个表格使用相同的代码,但将表格更改为两列表格而不是四列表格,会导致表格移到右列,即使左列仍有足够的空间。表格也不太宽。如果您能提供任何建议,让最后两个表格出现在左列而不是右列,我将不胜感激。

\documentclass[letterpaper, twocolumn, 11pt]{article}

\usepackage[left=.25in,top=.25in,right=.25in,nohead,nofoot]{geometry}

\usepackage[compact]{titlesec}
\titlespacing{\section}{0pt}{*0}{*0}

\setlength{\columnsep}{0.5 in}
\setlength{\voffset}{-0.75in}
\setlength{\parskip}{0pt}
\setlength{\parsep}{0pt}
\setlength{\headsep}{0pt}
\setlength{\topskip}{0pt}
\setlength{\topmargin}{0pt}
\setlength{\topsep}{0pt}
\setlength{\partopsep}{0pt}

\begin{document}

    \begin{flushleft}

        \large{\textbf{Useful relations}}

    \end{flushleft}

    \begin{table}[h]

        \centering

        \begin{tabular}{@{}p{0.9in} p{1in} p{0.4in} p{0.9in}@{}}
            \multicolumn{4}{l}{At 298.15 K} \\
            $RT$ & $2.4790\,kJmol^{-1}$ & $RT/F$ & $25.693 mV$ \\ 
            $(RT/F)\,ln\,10$ & $59.160\,mV$ & $kT/hc$ & $207.225\,cm^{-1}$ \\ 
            $kT/e$ & $25.693\,meV$ & $V_m^\Theta$ & $2.4790x10^{-2}$ \newline $m^3mol^{-1}$ \newline $24.790\,dm^3mol^{-1}$

        \end{tabular}

    \end{table}

    \begin{flushleft}

        \large{\textbf{Selected units}}

    \end{flushleft}

    \begin{table}[h]

        \centering

        \begin{tabular}{@{}p{0.4in} p{1.3in} p{0.4in} p{1.3in}@{}}

            1 N & $1\,kg\,m\,s^{-2}$ & 1 J & $1\,kg\,m^{-2}\,s^{-2}$ \\
            1 Pa & $1\,kg\,m^{-1}\,s^{-2}$ & 1 W & $1\,J\,s^{-1}$ \\
            1 V & $1\,J\,C^{-1}$ & 1 A & $1\,C\,s^{-1}$ \\
            1 T & $1\,kg\,s^{-2}\,A^{-1}$ & 1 P & $10^{-1}\,kg\,m^{-1}\,s^{-1}$ \\
            1 S & $1\,\Omega^{-1} = 1\,A\,V^{-1}$

        \end{tabular}

    \end{table}

    \begin{flushleft}

        \large{\textbf{Conversion factors}}

    \end{flushleft}

    \begin{table}[h]

        \centering

        \begin{tabular}{@{}p{0.4in} p{1.3in} p{0.4in} p{1.3in}@{}}


            \multicolumn{4}{l}{$\theta/^{\circ} C = T/K-273.15^{\circ}$} \\
            1 eV & $1.602177x10^{-19}\,J$ \newline $96.485\,kJ\,mol^{-1}$ \newline $8065.5 cm^{-1}$ & 1 cal & 4.184 J \\
            1 atm & $101.325* k\,Pa$ \newline $760* Torr$ & $1\,cm^{-1}$ & $1.9864x10^{-23}\,J$ \\
            1 D & $3.33564x10^{-30}\,C\,m$ & 1 \AA{} & $10^{-10}\,m*$ \\
            \multicolumn{4}{l}{\tiny{* Exact value}}

        \end{tabular}

    \end{table}

    \begin{flushleft}

        \large{\textbf{Mathematical relations}}

    \end{flushleft}

    \begin{table}[h]

        \centering

        \begin{tabular}{@{}p{1.7in} p{1.7in}@{}}

            $\pi = 3.14159265359\,...$ & $\textit{e} = 2.71828182846\,...$

        \end{tabular}

    \end{table}

    \begin{flushleft}

        \large{\textbf{Logarithms and exponentials}}

    \end{flushleft}

    \begin{table}[h]

        \centering

        \begin{tabular}{@{}p{1.7in} p{1.7in}@{}}

            $ln\,x+ln\,y+\,...\,=ln\,xy$ & $ln\,x-ln\,y\,=\,ln\,(x/y)$ \\
            $a\,ln\,x\,=\,ln\,x^a$ & $ln\,x\,=\,(ln\,10)\,log\,x$ \newline $=(2.302585\,...)\,log\,x$ \\
            $\textit{e}^x\textit{e}^y\textit{e}^z\,...\,=\textit{e}^{x+y+z+\,...}$ & $\textit{e}^x/\textit{e}^y\,=\,\textit{e}^{x-y}$ \\
            $(\textit{e}^x)^a\,=\,\textit{e}^{ax}$ & $\textit{e}^{\pm\textit{i}x}\,=\,cos\,x\,\pm\,\textit{i}\,sin\,x$

        \end{tabular}

    \end{table}

\end{document}

答案1

这是一个开始。这需要更多,但我没时间了。如果其他人也这么做,请发表评论,我会删除此答案。

待办事项:对对齐的数学内容使用适当的环境(amsmath);正确处理单位(siunitx);检查\textit数学模式中的残留滥用,并在数学代码完成后根据需要重新插入间距调整;通过调整宽度修复 7 个过满框警告。

\documentclass[letterpaper, twocolumn, 11pt]{article}

\usepackage[left=.25in,top=.25in,right=.25in,nohead,nofoot]{geometry}

\usepackage[compact]{titlesec}
\titlespacing{\section}{0pt}{*0}{*0}

% this is downright sneaky and mean: you load geometry and tell it what you want, but all the while you are deceiving it and next thing you know, you're going behind its back and saying something totally different! if using geometry, the following should all be handled by geometry
% \setlength{\voffset}{-0.75in}% do you really want this? this should be used to allow for a binding or something, I think
% \setlength{\headsep}{0pt}
% \setlength{\topskip}{0pt}
% \setlength{\topmargin}{0pt}% this will give you a top margin of .75" and not .25"
% \setlength{\topsep}{0pt}

\setlength{\columnsep}{0.5 in}
% hmmm ... so you want to provide no indication whatsoever when you start a new paragraph? hope I'm not one of your target readership!
\setlength{\parskip}{0pt}
\setlength{\parsep}{0pt}
% why?!
\setlength{\partopsep}{0pt}

% \setlength\columnseprule{.4pt}% visualise columns

\begin{document}

%   \begin{flushleft}% these look like sub-headings - use \section{} or \section*{} or whatever - or captions - use \caption{} within the float
%     
%     \large\textbf{Useful relations}% \large is a switch - it does not take an argument
%     
%   \end{flushleft}

\subsection*{Useful relations}

\begin{center}% never give h as the sole specifier for a float - it will get changed anyway, as it makes no sense to give this
  \begin{tabular}{@{}p{0.9in} p{1in} p{0.4in} p{0.9in}@{}}

    \multicolumn{4}{l}{At 298.15 K} \\
    $RT$ & $2.4790 kJmol^{-1}$ & $RT/F$ & $25.693 mV$ \\ 
    $(RT/F) ln 10$ & $59.160 mV$ & $kT/hc$ & $207.225 cm^{-1}$ \\ 
    $kT/e$ & $25.693 meV$ & $V_m^\Theta$ & $2.4790x10^{-2}$ \newline $m^3mol^{-1}$ \newline $24.790 dm^3mol^{-1}$

  \end{tabular}
\end{center}

\subsection*{Selected units}

\begin{center}
  \begin{tabular}{@{}p{0.4in} p{1.3in} p{0.4in} p{1.3in}@{}}

    1 N & $1 kg m s^{-2}$ & 1 J & $1 kg m^{-2} s^{-2}$ \\
    1 Pa & $1 kg m^{-1} s^{-2}$ & 1 W & $1 J s^{-1}$ \\
    1 V & $1 J C^{-1}$ & 1 A & $1 C s^{-1}$ \\
    1 T & $1 kg s^{-2} A^{-1}$ & 1 P & $10^{-1} kg m^{-1} s^{-1}$ \\
    1 S & $1 \Omega^{-1} = 1 A V^{-1}$

  \end{tabular}
\end{center}

\subsection*{Conversion factors}

\begin{center}
  \begin{tabular}{@{}p{0.4in} p{1.3in} p{0.4in} p{1.3in}@{}}

    \multicolumn{4}{l}{$\theta/^{\circ} C = T/K-273.15^{\circ}$} \\
    1 eV & $1.602177x10^{-19} J$ \newline $96.485 kJ mol^{-1}$ \newline $8065.5 cm^{-1}$ & 1 cal & 4.184 J \\
    1 atm & $101.325* k Pa$ \newline $760* Torr$ & $1 cm^{-1}$ & $1.9864x10^{-23} J$ \\
    1 D & $3.33564x10^{-30} C m$ & 1 \AA{} & $10^{-10} m*$ \\
    \multicolumn{4}{l}{\tiny{* Exact value}}

  \end{tabular}
\end{center}

\subsection*{Mathematical relations}

\begin{center}
  \begin{tabular}{@{}p{1.7in} p{1.7in}@{}}

    $\pi = 3.14159265359 \dots $ & $e = 2.71828182846 \dots $

  \end{tabular}
\end{center}

\subsection*{Logarithms and exponentials}

\begin{center}
  \begin{tabular}{@{}p{1.7in} p{1.7in}@{}}

    $\ln x+\ln y+ \dots  =\ln xy$ & $\ln x-\ln y = \ln (x/y)$ \\
    $a \ln x = \ln x^a$ & $\ln x = (\ln 10) \log x$ \newline $=(2.302585 \dots ) \log x$ \\
    $e ^xe ^ye ^z \dots  =e ^{x+y+z+ \dots }$ & $e ^x/e ^y = e ^{x-y}$ \\
    $(e ^x)^a = e ^{ax}$ & $e ^{\pm i x} = \cos x \pm i \sin x$

  \end{tabular}
\end{center}

\end{document}

表格在原始格式中移动,因为左侧列中没有足够的垂直空间。浮动元素浮动。您不希望它们在此处浮动,因此不要使用浮动元素。子标题应如此标记。运算符等应正确标记以获得正确的格式和一致的间距。siunitx可用于处理单位。amsmath将允许您放弃tabular使用专用的数学环境,从而消除无休止重复的美元符号。

\large是一个开关。它不接受参数。

当前状态

答案2

这是最新版本,看起来不错。但如果没有最后两个表格中的 [h!],我就无法做到这一点。

\documentclass[twocolumn, 10pt]{article}

\usepackage[left=.25in,top=.25in,right=.25in,nohead,nofoot]{geometry}
\usepackage{amsmath}
\usepackage{siunitx}

\pagenumbering{gobble}

\begin{document}

    \section*{Useful relations}

    \begin{table}[h]

    \centering

    \begin{tabular}{@{}p{.8in} p{1in} p{0.4in} p{1.2in}@{}}

        \multicolumn{4}{l}{At 298.15 K} \\
        \textit{RT} & \si{2.4790.kJ.mol^{-1}} & $RT/F$ & \si{25.693.{mV}} \\ 
        (\textit{RT/F}) ln 10 & 59.160 mV & \textit{kT/hc} & \si{207.225.cm^{-1}} \\ 
        \textit{kT/e} & 25.693 meV & $V_m^\Theta$ & $2.4790x10^{-2}$ \newline \si{m^3.mol^{-1}} \newline 24.790 \si{dm^3.mol^{-1}}

    \end{tabular}

    \end{table}

    \section*{Selected units}

    \begin{table}[h]

        \centering

        \begin{tabular}{@{}p{0.5in} p{1.2in} p{0.5in} p{1.2in}@{}}

            1 N & \si{1.kg.m.s^{-2}} & 1 J & \si{1.kg.m^{-2}.s^{-2}} \\
            1 Pa & \si{1.kg.m^{-1}.s^{-2}} & 1 W & \si{1.J.s^{-1}} \\
            1 V & \si{1.J.C^{-1}} & 1 A & \si{1.C.s^{-1}} \\
            1 T & \si{1.kg.s^{-2}.A^{-1}} & 1 P & \si{10^{-1}.kg.m^{-1}.s^{-1}} \\
            1 S & \si{1.\Omega^{-1} = 1.A.V^{-1}}

        \end{tabular}

    \end{table}

    \section*{Conversion factors}

    \begin{table}[h]

        \centering

        \begin{tabular}{@{}p{0.5in} p{1.2in} p{0.5in} p{1.2in}@{}}

            \multicolumn{4}{l}{\si{\theta/^{\circ}C = \textit{T}/K-273.15^*}} \\
            1 eV & \si{1.602177x10^{-19}.J} \newline \si{96.485.kJ.mol^{-1}} \newline \si{8065.5.cm^{-1}} & 1 cal & \si{4.184.J} \\
            1 atm & \si{101.325^*.kPa} \newline \si{760^*.Torr} & \si{1.cm^{-1}} & \si{1.9864x10^{-23}.J} \\
            1 D & $3.33564x10^{-30}\,C\,m$ & 1 \AA{} & $10^{-10}\,m^*$ \\
            \multicolumn{4}{l}{* Exact value}

        \end{tabular}

    \end{table}

    \section*{Mathematical relations}

    \begin{table}[h!]

        \centering

        \begin{tabular}{@{}p{1.7in} p{1.7in}@{}}

            \si{\pi = 3.14159265359\ldots} & \si{e = 2.71828182846\ldots}

        \end{tabular}

    \end{table}

    \section*{Logarithms and exponentials}

    \begin{table}[h!]

        \centering

        \begin{tabular}{@{}p{1.7in} p{1.7in}@{}}

            \si{ln.x+ln.y+\ldots=ln.xy\ldots} & \si{ln.x-ln.y=ln(x/y)} \\
            \si{a.ln.x=ln.x^a} & \si{ln.x=(ln.10).log.x} \newline \si{=(2.302585\ldots).log.x} \\
            \si{e^x.e^y.e^z\ldots=e^{x+y+z+\ldots}} & \si{e^x/e^y=e^{x-y}} \\
            \si{(e^x)^a=e^{ax}} & \si{e^{\pm\textit{i}x}=cos.x.\pm.\textit{i}.sin.x}

        \end{tabular}

    \end{table}

    \newpage

\end{document}

答案3

只是为了完整性,以防有人遇到同样的挑战并发现这个问题,下面是该文档的完整功能和代码,其中没有使用浮点数来将表格保存在两列文档中。

\documentclass[twocolumn, 10pt]{article}

\usepackage[left=.25in,top=.25in,right=.25in,nohead,nofoot]{geometry}
\usepackage{amsfonts, amsmath, amssymb}
\usepackage{siunitx}

\pagenumbering{gobble}

\setlength\extrarowheight{6pt}

\begin{document}

    \section*{Useful relations}

    At 298.15 K

    \vspace{-1em}

    \begin{flushleft}

    \begin{tabular}{@{}p{.8in} p{1in} p{0.4in} p{1.2in}@{}}

        \textit{RT} & 2.4790\si{.kJ.mol^{-1}} & $RT/F$ & 25.693\si{.{mV}} \\ 
        (\textit{RT/F})ln 10 & 59.160 mV & \textit{kT/hc} & 207.225\si{.cm^{-1}} \\ 
        \textit{kT/e} & 25.693 meV & $V_m^\Theta$ & $2.4790\times10^{-2}$ \newline \si{m^3.mol^{-1}} \newline 24.790 \si{dm^3.mol^{-1}}

    \end{tabular}

    \end{flushleft}

    \vspace{-2em}

    \section*{Selected units}

    \begin{flushleft}

        \begin{tabular}{@{}p{0.5in} p{1.2in} p{0.5in} p{1.2in}@{}}

            1 N & 1\si{.kg.m.s^{-2}} & 1 J & 1\si{.kg.m^{-2}.s^{-2}} \\
            1 Pa & 1\si{.kg.m^{-1}.s^{-2}} & 1 W & 1\si{.J.s^{-1}} \\
            1 V & 1\si{.J.C^{-1}} & 1 A & 1\si{.C.s^{-1}} \\
            1 T & 1\si{.kg.s^{-2}.A^{-1}} & 1 P & $10^{-1}$\si{.kg.m^{-1}.s^{-1}} \\
            1 S & 1\si{.\Omega^{-1} = 1.A.V^{-1}}

        \end{tabular}

    \end{flushleft}

    \vspace{-2em}

    \section*{Conversion factors}

    $\theta/^{\circ}C = \textit{T}/K-273.15^*$

    \vspace{-1em}

    \begin{flushleft}


        \begin{tabular}{@{}p{0.5in} p{1.2in} p{0.5in} p{1.2in}@{}}

            1 eV & $1.602177\times10^{-19}$\si{.J} \newline $96.485$\si{.kJ.mol^{-1}} \newline $8065.5$\si{.cm^{-1}} & 1 cal & $4.184$\si{.J} \\
            1 atm & $101.325^*$\si{.kPa} \newline \si{760^*.Torr} & 1\si{.cm^{-1}} & $1.9864\times10^{-23}$\si{.J} \\
            1 D & $3.33564x10^{-30}$\si{C.m} & 1 \AA{} & $10^{-10}$\si{m^*} \\

        \end{tabular}

        * Exact value

    \end{flushleft}

    \vspace{-1em}

    \section*{Mathematical relations}

    \begin{flushleft}

        \begin{tabular}{@{}p{1.7in} p{1.7in}@{}}

            \si{\pi = 3.14159265359\ldots} & \si{e = 2.71828182846\ldots}

        \end{tabular}

    \end{flushleft}

    \vspace{-2em}

    \section*{Logarithms and exponentials}

    \begin{flushleft}

        \begin{tabular}{@{}p{1.7in} p{1.7in}@{}}

            \si{ln.x+ln.y+\ldots=ln.xy\ldots} & \si{ln.x-ln.y=ln(x/y)} \\
            \si{a.ln.x=ln.x^a} & \si{ln.x=(ln.10).log.x} \newline =(2.302585\ldots)\si{.log.x} \\
            \si{e^x.e^y.e^z\ldots=e^{x+y+z+\ldots}} & \si{e^x/e^y=e^{x-y}} \\
            \si{(e^x)^a=e^{ax}} & \si{e^{\pm\textit{i}x}=cos.x.\pm.\textit{i}.sin.x}

        \end{tabular}

    \end{flushleft}

    \newpage

    \section*{Series expansions}

    \setlength\extrarowheight{12pt}

    \si{e^x = 1+x+\frac{x^2}{2!}+\frac{x^3}{3!}+\ldots} \\
    \si{ln(1+x)=x-\frac{x^2}{2}+\frac{x^3}{3}-\ldots}

    \begin{flushleft}

        \begin{tabular}{@{}p{1.7in} p{1.7in}@{}}

            \si{\dfrac{1}{1+x}=1-x^2-\ldots} & \si{\dfrac{1}{1-x}=1+x^2+\ldots} \\
            \si{\sin.x=x-\dfrac{x^3}{3!}+\dfrac{x^5}{5!}-\ldots} & \si{\cos.x=1-\dfrac{x^2}{2!}+\dfrac{x^4}{4!}-\ldots}

        \end{tabular}

    \end{flushleft}

    \vspace{-2em}

    \section*{Derivatives}

    \begin{flushleft}

        \begin{tabular}{@{}p{1.3in} p{1.1in} p{1in}@{}}

            $d(f+g)=df+dg$ & $d(f+g)=df+dg$ \\
            $d\dfrac{f}{g}=\dfrac{1}{g}df-\dfrac{f}{g^2}dg$ & \multicolumn{2}{l}{$d\dfrac{df}{dt}=\dfrac{df}{dg}df\dfrac{dg}{dt} for f=f(g(t))$} \\
            $\left(\dfrac{\partial y}{\partial x}\right)_z = 1/\left(\dfrac{\partial x}{\partial x}\right)_z$ & \multicolumn{2}{l}{$\left(\dfrac{\partial y}{\partial x}\right)_z \left(\dfrac{\partial x}{\partial z}\right)_y \left(\dfrac{\partial z}{\partial y}\right)_x = -1$} \\
            $\dfrac{dx^n}{dx}=nx^(n-1)$ & $\dfrac{de^(ax)}{dx}=ae^(ax)$ & $\dfrac{d\,ln(ax)}{dx}=\dfrac{1}{x}$

        \end{tabular}

    $df=g(x,y)dx+h(x,y)dy is exact if \left(\dfrac{\partial g}{\partial y}\right)_x = \left(\dfrac{\partial h}{\partial x}\right)_y$

    \end{flushleft}

        \section*{Greek alphabet}

        \setlength\extrarowheight{8pt}

    \begin{flushleft}

        \begin{tabular}{@{}p{0.3in} p{0.7in} p{0.3in} p{0.7in} p{0.3in} p{0.7in}@{}}

            A,$\alpha$ & alpha & I,$\iota$ & iota & P,$\rho$ & rho \\
            B,$\beta$ & beta & K,$\kappa$ & kappa & $\Sigma,\sigma$ & sigma \\
            $\Gamma,\gamma$ & gamma & $\Lambda,\lambda$ & lambda & T,$\tau$ & tau \\
            $\Delta,\delta$ & delta & M,$\mu$ & mu & $\Upsilon,\upsilon$ & upsilon \\
            E,$\epsilon$ & epsilon & N,$\nu$ & nu & $\Phi,\phi$ & phi \\
            Z,$\zeta$ & zeta & $\Xi,\xi$ & xi & X,$\chi$ & chi \\
            H,$\eta$ & eta & O,o & omicron & $\Psi,\psi$ & psi \\
            $\Theta,\theta$ & theta & $\Pi,\pi$ & pi & $\Omega,\omega$ & omega

        \end{tabular}

    \end{flushleft}

\end{document}

相关内容