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

Improve alignment of text nodes in make-cd #68

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jonsterling
Copy link

@jonsterling jonsterling commented May 2, 2022

Currently text nodes in a commutative diagram are vertically aligned on their baseline. This is an intuitive and reasonable default, but unfortunately it results in incorrect behavior when combined with snapping; in particular, there are many cases (depending on the physical height of a piece of math text) where drawing a fully horizontal or fully vertical arrow from one math node to another is impossible to achieve with precision, and instead it snaps to something that is at a strange angle. This problem is solved by setting the vertical alignment to be centered.

I am not sure that this is the actual best solution, but it solved the immediate problem for me. What do you think?

P.S. I have not yet succeeded in building TeXmacs on my machine, so I have just edited this code blindly --- so please don't merge unless you try it out. The way I tested this functionality was to create a new function in my own TeXmacs initialization script and add my own custom menu item for the new function.

Currently text nodes in a commutative diagram are vertically aligned on their baseline. This is an intuitive and reasonable default, but unfortunately it results in incorrect behavior when combined with snapping; in particular, there are many cases (depending on the physical height of a piece of math text) where drawing an fully horizontal or fully vertical arrow from one math node to another is impossible to achieve with precision, and instead it snaps to something that is at a strange angle. This problem is solved by setting the vertical alignment to be centered.

I am not sure that this is the actual best solution, but it solved the problem for me.
@mgubi
Copy link
Contributor

mgubi commented May 2, 2022

Note that you do not need to build TeXmacs in order to modify the scheme code. You can either overwrite the scheme files in your local TeXmacs $TEXMACS_PATH (on the Mac they are somewhere like /Applications/TeXmacs.app/Contents/Resources/share/TeXmacs/progs) or create a similar path in your $TEXMACS_HOME_PATH which usually is ~/.TeXmacs/progs. TeXmacs always look into $TEXMACS_HOME_PATH before resolving paths in $TEXMACS_PATH.

@jonsterling
Copy link
Author

That's great to know, thank you!

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

Successfully merging this pull request may close these issues.

2 participants