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

Negative values in TextBlock #369

Open
lukzapo opened this issue Jun 13, 2023 · 0 comments
Open

Negative values in TextBlock #369

lukzapo opened this issue Jun 13, 2023 · 0 comments

Comments

@lukzapo
Copy link

lukzapo commented Jun 13, 2023

Encountered an issue where I wanted to pass a negative value for vertical_pos while calling TextBlock class.

TextBlock(width, horizontal_pos, vertical_pos)

Once a negative value was passed, dumps() would show that negative value as {-}123 instead -123
I found issue #144 and #276 which suggested to use NoEscape() however that not solved my issue at all. After digging into the code I found the issue in utils.py file.

While joining strings for TeX dumping in escape_latex() the function checks for specific LaTeX escape characters in _latex_special_chars' dictionary. Here the code finds that if '-' is encountered, it is supposed to be rendered as '{-}'. After removing this item from the dictionary all my code compiles just fine. I don't know exactly in what cases '-' has to be rendered with curly brackets, but so far I had no issues (and I use plenty of '-' for other functions etc.)

Could this bugfix be potentially further tested and implemented if it passes checks?

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

1 participant