使用标签和 witharrow 包的问题

使用标签和 witharrow 包的问题

当我使用 witharrows 包尝试标记和引用方程式时,我遇到了问题,我不知道如何修复它。如果有人知道如何修复它,那将非常有帮助。这里我放了代码(我知道有很多代码对于这个问题来说不是必要的,但我使用了一些我自己编写的函数,很难重写代码):

\documentclass[a4paper, 12pt]{book}

% fuente de letra:
\usepackage{lmodern}
% matemáticas:
\usepackage{amsmath, amssymb} 
% idioma:
\usepackage[utf8]{inputenc}
\usepackage[spanish, es-tabla]{babel} % 'cuadro' es el título del caption de table por defecto siguiendo indicaciones de RAE; es-tabla lo cambia a 'tabla'
% gestión de párrafos (hace innecesario indicar el salto de línea con doble barra y elimina el indent de todos los párrafos):
\usepackage{parskip}
% enlaces a URLs:
\usepackage{hyperref}
% gráficos:
\usepackage{graphicx, wrapfig, subcaption}
% tablas:
\usepackage{array, multirow}

\newcommand{\dl}{\left(}
\newcommand{\dr}{\right)}

\newcommand{\dsin}[1]{\sin{\left(#1\right)}}
\newcommand{\dtan}[1]{\tan{\left(#1\right)}}
\newcommand{\dcos}[1]{\cos{\left(#1\right)}}
\newcommand{\dsec}[1]{\sec{\left(#1\right)}}
\newcommand{\dcsc}[1]{\csc{\left(#1\right)}}
\newcommand{\dcot}[1]{\cot{\left(#1\right)}}
\newcommand{\darcsin}[1]{\arcsin{\left(#1\right)}}
\newcommand{\darccos}[1]{\arccos{\left(#1\right)}}
\newcommand{\darctan}[1]{\arctan{\left(#1\right)}}
\newcommand{\dsinh}[1]{\sinh{\left(#1\right)}}
\newcommand{\dcosh}[1]{\cosh{\left(#1\right)}}
\newcommand{\dtanh}[1]{\tanh{\left(#1\right)}}

\newcommand{\dln}[1]{\ln{\left(#1\right)}}

\newcommand{\dsum}[2]{\displaystyle\sum_{#1}^{#2}}
\newcommand{\dlim}[2]{\lim_{#1\rightarrow#2}}
\newcommand{\dint}[2]{\displaystyle\int_{#1}^{#2}}
\newcommand{\doint}[2]{\displaystyle\oint_{#1}^{#2}}


\NewDocumentCommand{\umathnote}{ mm }
   {
     \overset % ❶
        {% The annotation goes above
          \textcolor{black!20!white}{\hbox to 0pt{\hss % ❷
             $ % return to math mode
               \begin{array}{c} % ❸
                   \displaystyle #2\\ % ❹
                   \Big\downarrow % ❺
               \end{array}
             $
          \hss}
          }
        }
        {#1} % 
   }
   
\NewDocumentCommand{\dmathnote}{ mm }
   {
     \underset % ❶
        {% The annotation goes above
          \textcolor{black!20!white}{\hbox to 0pt{\hss % ❷
             $ % return to math mode
               \begin{array}{c} % ❸
                   \Big\uparrow\\ % ❹
                   \displaystyle #2 % ❺
               \end{array}
             $
          \hss}
          }
        }
        {#1} % 
   }


\renewcommand{\baselinestretch}{1.35}
\usepackage{titlesec}
\makeatletter
\renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}%
            {-2.5ex\@plus -1ex \@minus -.25ex}%
            {1.25ex \@plus .25ex}%
            {\normalfont\normalsize\bfseries}}
\makeatother
\setcounter{secnumdepth}{4} % how many sectioning levels to assign numbers to
\setcounter{tocdepth}{4}    % how many sectioning levels to show in ToC

\usepackage[all]{xy}
\usepackage{pgfplots}
\pgfplotsset{compat=1.16}
\usepackage{tikz}
\usetikzlibrary{calc, arrows}
\usepackage[makeroom]{cancel}
\newenvironment{grand}
{\begin{center}\large}
{\end{center}}
\usepackage[framemethod=TikZ]{mdframed}


\newcounter{dem}[chapter]\setcounter{dem}{0}
\renewcommand{\thedem}{\Roman{dem}}  
\newenvironment{dem}[2][]{%
\refstepcounter{dem}%
\ifstrempty{#1}%
{\mdfsetup{%
frametitle={%
\tikz[baseline=(current bounding box.east),outer sep=0pt]
\node[anchor=east,rectangle,fill=white]
{\strut Demostración~\thedem};}}
}%
{\mdfsetup{%
frametitle={%
\tikz[baseline=(current bounding box.east),outer sep=0pt]
\node[anchor=east,rectangle,fill=white]
{\begin{minipage}{0.99\linewidth}Demostración~\thedem~#1\end{minipage}};}}%
}%
\mdfsetup{innertopmargin=10pt,linecolor=black,%
linewidth=0.5pt,topline=true,%
frametitleaboveskip=\dimexpr-\ht\strutbox\relax
}
\begin{mdframed}[]\relax%
\label{#2}}{\end{mdframed}}


\usepackage{nccmath}
\usepackage{tcolorbox}
\tcbuselibrary{most}

\newtcolorbox[auto counter,
              number within=chapter,
              list inside=ej
              ]{ej}[1][]{%
    enhanced, breakable,
    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,
    underlay unbroken and first={%
         \ifnumequal{\tcbsegmentstate}{0}{
            \draw[black,double] (interior.north west)--(interior.south west);
        }{\ifnumequal{\tcbsegmentstate}{1}{
                \draw[black,double] (interior.north west)--(segmentation.west);
            \begin{tcbclipinterior}
                    \draw[help lines, step=3.8mm, black!20!white](segmentation.south west) grid (frame.south east);
            \end{tcbclipinterior}
        }{\ifnumequal{\tcbsegmentstate}{2}{
            \begin{tcbclipinterior}
                    \draw[help lines, step=3.8mm, black!20!white](interior.north west) grid (interior.south east);
            \end{tcbclipinterior}
        }}}
    },
    underlay middle and last={%
         \ifnumequal{\tcbsegmentstate}{0}{
            \draw[black,double] (interior.north west)--(interior.south west);
        }{\ifnumequal{\tcbsegmentstate}{1}{
                \draw[black,double] (interior.north west)--(segmentation.west);
            \begin{tcbclipinterior}
                    \draw[help lines, step=3.8mm, black!20!white](segmentation.south west) grid (frame.south east);
            \end{tcbclipinterior}
        }{\ifnumequal{\tcbsegmentstate}{2}{
            \begin{tcbclipinterior}
                    \draw[help lines, step=3.8mm, black!20!white](interior.north west) grid (interior.south east);
            \end{tcbclipinterior}
        }}}
    },
    boxed title style={%
      colframe=white, 
      boxrule=0pt,
      colback=white,
      left=0pt,
      right=0pt},
    attach boxed title to top left={xshift={-5pt}},
    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:}}}
}

\newtcolorbox[auto counter,
              number within=chapter,
              list inside=defi
              ]{defi}[1][]{%
    enhanced,
    title={{\begin{minipage}{0.99\linewidth}\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)--(interior.south west);%
      },
    boxed title style={%
      colframe=white, 
      boxrule=0pt,
      colback=white,
      left=0pt,
      right=0pt},
    attach boxed title to top left={xshift={-5pt}},
}
\usepackage{float}

\usepackage{fancyhdr}

\usepackage{geometry}

\usepackage{witharrows}

\newgeometry{bottom=2cm,top=2cm,right=1cm,left=1cm,binding=1cm}

\labelformat{equation}{(#1)}

\title{Paquete para libros}
\author{alvarito mendez}
\date{January 2022}

\begin{document}

\maketitle

\section{Introduction}
\begin{DispWithArrows}[groups]
\left.\begin{array}{c}
    m\ddot{x}_1=-kx_1+k\dl x_1-x_2\dr  \\
    m\ddot{x}_2=-kx_2+k\dl x_2-x_1\dr 
\end{array}\right\}  \Arrow{$\ddot{x}_1+\ddot{x}_2$} \Arrow[o, jump=2]{$\ddot{x}_1-\ddot{x}_2$} \label{eq:8.2.1}\\
m\dl\ddot{x}_1+\ddot{x}_2\dr=-k\dl x_1+x_2\dr \label{eq:8.2.2} \\
m\dl\ddot{x}_1-\ddot{x}_2\dr=-3k\dl x_1-x_2\dr \label{eq:8.2.3}
\end{DispWithArrows}

El sistema de ecuaciones \ref{eq:8.2.1} se encuentra en un estado acoplado \footnote{Esto se debe a que en ambas ecuaciones aparecen terminos cruzados que hacen que la una dependa de la otra}, sin embargo el sistema formado por las ecuaciones \ref{eq:8.2.2} y \ref{eq:8.2.3} el sistema esta desacoplado.

\end{document}

我把输出放在这里:

在此处输入图片描述

相关内容