You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Just wondering if algorithms can be references as a hyperlinks as, for example, Equations. For example, the below latex equation could be referenced throughout a document, with the number being a hyperlink to the equation.
\begin{align}
x = 1 \label{eq:equation}\end{align}
If I try adding something similar to an algorithm environment (whether insider the algorithm or algorithmic environments), the algorithm does not compile, and as a result, does not show up on my webpage. That is, if I remove \label{alg:grad_descent} from the code below, the pseudocode block compiles and shows up.
<preid="eq:grad_descent" class="pseudocode" data-line-number=true>
\begin{algorithm}
\caption{Gradient Descent}
\begin{algorithmic}
\label{alg:grad_descent}
\REQUIRE{Function for computing loss function, $\ell_{MSE}$ (see Equation $\ref{eq:mse-matrix}$)}
\INPUT{Initial guess for weights $\mathbf{w}^{(0)}$}
\PROCEDURE{gradientDescent}{$K, \epsilon, \tau$}
\STATE{$k = 0$}
\WHILE{$k <K$\AND$\lVert\mathbf{w}^{(k)}-\mathbf{w}^{(k+1)}\rVert^2_2< \epsilon$}
\STATE{$\mathbf{w}^{(k+1)} = \mathbf{w}^{(k)}-\tau\nabla_{\mathbf{w}}\ell_{MSE}(\mathbf{w}^{(k)})$.}\STATE{$k\mathrel{+}= 1$}\ENDWHILE\ENDPROCEDURE\end{algorithmic}\end{algorithm}</pre>
Here is how I call pseudocode.js ( I call is internally, given that I am using MathJax 4.0.0-beta3).
Just wondering if algorithms can be references as a hyperlinks as, for example, Equations. For example, the below latex equation could be referenced throughout a document, with the number being a hyperlink to the equation.
If I try adding something similar to an
algorithm
environment (whether insider thealgorithm
oralgorithmic
environments), the algorithm does not compile, and as a result, does not show up on my webpage. That is, if I remove\label{alg:grad_descent}
from the code below, the pseudocode block compiles and shows up.Here is how I call
pseudocode.js
( I call is internally, given that I am using MathJax 4.0.0-beta3).The text was updated successfully, but these errors were encountered: