Я хочу написать таблицу, вот мой код:
\documentclass{article}
\usepackage{bbm}
\usepackage{amsmath}
\usepackage{multirow}
\begin{document}
\begin{table}
\caption{Tipe opsi barrier.}
\begin{center}
\begin{tabular}{|c|c|c|c|c|}
\hline
Tipe Opsi&CBBC&\textit{Behavior}&\textit{Payoff}& \\
\hline
\multirow{8}{*}{Barrier \textit{Call}}& \multirow{2}{*}{\textit{Bull}}&\multirow{2}{*}{\begin{tabular}{@{}c@{}}\textit{down-and-out} \\ (\textit{knock-out})\end{tabular}}&\multirow{2}{*}{$(S_T-K)^+\mathbbm{1}_{\biggl\{\min\limits_{0\leq t\leq T}S_t>B\biggr\}}$}&$B\leq K$\\
\cline{5-5}
&&&&$B\geq K$\\
\cline{2-5}
&\multirow{6}{*}{}&\multirow{2}{*}{\begin{tabular}{@{}c@{}}\textit{down-and-in}\\(\textit{knock-in})\end{tabular}}&\multirow{2}{*}{$(S_T-K)^+\mathbbm{1}_{\biggl\{\min\limits_{0\leq t\leq T}S_t<B\biggr\}}$}&$B\leq K$\\
\cline{5-5}
&&&&$B\geq K$\\
\cline{3-5}
&&\multirow{2}{*}{\begin{tabular}{@{}c@{}}\textit{up-and-out}\\(\textit{knock-out})\end{tabular}}&\multirow{2}{*}{$(S_T-K)^+\mathbbm{1}_{\biggl\{\max\limits_{0\leq t\leq T}S_t<B\biggr\}}$}&$B\leq K$\\
\cline{5-5}
&&&&$B\geq K$\\
\cline{3-5}
&&\multirow{2}{*}{\begin{tabular}{@{}c@{}}\textit{up-and-in}\\(\textit{knock-in})\end{tabular}}&\multirow{2}{*}{$(S_T-K)^+\mathbbm{1}_{\biggl\{\max\limits_{0\leq t\leq T}S_t>B\biggr\}}$}&$B\leq K$\\
\cline{5-5}
&&&&$B\geq K$\\
\hline
\end{tabular}
\end{center}
\end{table}
\end{document}
Вывод этого кода:
Но, похоже, что в выводе есть ошибки. Многие скрипты выходят за рамки своих ячеек. В чем проблемы моего кода?
решение1
Ошибка - \FloatBarrier
требуемый placeins
пакет.
\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage{bbm}
\usepackage{placeins}
\usepackage{multirow}
\begin{document}
\FloatBarrier
\begin{table}
\caption{Tipe opsi barrier.}
\begin{center}
\begin{tabular}{|c|c|c|c|c|}
\hline
Tipe Opsi&CBBC&\textit{Behavior}&\textit{Payoff}& \\
\hline
\multirow{8}{*}{Barrier \textit{Call}}& \multirow{2}{*}{\textit{Bull}}&\multirow{2}{*}{\begin{tabular}{@{}c@{}}\textit{down-and-out} \\ (\textit{knock-out})\end{tabular}}&\multirow{2}{*}{$(S_T-K)^+\mathbbm{1}_{\bigl\{\min\limits_{0\leq t\leq T}S_t>B\bigr\}}$}&$B\leq K$\\
\cline{5-5}
&&&&$B\geq K$\\
\cline{2-5}
&\multirow{6}{*}{}&\multirow{2}{*}{\begin{tabular}{@{}c@{}}\textit{down-and-in}\\(\textit{knock-in})\end{tabular}}&\multirow{2}{*}{$(S_T-K)^+\mathbbm{1}_{\bigl\{\min\limits_{0\leq t\leq T}S_t<B\bigr\}}$}&$B\leq K$\\
\cline{5-5}
&&&&$B\geq K$\\
\cline{3-5}
&&\multirow{2}{*}{\begin{tabular}{@{}c@{}}\textit{up-and-out}\\(\textit{knock-out})\end{tabular}}&\multirow{2}{*}{$(S_T-K)^+\mathbbm{1}_{\bigl\{\max\limits_{0\leq t\leq T}S_t<B\bigr\}}$}&$B\leq K$\\
\cline{5-5}
&&&&$B\geq K$\\
\cline{3-5}
&&\multirow{2}{*}{\begin{tabular}{@{}c@{}}\textit{up-and-in}\\(\textit{knock-in})\end{tabular}}&\multirow{2}{*}{$(S_T-K)^+\mathbbm{1}_{\bigl\{\max\limits_{0\leq t\leq T}S_t>B\bigr\}}$}&$B\leq K$\\
\cline{5-5}
&&&&$B\geq K$\\
\hline
\end{tabular}
\end{center}
\end{table}
\FloatBarrier
\end{document}
решение2
Аналогично ответу Себастьяно, я использую \left\{...\right\}
для подгонки фигурные скобки, как показано ниже.
\documentclass{article}
\usepackage{amsmath,amssymb}
\usepackage{bbm}
\usepackage{multirow}
\begin{document}
\begin{table}
\caption{Tipe opsi barrier.}
\begin{center}
\begin{tabular}{|c|c|c|c|c|}
\hline
Tipe Opsi&CBBC&\textit{Behavior}&\textit{Payoff}& \\
\hline
\multirow{8}{*}{Barrier \textit{Call}}& \multirow{2}{*}{\textit{Bull}}&\multirow{2}{*}{\begin{tabular}{@{}c@{}}\textit{down-and-out} \\ (\textit{knock-out})\end{tabular}}&\multirow{2}{*}{$(S_T-K)^+\mathbbm{1}_{\left\{\min\limits_{0\leq t\leq T}S_t>B\right\}}$}&$B\leq K$\\
\cline{5-5}
&&&&$B\geq K$\\
\cline{2-5}
&\multirow{6}{*}{}&\multirow{2}{*}{\begin{tabular}{@{}c@{}}\textit{down-and-in}\\(\textit{knock-in})\end{tabular}}&\multirow{2}{*}{$(S_T-K)^+\mathbbm{1}_{\left\{\min\limits_{0\leq t\leq T}S_t<B\right\}}$}&$B\leq K$\\
\cline{5-5}
&&&&$B\geq K$\\
\cline{3-5}
&&\multirow{2}{*}{\begin{tabular}{@{}c@{}}\textit{up-and-out}\\(\textit{knock-out})\end{tabular}}&\multirow{2}{*}{$(S_T-K)^+\mathbbm{1}_{\left\{\max\limits_{0\leq t\leq T}S_t<B\right\}}$}&$B\leq K$\\
\cline{5-5}
&&&&$B\geq K$\\
\cline{3-5}
&&\multirow{2}{*}{\begin{tabular}{@{}c@{}}\textit{up-and-in}\\(\textit{knock-in})\end{tabular}}&\multirow{2}{*}{$(S_T-K)^+\mathbbm{1}_{\left\{\max\limits_{0\leq t\leq T}S_t>B\right\}}$}&$B\leq K$\\
\cline{5-5}
&&&&$B\geq K$\\
\hline
\end{tabular}
\end{center}
\end{table}
\end{document}
И результат