如何对齐两列框

如何对齐两列框

我想请您与我分享您关于如何在框内对齐以下文本的想法。提前谢谢您

\pagenumbering{gobble}
\noindent\fbox{%
    \parbox{\textwidth}{%
    \small
    \begin{multicols}{2}
    \textbf{Nomenclature}\\
    \textbf{List of variables:}\\
   $u$,$\upsilon$ \quad Velocity components along x-y axes $(m/s)$\\
   $U_{w}$        \;\;\;\; Velocity of the wall along the x-axis $(m/s)$\\
   $x,y$          \;\;\; Cartesian coordinates measured along the stretching sheet $(m)$\\
   $B(x)$         \;     Magnetic field strength $(A m^{-1})$\\
   $C$            \qquad Nanoparticle concentration $(mol\; m^{-3})$\\
   $C_{fx}$       \;\;\;  Skin-friction coefficient $(Pascal)$\\
   $Nu_{x}$       \;\; Nusselt number\\
   $Sh_{x}$       \;\;\; Sherwood number\\
   $C_{w}$        \;\;\;\; Nanoparticles concentration at the \\ stretching surface $(mol \;m^{-3})$\\
   $C_{\infty}$   \quad Nanoparticle concentration far from the sheet $(mol\; m^{-3})$\\
   $C_{p}$        \;\;\;\; Specific heat capacity at constant pressure $(J \;Kg^{-1}\; K)$\\
   $D_{T}$        \;\;\; Brownian diffusion coefficient\\
   $D_{b}$        \quad\, Thermophoresis diffusion coefficient\\
   Ec             \quad\; Eckert number\\
   $a$            \quad\;\;\; Constant parameter\\
   $n$            \quad\;\;\; Nonlinear stretching parameter\\
   $f$            \quad\;\;\; Dimensionless stream function\\
   $k$            \quad\;\;\; Thermal conductivity $(W m^{-1} K^{-1})$\\
   $S$            \quad\;\;\; Suction/injection  parameter\\
   $Le$           \quad\;\, Lewis number\\
   $M$            \quad\;\, Magnetic parameter\\
   $Q_{0}$        \quad\; Dimensional heat generation parameter\\
   $Nb$           \quad\; Brownian motion parameter\\
   $Nt$           \quad\; Thermophoresis parameter\\
   $Pr$           \quad\; Prandtl number\\
   $Q$            \quad\;\;\, Heat generation/absorption parameter\\
   $K_{1}$        \quad\; Velocity slip factor\\
   $K_{2}$        \quad\; Thermal slip factor\\
   $K_{3}$        \, Concentration slip factor\\
   $T$            \;\;\, Fluid temperature $(K)$\\
   $q_{w}$        \; Surface heat flux $(W/m^{2})$\\
   $q_{m}$        \; Surface mass flux\\
   $T_{W}$        \,Temperature at the surface $(K)$\\
   $T_{\infty}$   \, Temperature of the fluid far away from the stretching sheet $(K)$\\\\
   \textbf{Greek Symbols:}\\
   $\alpha$       \quad Thermal diffusivity ($m^{2}/s$)\\
   $\eta$         \quad Dimensionless similarity variable\\
   $\gamma$       \quad concentration parameter\\
   $\mu$          \,\,\,\,\,\, Dynamic viscosity of the base fluid $(kg/m.s)$\\
   $\upsilon$     \;\;\; Kinematic viscosity $(m^{2} \;s^{-1})$\\
   $\rho_{f}$     \;\, Density of the fluid $(Kg \;m^{-3})$\\
   $\rho_{p}$     \;\; Density of the nanoparticle $(Kg\; m^{-3})$\\
   $\tau$         \; The ratio of the nanoparticle heat capacity  the base fluid heat Capacity\\
   $(\rho c)_{f}$ \; Heat capacity of the base fluid $(kg/m.s^{2})$\\
   $(\rho c)_{p}$ \; Heat capacity of the nanoparticle $(kg/m.s^{2})$\\
   $\theta$       \quad Dimensionless temperature $(K)$\\
   p pressure     \quad $(N/ m^{2})$\\
   $\phi$         \quad Nanoparticle volume fraction\\
   $\phi_{W}$     \;\;\; Nanoparticle volume fraction at wall temperature\\
   $\phi_{\infty}$\;\;\; Ambient nanoparticle volume fraction\\
   $\lambda$      \quad Velocity slip parameter\\
   $\delta$       \quad Thermal slip parameter\\\\
   \textbf{Sub Scripts:}\\
   $f$            \quad Fluid\\
   $\emph{W}$     \quad Condition on the sheet\\
   $\infty$       \quad Ambient Conditions
   \end{multicols}
    }%
    }

答案1

执行此操作的标准方法是使用tabular,但这将涉及手动打破列。

如果您希望自动分栏,那么一种可能性是使用环境tabbing。(不幸的是,longtable在双列模式下不起作用。)制表符的一般语法是

\begin{tabbing}
line with \= tab marks set\\
next \> line with tab stops\\
another \> line with tab stops\\
\end{tabbing}

在您的情况下,您将需要使用 将文本换行到第二列\parbox,因此辅助命令很有用:

\newcommand{\entry}[3][\>]{#2 #1 \parbox[t]{.4\textwidth}{#3\strut\par}\\}

所以普通的行只是

\entry{symbol}{explanation}

第一行是

\entry[...\=]{symbol}{explanation}

添加...一些额外的空白以容纳最宽的标签。

示例输出

\documentclass{article}

\usepackage{multicol,ragged2e,siunitx}

\sisetup{per-mode=symbol}

\setlength{\fboxsep}{5pt}

\begin{document}

\noindent\fbox{%
\hfill\parbox{\dimexpr\textwidth-15pt}{%
\vspace{-\topskip}\small
\newcommand{\entry}[3][\>]{#2 #1 \parbox[t]{.4\textwidth}{\RaggedRight
#3\strut\par}\\}%
\begin{multicols}{2}
  \begin{tabbing}
    \textbf{\large Nomenclature}\\[2ex]
    \textbf{List of variables:}\\
    \entry[\quad\=]{$u$,$\upsilon$}{Velocity components along $x$-$y$
    axes (\si{m\per s})}
    \entry{$U_{w}$}{Velocity of the wall along the $x$-axis (\si{m\per
    s})}
    \entry{$x,y$}{Cartesian coordinates measured along the stretching sheet (\si{m})}
    \entry{$B(x)$}{Magnetic field strength (\si{A.m^{-1}})}
    \entry{$C$}{Nanoparticle concentration (\si{mol.m^{-3}})}
    \entry{$C_{fx}$}{Skin-friction coefficient (\si{Pascal})}
    \entry{$Nu_{x}$}{Nusselt number}
    \entry{$Sh_{x}$}{Sherwood number}
    \entry{$C_{w}$}{Nanoparticles concentration at the stretching surface (\si{mol.m^{-3}})}
    \entry{$C_{\infty}$}{Nanoparticle concentration far from the sheet (\si{mol.m^{-3}})}
    \entry{$C_{p}$}{Specific heat capacity at constant pressure (\si{J.kg^{-1}.K})}
    \entry{$D_{T}$}{Brownian diffusion coefficient}
    \entry{$D_{b}$}{Thermophoresis diffusion coefficient}
    \entry{Ec}{Eckert number}
    \entry{$a$}{Constant parameter}
    \entry{$n$}{Nonlinear stretching parameter}
    \entry{$f$}{Dimensionless stream function}
    \entry{$k$}{Thermal conductivity (\si{W.m^{-1}.K^{-1}})}
    \entry{$S$}{Suction/injection parameter}
    \entry{$Le$}{Lewis number}
    \entry{$M$}{Magnetic parameter}
    \entry{$Q_{0}$}{Dimensional heat generation parameter}
    \entry{$Nb$}{Brownian motion parameter}
    \entry{$Nt$}{Thermophoresis parameter}
    \entry{$Pr$}{Prandtl number}
    \entry{$Q$}{Heat generation/absorption parameter}
    \entry{$K_{1}$}{Velocity slip factor}
    \entry{$K_{2}$}{Thermal slip factor}
    \entry{$K_{3}$}{Concentration slip factor}
    \entry{$T$}{Fluid temperature (\si{K})}
    \entry{$q_{w}$}{Surface heat flux (\si{W\per m^{2}})}
    \entry{$q_{m}$}{Surface mass flux}
    \entry{$T_{W}$}{Temperature at the surface (\si{K})}
    \entry{$T_{\infty}$}{Temperature of the fluid far away from the stretching sheet (\si{K})}
    \textbf{Greek Symbols:}\\
    \entry{$\alpha$}{Thermal diffusivity (\si{m^{2}\per s})}
    \entry{$\eta$}{Dimensionless similarity variable}
    \entry{$\gamma$}{concentration parameter}
    \entry{$\mu$}{Dynamic viscosity of the base fluid (\si{kg\per m.s})}
    \entry{$\upsilon$}{Kinematic viscosity (\si{m^{2}.s^{-1}})}
    \entry{$\rho_{f}$}{Density of the fluid (\si{kg.m^{-3}})}
    \entry{$\rho_{p}$}{Density of the nanoparticle (\si{kg.m^{-3}})}
    \entry{$\tau$}{The ratio of the nanoparticle heat capacity the base fluid heat Capacity}
    \entry{$(\rho c)_{f}$}{Heat capacity of the base fluid (\si{kg\per
    m.s^{2}})}
    \entry{$(\rho c)_{p}$}{Heat capacity of the nanoparticle
    (\si{kg\per m.s^{2}})}
    \entry{$\theta$}{Dimensionless temperature (\si{K})}
    \entry{p}{pressure (\si{N\per m^{2}})}
    \entry{$\phi$}{Nanoparticle volume fraction}
    \entry{$\phi_{W}$}{Nanoparticle volume fraction at wall temperature}
    \entry{$\phi_{\infty}$}{Ambient nanoparticle volume fraction}
    \entry{$\lambda$}{Velocity slip parameter}
    \entry{$\delta$}{Thermal slip parameter}
    \textbf{Sub Scripts:}\\
    \entry{$f$}{Fluid}
    \entry{$\emph{W}$}{Condition on the sheet}
    \entry{$\infty$}{Ambient Conditions}
  \end{tabbing}
\end{multicols}
}%
\hfill}
\end{document}

我选择设置说明\RaggedRight,因为列很窄。我还使用了siunitx排版单元的包。最后,我将主标题设置得稍大一些,删除了框顶部的一些多余空间,并使用 使\hfill文本在框中水平居中。

相关内容