-
Notifications
You must be signed in to change notification settings - Fork 107
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
Use smaller symbols for \triangleleft and \triangleright #2362
Conversation
@DominikPeters this PR would also need a few of the tests updated to match the new characters - see a local Btw the presented visual reasoning for transitioning to using the small Unicode character appears reasonable to me on a surface read. But @brucemiller may have more thoughts. |
As further datapoint, unicode-math uses U+25C1, and in fact loading unicode-math makes the triangles bigger in the PDF output. Not sure if this is unicode-math redefining the macro, or instead altering the font maps. |
Hmm, well, maybe. Of course, Unicode symbols don't come with a size (nor TeX commands, for that matter); the fonts that render them do. And so different fonts will have different sizes. There may be a reasonable expectation of size, particularly expecting a set of shapes to have the same size, or relative sizes for normal compared to "big" or "small". Given the somewhat random collection of symbols used in TeX, along with a different, though related, random collection in Unicode, it's kinda hard to come up with a completely consistent mapping. Apparently the So, while the example you showed seems compelling --- and you may be quite correct --- I'd be interested in looking at all the various triangles, boxes, big, small, etc (as defined in a variety of style files) and comparing the observed relative sizes in both pdflatex and with common (eg STIX) unicode fonts.before deciding on changes, |
I was curious so I checked: https://www.unicode.org/reports/tr25/ seems quite explicit about how big the triangles should be (see Table 2.5). Although I agree that one should check whether the fonts are following that idea or not. http://mirrors.ctan.org/macros/unicodetex/latex/unicode-math/unimath-symbols.pdf renders each character in several fonts (Latin Modern, STIX, Fira Math, etc). For U+25C1, it seems like they generally agree with the spec, that is, the left/right triangles are roughly the same size as their up/down counterparts. That should clarify the HTML side, at least. |
Hmm. Thanks for the links @xworld21 that should have clarified things, but alas!!!! So, if you look at the basic cm fonts, the |
Will this be addressed in your new approach to fonts? It sounds like you need a secondary font map 'glyph -> unicode' which uses the right codepoint depending on the actual font (and keep track of the font itself on top of the font family). This would probably matter also for the chancery vs roundhand script characters. |
On 9/22/24 08:30, Vincenzo Mantova wrote:
So, clearly, you'll get different relative sizes for things when you
select special fonts.
Will this be addressed in your new approach to fonts? It sounds like you
need a secondary font map 'glyph -> unicode' which uses the right
codepoint depending on the actual font (and keep track of the font
itself on top of the font family). This would probably matter also for
the chancery vs roundhand script characters.
The current code allows you do do that, I think, but the upcoming font
code mainly refines it and makes it more consistent. But setting up
these mappings is so tedious & error prone, that I'd wonder if it was
worthwhile, even so. Finding an appropriate Unicode-point that
convincingly corresponds to the glyph in a particular font, is hard
enough; finding 2 or more where one looks like this font, and the other
looks like that one, is generally hard or rare.
Well, except for the 2 current cases: geometric things where it's hard
to infer the designers intentions; and the chancery/roundhand
distinction. The latter is a special case, but I think it it will fit
the scheme, once I'm in a position to test.
|
I have spotted a few other things in glyphtounicode.tex, like some fonts swapping |
I've made an alternative PR #2422, that uses an intermediate size U+22B2, U+22B3 for the triangles, and also updates the affected tests. @DominikPeters Let me know if this looks reasonable to you. |
The current unicode symbols used by LaTeXML for
\triangleleft
and\triangleright
are larger than the symbols used when LaTeX is used. I propose changing the unicode symbols U+25C1 ◁ White Left-Pointing Triangle to U+25C3 ◃ White Left-Pointing Small Triangle, and similarly for right-pointing.Example document:
PDF:
![image](https://private-user-images.githubusercontent.com/3543224/327508913-d5fb4119-9edc-427c-a447-27312de652ec.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTA5MTEsIm5iZiI6MTczOTI1MDYxMSwicGF0aCI6Ii8zNTQzMjI0LzMyNzUwODkxMy1kNWZiNDExOS05ZWRjLTQyN2MtYTQ0Ny0yNzMxMmRlNjUyZWMucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTFUMDUxMDExWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NjFmMDVlMzc4MTA1YTIxZGJjODdkMzM0OGI1Mzg1OTIwNTc3OWE1NzFjMDFmOWI1YWEwZGRmZjAyZDFiMGUxYSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.72zEllY77dhvqjS1wJPW2byH1G5X6dTcaypVYyhruWs)
![image](https://private-user-images.githubusercontent.com/3543224/327508975-fd8d7ab6-00bc-46fd-92d5-2a322838aa07.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MzkyNTA5MTEsIm5iZiI6MTczOTI1MDYxMSwicGF0aCI6Ii8zNTQzMjI0LzMyNzUwODk3NS1mZDhkN2FiNi0wMGJjLTQ2ZmQtOTJkNS0yYTMyMjgzOGFhMDcucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI1MDIxMSUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNTAyMTFUMDUxMDExWiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9MzYzNjFkYTcwZWJhZmRjY2Y0ZDM0NWVhYWYxMjU2MTcwNmFjNWZlZDViMzVhY2YzMTc1MzdjMjZmNDdhZTI4NSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QifQ.gFlzId9dpExo2qdu4cf30nyrsXUC_1y5ipjYUnZ56A8)
![image](https://private-user-images.githubusercontent.com/3543224/327509747-a878a5ef-b119-4b1c-a38a-bfbca24f7b05.png?jwt=eyJhbGci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