Numeração de equação personalizada

Numeração de equação personalizada

Quero rotular uma equação

\[ 1 + 2 + \cdots + i = \frac{i(i+1)}{2} \eqname{Inequality(i)} \label{ineq} \]

envolvendo a variável "i" como uma função de (i), então a saída esperada se parece com

[Renderização LaTeX da equação acima] (2.4) (i)

(o que na verdade significa que existem "i" tais equações). O (2.4) pode referir-se à Equação 4 da Seção 2. Quando eu acessar a equação posteriormente, gostaria que ela aparecesse como

Como a Equação (2.4)(n+1) segue da Equação (2.4)(n), use indução...

(EDITAR: Melhorou o texto para esclarecer as dúvidas nos comentários.)

Responder1

Vamos ver se adivinhei corretamente o que você deseja obter:

Saída do seguinte código

Esta saída foi gerada pelo seguinte código:

% My standard header for TeX.SX answers:
\documentclass[a4paper]{article} % To avoid confusion, let us explicitly 
                                 % declare the paper format.

\usepackage[T1]{fontenc}         % Not always necessary, but recommended.
% End of standard header.  What follows pertains to the problem at hand.

\usepackage{amsmath}

\numberwithin{equation}{section}

\newcommand*{\myTagFormat}[2]{(\ref{#1})($#2$)}



\begin{document}

\section{First}

Just to include a couple of equations:
\begin{align}
      1 &= 1 \label{eq:one} \\
    1+2 &= 3 \label{eq:two}
\end{align}
Until now, we have equations \eqref{eq:one} and~\eqref{eq:two}.

\section{Second}

Still another equation of the same form:
\begin{equation}
    1+2+3 = 6 \label{eq:three}
\end{equation}
Generalizing equations \eqref{eq:one}, \eqref{eq:two}, and~\eqref{eq:three}, we 
claim that
% Little trick:
\refstepcounter{equation}\label{eq:base}% <-- Note!
\begin{equation}
    1+2+\dots+n = \frac{n(n+1)}{2}
    \tag*{\myTagFormat{eq:base}{n}}\label{eq:base-n}
\end{equation}
Now you can either:
\begin{itemize}
    \item
        reference equation~\ref{eq:base-n} directly (note that you must use
        \verb|\ref| instead of \verb|\eqref|, here), or
    \item
        say that equation~\myTagFormat{eq:base}{i+1} follows from
        equation~\myTagFormat{eq:base}{i} by adding $i+1$ on both sides of the
        latter.
\end{itemize}
One more equation to check that we haven't spoiled the numbering:
\begin{equation}
    x=y
\end{equation}

\end{document}

Responder2

insira a descrição da imagem aqui

Usando mathtoolso comando package \newtagform, você pode personalizar a numeração das equações de maneira muito detalhada. A sintaxe geral do comando é:

\newtagform{label}[tag format]{left}{right}

É labelapenas um ID exclusivo para o método de marcação que pode ser recuperado usando o comando \usetagform{label}e lefté righto que deve ser escrito à esquerda e à direita da tag (geralmente colchetes). São tag formatos detalhes da marcação que você deseja. No seu caso particular, você pode usar a seguinte sintaxe:

[\renewcommand{\theequation}{(\arabic{chapter}.\arabic{section})(\roman{equation})}]

Depois de configurar o novo formato de numeração, você também deve alterar a forma como as equações aparecerão quando você referenciá-las. Para o estilo desejado, o código deve ser:

\renewcommand{\theequation}{(\arabic{chapter}.\arabic{section})(\roman{equation})}

Aqui está um exemplo de como essa numeração personalizada funciona:

\documentclass[]{report}
\usepackage{amsmath}
\usepackage{amssymb, amsfonts}
\usepackage{gensymb}
\usepackage{mathtools}
    \newtagform{Alph}[\renewcommand{\theequation}{(\arabic{chapter}.\arabic{section})(\roman{equation})}]{}{}
    \usetagform{Alph}
\renewcommand{\theequation}{(\arabic{chapter}.\arabic{section})(\roman{equation})}


\begin{document}


\chapter{First Chapter}

\section{First Section}
\label{sec:one}

\begin{equation}
I = I_{ ph } -  
\overbrace{
    I_{ rs }
    \biggl[
    exp \biggl(
    \frac{V + I R_{s}}{a \thinspace V_{t}}
    \biggl) - 1   
    \biggl]
    % overbrace title
}^{ I_{d} }
-
\overbrace{
    \frac{V + I R_{s}}{R_{p}}
    % overbrace title
}^{I_{p}}
%
\label{eq:I_PV_m}
\end{equation}

\begin{equation}
\label{eq:R_p}
%
R_{p} = R_{p,ref}  \biggl(   \frac{G_{ref}}{G_{op}}  \biggl)   \biggl(  \frac{T_{op}}{T_{ref}}  \biggl)^{\delta_{p}}
\end{equation}


\begin{equation}
PMARE = \underset{i}{max} 
\biggl|  \frac{x_{i}-y_{i}}{y_{i}}  \biggl| \times 100\%
\quad i = 1, 2, \cdots , n
%
\label{eq:PMPARE}
\end{equation}


     A test for referencing Eqs. \ref{eq:I_PV_m}, \ref{eq:R_p}, and \ref{eq:PMPARE} which belong to Section \ref{sec:one}.


\section{Second Section}
\label{sec:two}

\begin{equation}
\label{eq:R_{s}}
%
R_{s} = R_{s,ref}  \biggl(   \frac{T_{op}}{T_{ref}} \biggl)^{\delta_{s}}
\end{equation}


\begin{align}
I_{ph} &= I_{sc} \frac{R_{s} + R_{p}}{R_{p}}  \notag
\\
&= I_{sc,ref} \bigg[  1 + \frac{\alpha}{100} (T_{op}-T_{ref}) \biggl]
\frac{G_{op}}{G_{ref}} \frac{R_{s} + R_{p}}{R_{p}}
%
\label{eq:I_ph}
\end{align}


    A test for referencing Eqs. \ref{eq:R_{s}} and \ref{eq:I_ph}which belong to Section \ref{sec:two}.


\end{document}

Outros tipos de opções de numeração incluem \Roman(letras romanas maiúsculas) \alphe \Alph. Boa sorte

Responder3

Eu realmente não entendi a pergunta na primeira leitura e pensei que você queria algo comoesse.

Mas não era exatamente o que você queria porque minha resposta aí não pode dar resultados como (n+1)... mas se mudarmos um pouco podemos ter isso:

\makeatletter
\newcommand*\ifcounter[1]{%
  \ifcsname c@#1\endcsname%
    \expandafter\@firstoftwo%
  \else%
    \expandafter\@secondoftwo%
  \fi%
}%
\makeatother


\makeatletter
\newcommand\EqFamCustomTag[2]{%
\ifcounter{#1}{%
\expandafter\addtocounter{#1}{1}%
\xdef\temp{\csname #1 Eq\endcsname \space(#2)}%
\global\expandafter\let\csname #1\arabic{#1}\endcsname\temp%
\tag{\temp}%
}{%
\global\expandafter\newcounter{#1}%
\expandafter\addtocounter{#1}{1}%
\xdef\temp{\theequation\space(#2)}%
\xdef\eqonfamily{\theequation}%
\global\expandafter\let\csname #1 Eq\endcsname\eqonfamily%
\global\expandafter\let\csname #1\arabic{#1}\endcsname\temp%
\tag{\temp}%
\expandafter\addtocounter{equation}{1}
}%
}%
\makeatother

que pode ser usado assim:

\begin{equation}
 \frac{x^2}{2}+\frac{3\cdot y^2}{10}=2\EqFamCustomTag{Elliptic}{n+1}
\end{equation}

e te dar o que você quer... (espero)... Para numeração automática nas outras equações que você tem, você pode usar a da minha pergunta-resposta referida (Essa pergunta também começou...)

informação relacionada