带注释的数学盒

带注释的数学盒

我想创建一个用于数学笔记的函数,以便以一种简单的方式得出这个结果,就像\underset{}{}在括号之间放置想要出现在文本下方的内容的函数一样,所以我要求的这个函数是一个将等式括起来的函数,它允许你在下面放置一些东西(长于一行)并且在右边放置一些东西,就像我制作的结构一样。

另外,如果您看到这个,您可以评论任何与数学笔记或边注相关的帖子,只是为了看看该怎么做的例子。谢谢你的帮助。

\documentclass{book}

\usepackage{amsmath,amssymb}
\usepackage{nccmath}

\usepackage{tcolorbox}
\tcbuselibrary{most}
\newtcolorbox[auto counter,
              number within=chapter,
              list inside=myexercise
              ]{myexercise}[1][]{%
    enhanced,
    title={{\begin{minipage}{\linewidth}\textbf{Ejercicio}~\thetcbcounter.~\textit{#1}\end{minipage}}},
    halign title=left,
    sharp corners,
    colback=white,
    coltitle=black,
    colbacktitle=white,
    boxrule=0pt,frame hidden,
    overlay unbroken={\draw[black,double] (interior.north west)--(segmentation.west);},
    boxed title style={%
      colframe=white, 
      boxrule=0pt,
      colback=white,
      left=0pt,
      right=0pt},
    attach boxed title to top left={xshift={-5pt}},
    underlay unbroken={\draw[help lines,step=3.8mm,black!20!white](interior.south west) grid (segmentation.east);},
    lower separated=false, 
    before lower = {\tcbsubtitle[colback=white, opacityback=0, colframe=black, opacityframe=0, boxrule=1pt, height=1cm,  width=2.55cm, valign=center]{\textbf{Solution:}}}
}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\begin{document}
\underset{Hi}{\fbox{$\vec{m}_{total}=\displaystyle\int_{V'}\vec{M}(\vec{r'})d\tau'$}} $\longrightarrow\left|\substack{\\\text{ }\\d\tau'\text{debe ser lo suficientemente}\\\text{grande para que podamos}\\\text{considerar a }\vec{M}\text{ una función suave}\\\text{ }}\right.$

\end{document}

在此处输入图片描述

答案1

这是我的 TikZ 解决方案。

在此处输入图片描述

\documentclass{article}
\usepackage{tikz}
\begin{document}
\begin{center}
\begin{tikzpicture}
\path[nodes={minimum height=1.4cm}]
(0,0) node[draw] (L) {$\vec{m}_{total}=\displaystyle\int_{V'}\vec{M}(\vec{r'})d\tau'$}
(5.5,0) node[align=center] (R) {$d\tau'$ debe ser lo suficientemente\\grande para que podamos\\considerar a $\vec{M}$ una suave}
;
\draw[thick] (R.north west)--(R.south west);
\draw[->,thick] (L.east)+(0:.1)--+(0:1);
\path (L.south) node[below]{Hi};        
\end{tikzpicture}
\end{center}
\end{document}

更新:这是\mybox——\newcommand如所要求的。

在此处输入图片描述

\documentclass{article}
\usepackage{tikz}

% usage: \mybox{left}{right}{below}
\newcommand\mybox[3]{
\begin{tikzpicture}
\path[nodes={minimum height=1.4cm}]
(0,0) node[draw] (L) {#1}
(5.5,0) node[align=center] (R) {#2}
;
\draw[thick] (R.north west)--(R.south west);
\draw[->,thick] (L.east)+(0:.1)--+(0:1);
\path (L.south) node[below]{#3};
\end{tikzpicture}
}

\begin{document}
\begin{center}
\mybox{This is the left}{This is the right\\with some fomular}{and this is below}
\end{center}

\begin{center}
\mybox{$\vec{m}_{total}=\displaystyle\int_{V'}\vec{M}(\vec{r'})d\tau'$}{$d\tau'$ debe ser lo suficientemente\\grande para que podamos\\considerar a $\vec{M}$ una suave}{Hi}
\end{center}
\end{document}

相关内容