在公式的环境下,通常用cases环境来进行输入分段函数,但是分段函数进行子函数的时候,第一个节点的部分会把第二个部分包裹起来,如果想得到如下的效果的样式,cases环境直接输入无法达到这一要求,如何让公式组花括号不要包含到上下标?
方法一:使用smash命令,smash命令可以消除深度,可以用这一命令达到这一效果,例如如下代码。
\documentclass{article}
\usepackage{mathtools}
\begin{document}
\[
\begin{dcases*}
x & variables \\
y & variables
\smash[b]{$\begin{dcases*}
a & variables \\
n & variables
\end{dcases*}$}
\end{dcases*}
\]
\medskip %% add a blank line and \medskip
Some text comes here for demo Some text comes here for demo Some text comes here for demo
\end{document}
方法二:使用宏包schemata来实现这一效果,可以不放在数学环境下。
\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{amssymb}
\usepackage{schemata}
\begin{document}
\Schema{4.5ex}{19ex}{%
}{%
\Schema{-16.75ex}{9.25ex}{%
\schemabox{Doctrina de\\los elementos}
}{%
\schemabox{%
Estética\\trascendental
}%
\Schema{-8ex}{9ex}{%
\schemabox{Lógica\\trascendental}
}{%
\schema{%
\schemabox{Analítica\\ trascendental}
}{%
\schemabox{%
Analítica de\\los conceptos
}\smallskip
\schemabox{%
Analítica de\\los principios
}
}\smallskip
\Schema{-5.5ex}{7.5ex}{% change this \schema to \Schema first
\schemabox{%
Dialéctica\\
trascendental
}%
}{%
\schemabox{%
Conceptos de\\
la razón pura
}\smallskip
\schema{%
\schemabox{%
Inferencias\\
dialécticas de\\
la razón pura\\
}%
}{%
\schemabox{%
\schemabox{%
Paralogismos\\
de la razón\\
pura
}\smallskip\\
\schemabox{%
Antinomia\\
de la razón\\
Ideal de la\\
razón pura
}%
}%
}
}%
}%
}\smallskip
\schema{%
\schemabox{Doctrina\\del método}
}{%
\schemabox{%
Disciplina\\
Canon\\
Arquitectónica\\
Historia de la razón pura
}
}
}
\end{document}
效果图:
方法三,不言而喻我们可以用TiKZ来进行绘制这一样式,直接上代码。
\documentclass[tikz,border=10pt]{standalone}
\usepackage{forest}
\usetikzlibrary{decorations.pathreplacing}
\forestset{
forest scheme/.style={
for tree={
grow'=0,
anchor=west,
align=left,
if n=1{%
edge path={
\noexpand\path [\forestoption{edge}] (!ul.south west) -- (!u1.north west)\forestoption{edge label};
}
}{no edge},
edge={decorate, decoration={brace}},
},
}
}
\begin{document}
\begin{forest}
forest scheme
[Main
[Option A
[Option AA]
[Option AB]
]
[Option B
[Option BA]
[Option BB]
]
]
\end{forest}
\end{document}
选自:https://tex.stackexchange.com/questions/238027/how-can-i-do-cases-in-plain-text-mode
https://tex.stackexchange.com/questions/313721/is-there-a-better-way-of-setting-this-tree
https://tex.stackexchange.com/questions/257958/how-to-deal-with-schemes-of-curly-braces


发表评论 取消回复