如何在方程式列表/求解步骤中添加解释性文字标签

如何在方程式列表/求解步骤中添加解释性文字标签

有人知道如何在 LaTeX 中做到这一点并能解释一下怎么做吗?字体和设计并不重要,我想要的是标记方程式。

应实现的目标示例

答案1

正如 @tohecz 所说,数学包非常有用,自己学习通常是最好的解决方案。第二好的解决方案是看看其他人做了什么,借鉴它,并根据自己的需要进行调整。下面是第二好的解决方案。

\documentclass{article}

\usepackage{amsmath,array}
\setlength{\tabcolsep}{2pt}
\renewcommand\arraystretch{1.2}

\begin{document}

\begin{tabular}{l c p{6cm} l}
$\neg [(p\Delta q)\to \neg q]$ & $\equiv$ & $\neg[\neg(p\Delta q)\vee\neg q]$ \dotfill & por IMPLICANIA \\
& $\equiv$ & $\neg[\neg(\neg (p\leftrightarrow q))\vee\neg q]$ \dotfill & por ley $(\alpha)$ \\
& $\equiv$ & $\neg[(p\leftrightarrow q)\vee\neg q]$ \dotfill & por DOBLE NEGACION \\
& $\equiv$ & $\neg(p\leftrightarrow q)\wedge \neg\neg q$ \dotfill & por MORGAN \\
& $\equiv$ & $\neg(p\leftrightarrow q)\wedge q$ \dotfill & por DOBLE NEGACION \\
& $\equiv$ & $\neg[(p\wedge q)\vee (\neg p\wedge \neg q)]\wedge q$ \dotfill & por DOBLE IMPLICANCIA \\
& $\equiv$ & $[\neg(p\wedge q)\wedge \neg(\neg p\wedge \neg q)]\wedge q$ \dotfill & por MORGAN \\
& $\equiv$ & $[(\neg p\vee \neg q)\wedge(\neg\neg p\vee \neg\neg q)]\wedge q$ \dotfill & por MORGAN \\
& $\equiv$ & $[(\neg p\vee \neg q)\wedge(p\vee q)]\wedge q$ \dotfill & por DOBLE NEGACION \\
& $\equiv$ & $(\neg p\vee \neg q)\wedge [(p\vee q)\wedge q]$ \dotfill & por ley ASOCIATIVA \\
& $\equiv$ & $(\neg p\vee \neg q)\wedge q$ \dotfill & por ABSORCION \\
& $\equiv$ & $\neg p\wedge q$ \dotfill & por ABSORCION
\end{tabular}\\

Soluci\'on:\ \ $\neg p\wedge q$\ \  RPTA.E

\end{document}

这里我使用了tabular环境来对齐方程式和文本。我选择tabular而不是,align*因为我不确定如何\dotfill在中实现align*。无论哪种方式,这似乎都能完成工作。另外,我假设水平略微波浪的破折号是否定符号,所以我使用了\neg它们,这对您来说可能不是标准的。结果如下。

在此处输入图片描述

答案2

扩展 jlv 非常好的解决方案,这里输入更简单,因为公共元素可以是隐含的。

我还添加了一些宏来帮助输入,并在需要时使更改渲染更加容易。因此,为了保持一致性,我使用、\to和来代替和。此外,对齐方式隐藏在宏中(例如,可能想要删除“por”)。我没有使用全部大写字母,而是使用了小写字母,这样虽然不太明显,但仍然引人注目。\leftrightarrow\limplies\liff\lnot\lor\land

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}

\usepackage{showframe} % just for the example
\usepackage{amsmath,tabularx}

\newcommand{\ldel}{\mathbin{\Delta}}
\newcommand{\just}[1]{por \textsc{#1}}
\newcommand{\limplies}{\rightarrow}
\newcommand{\liff}{\leftrightarrow}

\begin{document}

\noindent
\begin{tabularx}{\textwidth}{@{} >{$}l<{$} @{} >{${}}X<{$\dotfill} @{} l @{}}
\lnot [(p\ldel q)\limplies \lnot q]
& \equiv \lnot[\lnot(p\ldel q)\lor\lnot q]                                  & \just{implicancia} \\
& \equiv\lnot[\lnot(\lnot (p\liff q))\lor\lnot q]                           & \just{ley $(\alpha)$} \\
& \equiv \lnot[(p\liff q)\lor\lnot q]                                       & \just{doble negación} \\
& \equiv \lnot(p\liff q)\land \lnot\lnot q                                  & \just{De Morgan} \\
& \equiv \lnot(p\liff q)\land q                                             & \just{doble negación} \\
& \equiv \lnot[(p\land q)\lor (\lnot p\land \lnot q)]\land q                & \just{doble implicancia} \\
& \equiv [\lnot(p\land q)\land \lnot(\lnot p\land \lnot q)]\land q          & \just{De Morgan} \\
& \equiv [(\lnot p\lor \lnot q)\land(\lnot\lnot p\lor \lnot\lnot q)]\land q & \just{De Morgan} \\
& \equiv [(\lnot p\lor \lnot q)\land(p\lor q)]\land q                       & \just{doble negación} \\
& \equiv (\lnot p\lor \lnot q)\land [(p\lor q)\land q]                      & \just{ley asociativa} \\
& \equiv (\lnot p\lor \lnot q)\land q                                       & \just{absorción} \\
& \equiv \lnot p\land q                                                     & \just{absorción}
\end{tabularx}

\nopagebreak\medskip

\hspace*{\fill}Solución: $\lnot p\land q$\qquad RPTA.E\hspace*{2em}

\end{document}

在此处输入图片描述

答案3

输出不是 OP 想要的,而是包tkz-linknodes旨在创建方程式之间的链接并对其进行标记。

在此处输入图片描述

这是代码(一些命令取自egreg的答案)

\documentclass{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[spanish]{babel}
\usepackage{amsmath}
\usepackage{lmodern}
\usepackage{tkz-linknodes}

\newcommand{\ldel}{\mathbin{\Delta}}
\newcommand{\just}[1]{por \textsc{#1}}
\newcommand{\limplies}{\rightarrow}
\newcommand{\liff}{\leftrightarrow}

\begin{document}

\begin{NodesList}[margin=3cm]
  \begin{displaymath}\displaywidth=.2\linewidth
    \begin{aligned}
   \lnot  [(p\ldel q)\limplies \lnot q] & \AddNode\\
& \equiv \lnot[\lnot(p\ldel q)\lor\lnot q]  \AddNode\\
& \equiv\lnot[\lnot(\lnot (p\liff q))\lor\lnot q]  \AddNode\\
& \equiv \lnot[(p\liff q)\lor\lnot q]                 \AddNode\\                       
& \equiv \lnot(p\liff q)\land \lnot\lnot q      \AddNode\\                           
& \equiv \lnot(p\liff q)\land q                \AddNode\\                            
& \equiv \lnot[(p\land q)\lor (\lnot p\land \lnot q)]\land q     \AddNode\\            
& \equiv [\lnot(p\land q)\land \lnot(\lnot p\land \lnot q)]\land q    \AddNode\\       
& \equiv [(\lnot p\lor \lnot q)\land(\lnot\lnot p\lor \lnot\lnot q)]\land q \AddNode\\
& \equiv [(\lnot p\lor \lnot q)\land(p\lor q)]\land q          \AddNode\\              
& \equiv (\lnot p\lor \lnot q)\land [(p\lor q)\land q]        \AddNode\\               
& \equiv (\lnot p\lor \lnot q)\land q         \AddNode\\                               
& \equiv \lnot p\land q                   \AddNode\\                                   
\end{aligned}
\end{displaymath}
{
\tikzset{LabelStyle/.append style = {right}}
       \LinkNodes{por implicancia}
       \LinkNodes{por ley $(\alpha)$}
       \LinkNodes{por doble negación}
       \LinkNodes{por De Morgan}
       \LinkNodes{por doble negación}
       \LinkNodes{por doble implicancia}
       \LinkNodes{por De Morgan}
       \LinkNodes{por De Morgan}
       \LinkNodes{por doble negación}
       \LinkNodes{por ley asociativa}
       \LinkNodes{por absorción}
       \LinkNodes{por absorción}
}
\end{NodesList}
\nopagebreak\medskip
\hspace*{\fill}Solución: $\lnot p\land q$\qquad RPTA.E\hspace*{2em}
\end{document}

相关内容