Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

End line of algblock with wrong indentation #25

Open
chicolucio opened this issue Feb 12, 2025 · 1 comment
Open

End line of algblock with wrong indentation #25

chicolucio opened this issue Feb 12, 2025 · 1 comment

Comments

@chicolucio
Copy link

Hi. I was trying to define a custom block with algblock but a strange issue happened. Always the last line has a wrong indentation.

Code:

\documentclass[12pt, a4paper]{article}

\usepackage[noEnd=false,indLines=true]{algpseudocodex}
\usepackage{algorithm}

\algblock[program]{Start}{End}

\begin{document}

\begin{algorithm}
    \caption{Example}
    \label{alg:example}
    \begin{algorithmic}[1]
        \Start
        \State  var1
        \State  var2
        \State result $\gets$ var1 * var2
        \State \Output result
        \End
    \end{algorithmic}
\end{algorithm}

\end{document}

Output:

Image

The line 6 has wrong indentation.

@chrmatt
Copy link
Owner

chrmatt commented Feb 12, 2025

Hi! I believe this is the same issue as #3. The reason is that the package redefines several things to get everything working. So if you want to define a custom block, you have to mimic how the package does it. This is described in the linked issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants