In this algorithm format I want the the "Considering the jth…." to be having the same indentation throughout even in newline.
The Code is as follows:
\documentclass{article}
\usepackage{amsmath}
\usepackage{algorithm}
\usepackage[noend]{algpseudocode}
\makeatletter
\def\BState{\State\hskip-\ALG@thistlm}
\makeatother
\begin{document}
\begin{algorithm}
\caption{hello}\label{euclid}
\begin{algorithmic}[1]
\Procedure{ASAPP}{}
\State $\textit{i} \gets \text{0}$, $\textit{j} \gets \text{0}$, $\textit{k} \gets \text{0}$
\While {i $\leq$ nom}
\While {j $\leq C_{i}$}
\State Considering the \textit{j}th edge of the \textit{i}th metabolite, \textit{x} and \textit{y} contains the vertices of the \textit{j}th edge
\State $\textit{k} \gets \text{\textit{j} + 1}$
\While { k $\leq C_{i}$}
\State Considering the \textit{k}th edge of the \textit{i}th metabolite, \textit{x1} and \textit{y1} contains the vertices of the \textit{k}th edge.
\EndWhile
\EndWhile
\EndWhile
\BState \emph{top}:
\EndProcedure
\end{algorithmic}
\end{algorithm}
\end{document}
Best Answer
You can use
tabularx
to figure out the width of a box that would fit until the end of the line:\multiline{<stuff>}
sets its contents in atabularx
that is aligned at the[t]
op inside anX
-column. The width of this column is the difference of a regular\linewidth
minus the current algorithm line indent.