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

Indentation Lines of algpseudocodex does not work in RTL cases #26

Open
Hosein-Rahnama opened this issue Mar 9, 2025 · 3 comments
Open

Comments

@Hosein-Rahnama
Copy link

Hosein-Rahnama commented Mar 9, 2025

I am trying to create a template for algorithms in Persian. I have a piece of code given on this stack exchange post, where I am using algpseudocode along with algorithm package. This setup works nicely; however, I would also like to have indentation lines in my algorithms so I tried to use algpseudocodex with noEnd option, which has this feature. Although, this nicely works for algorithms in English, it is totally messed up in Persian. How can I fix this?

@chrmatt
Copy link
Owner

chrmatt commented Mar 9, 2025

The package always starts drawing the indentation lines at the beginning of the line. For right-to-left code, it would need to start at the end of the line instead. I don't think there is an easy fix for this; it would require an alternative logic to handle this case.

@Hosein-Rahnama
Copy link
Author

Hosein-Rahnama commented Mar 9, 2025

Hey Christian,

Thanks for your attention and reply. I don't think that it would be too difficult as we already have a case that is working. If you look at the link I provided, you will notice that in case that I use algpseudocode, the algorithm looks nice and fine, while the order of text corresponding to the commands is right to left; however, when I use algpseudocodex the order of the text is messed up. You have said in the documentation that algpseudocodex is compatible with algpseudocode, so there must be some changes causing this incompatibility.

@chrmatt
Copy link
Owner

chrmatt commented Mar 9, 2025

Yes, there are some changes required to enable the indent lines and some other features. I have not considered the RTL case at all when doing this, so there are some things that break in this case. It's thus not fully compatible, unfortunately.

You are right that it would probably not be too hard to fix the order of text. However, getting the indent lines on the correct side would require some fundamental changes to the logic. In particular, it would require to handle the RTL case specifically and distinguish the two cases in several places. While this could certainly be done, it would require a fair amount of work.

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