我得到的代码运行得并不完美。
\begin{longtable}{rl}
\midrule
\midrule
\endhead
\multicolumn{2}{r}{to be continued \dots} \\
\endfoot
\bottomrule
\endlastfoot
$\tau_2$ &=$\quad \inf\{t-\tau_1 \mid t>\tau_1, X_t \geq 0, X_{\tau_1}<0 \}$ \ \text{--} \ \text{time elasped after $\tau$ (or $\tau_1$) when $X_t$ goes back above zero} \\
$g_t^X$ \quad &= $\quad \sup\{ s \leq t \mid \text{sign}(X_s) \neq \text{sign}(X_t) \}$ \ \text{--} \ \text{last crossing time of 0 before time $t$} \\
$d_t^X$ \quad &= $\quad \inf\{ s \geq t \mid \text{sign}(X_s) \neq \text{sign}(X_t) \}$ \ \text{--} \ \text{first crossing time of 0 before time $t$} \\
\end{longtable}
我怎样才能得到如图所示的输出?如能得到任何帮助我将不胜感激。
答案1
像这样?
\documentclass{article}
\usepackage{booktabs}
\usepackage{longtable}
\usepackage{amsmath}
\begin{document}
\begin{longtable}{rp{3in}}
\midrule
\midrule
\endhead
\multicolumn{2}{r}{to be continued \dots} \\
\endfoot
\bottomrule
\endlastfoot
$\tau_2$ \quad =& $\inf\{t-\tau_1 \mid t>\tau_1, X_t \geq 0, X_{\tau_1}<0 \}$ -- time elasped after $\tau$ (or $\tau_1$) when $X_t$ goes back above zero \\
$g_t^X$ \quad =& $\sup\{ s \leq t \mid \text{sign}(X_s) \neq \text{sign}(X_t) \}$ -- last crossing time of 0 before time $t$ \\
$d_t^X$ \quad =&$\inf\{ s \geq t \mid \text{sign}(X_s) \neq \text{sign}(X_t) \}$ -- first crossing time of 0 before time $t$ \\
\end{longtable}
\end{document}
答案2
我不确定你的问题是什么...但也许我的回答会对你有帮助。
以下是代码:
\documentclass[a4paper,10pt]{article}
\usepackage[utf8]{inputenc}
\usepackage{longtable}
\usepackage{array}
\usepackage{booktabs}
\usepackage{amsmath}
%opening
\title{}
\author{}
\begin{document}
\maketitle
\newcolumntype{L}{>{\small\raggedright\arraybackslash}p{0.7\textwidth}}
\begin{longtable}{rcL}
\midrule
\midrule
\endhead
\multicolumn{3}{r}{to be continued \dots} \\
\endfoot
\bottomrule
\endlastfoot
$\tau_2$ & &=$\quad \inf\{t-\tau_1 \mid t>\tau_1, X_t \geq 0, X_{\tau_1}<0 \}$ \ \text{--} \ \text{time elasped after $\tau$ (or $\tau_1$) when $X_t$ goes back above zero} \\
\\
$g_t^X$ & &= $\quad \sup\{ s \leq t \mid \text{sign}(X_s) \neq \text{sign}(X_t) \}$ \ \text{--} \ \text{last crossing time of 0 before time $t$} \\
\\
$d_t^X$ & &= $\quad \inf\{ s \geq t \mid \text{sign}(X_s) \neq \text{sign}(X_t) \}$ \ \text{--} \ \text{first crossing time of 0 before time $t$} \\
\end{longtable}
\end{document}
结果如下:
编辑:
如果您愿意,可以将其更改为:
\begin{longtable}{rccL}
\midrule
\midrule
\endhead
\multicolumn{4}{r}{to be continued \dots} \\
\endfoot
\bottomrule
\endlastfoot
$\tau_2$ & &= &$\inf\{t-\tau_1 \mid t>\tau_1, X_t \geq 0, X_{\tau_1}<0 \}$ \text{--} time elasped after $\tau$ (or $\tau_1$) when $X_t$ goes back above zero \\
\\
$g_t^X$ & &= &$\sup\{ s \leq t \mid \text{sign}(X_s) \neq \text{sign}(X_t) \}$ \text{--} last crossing time of 0 before time $t$ \\
\\
$d_t^X$ & &= &$\inf\{ s \geq t \mid \text{sign}(X_s) \neq \text{sign}(X_t) \}$ \text{--} first crossing time of 0 before time $t$ \\
\end{longtable}
对于下一个结果:
答案3
我认为您不希望等号周围有这么宽的空格。无论如何,它们可以轻松自定义,稍后再见。
\documentclass{article}
\usepackage{amsmath}
\usepackage{longtable}
\usepackage{array,booktabs}
\DeclareMathOperator{\sign}{sign}
\begin{document}
\begin{longtable}{@{}>{$}r<{{}$}@{}p{.8\textwidth}@{}}
\toprule
\endhead
\multicolumn{2}{r}{to be continued} \\
\endfoot
\bottomrule
\endlastfoot
\tau_2 = & $\inf\{t-\tau_1 \mid t>\tau_1, X_t \geq 0, X_{\tau_1}<0 \}$
-- time elapsed after $\tau$ (or $\tau_1$) when $X_t$ goes back above zero \\
g_t^X = & $\sup\{ s \leq t \mid \sign(X_s) \neq \sign(X_t) \}$
-- last crossing time of 0 before time $t$ \\
d_t^X = & $\inf\{ s \geq t \mid \sign(X_s) \neq \sign(X_t) \}$
-- first crossing time of 0 before time $t$ \\
\end{longtable}
\end{document}
拥有更广阔的空间:
\documentclass{article}
\usepackage{amsmath}
\usepackage{longtable}
\usepackage{array,booktabs}
\DeclareMathOperator{\sign}{sign}
\begin{document}
\begin{longtable}{@{}>{$\thickmuskip=24mu\relax}r<{{}$}@{}p{.8\textwidth}@{}}
\toprule
\endhead
\multicolumn{2}{r}{to be continued} \\
\endfoot
\bottomrule
\endlastfoot
\tau_2 = & $\inf\{t-\tau_1 \mid t>\tau_1, X_t \geq 0, X_{\tau_1}<0 \}$
-- time elapsed after $\tau$ (or $\tau_1$) when $X_t$ goes back above zero \\
g_t^X = & $\sup\{ s \leq t \mid \sign(X_s) \neq \sign(X_t) \}$
-- last crossing time of 0 before time $t$ \\
d_t^X = & $\inf\{ s \geq t \mid \sign(X_s) \neq \sign(X_t) \}$
-- first crossing time of 0 before time $t$ \\
\end{longtable}
\end{document}
答案4
您还可以考虑避免使用任何类似表格的环境来进行此类输出,并清除源代码:
\documentclass[a4paper,10pt]{article}
\usepackage{desclist}
\usepackage{amsmath}
\begin{document}
\begin{desclist}{\hfill\large}{\quad=\quad}[xxx] % xxx = longest label
\item
[$\tau_2$]
$\inf\{t-\tau_1 \mid t>\tau_1, X_t \geq 0, X_{\tau_1}<0 \}$ --
time elasped after $\tau$ (or $\tau_1$) when $X_t$ goes back above zero.
\item
[$g_t^X$]
$\sup\{ s \leq t \mid \text{sign}(X_s) \neq \text{sign}(X_t) \}$ --
last crossing time of 0 before time~$t$.
\item
[$d_t^X$]
$\inf\{ s \geq t \mid \text{sign}(X_s) \neq \text{sign}(X_t)\}$ --
first crossing time of 0 before time~$t$.
\end{desclist}
\end{document}