-
Notifications
You must be signed in to change notification settings - Fork 2
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
url package is tagged as Formula if the math code is loaded #5
Comments
@davidcarlisle once commented that putting Please can you tell me where to find the code you are using to "grab math stuff" : file, location and branch. Thanks. |
Is it obvious that the use of mathmode is a necessary, or wise, method by which to format a URL? |
develop branch latex-lab/latex-lab-math.dtx (or something like that) |
may be historic and Donald's style of coding, you can do some tricks if you pretend you are in math |
it's not for math as such but for |
I hope to convince someone (@josephwright) at some time to write a replacement, the current implementation for example can't handle unicode properly, but for now we have to take what is there. |
@u-fischer OK, I'll add it to the to-do list. Could we start a formal spec list somewhere so I don't start on the wrong path? |
I think Donald is using math mode to get fine control of line breaking: not sure if a non-math mode solution is really viable as a result. |
Yet another strange way to make use of TeX's abilities! |
sure we all came up with tricks like that to make things work in limited space (this is why I said using math mode for tricks because it was a bit more that the math active). @josephwright I'm not sure that it would be that hard conceptually by parsing through the url token by token. On the other hand, it might be simpler to just accept that mmode is sometimes misused for its technical possibilities and all we would need to do for this is to have a reasonable simple flag to ensure that no tagging happens (which could be a simple as requiring |
@FrankMittelbach I think on reflection you are fight. My feeling is we really should look to 'fix' these uses but we also need to at least try to 'handle' them. So yes, some form of flag to say 'not maths' is a good idea, but we should also try over time to re-implement the 'abuses' so we don't need math mode: I suspect a 'not maths' flag will have edge cases where it falls. |
Yes, a flag to say "not math" is a good idea, and also a flag "this is math", to overwrite the |
I just checked and: @josephwright did fix the So there must be some other reason why it grabs the math in this case. |
Why would you need to overwrite the |
interesting ... some grouping that interfers perhaps? |
Not sure: I did not check the details of what |
If I do the following the first three are tagged as math, only the last one is normal text:
|
@u-fischer We had some back-and-forward about |
I'm surprised you say "before" and also surprised if that is what amsmath does, because it means you have to add an extra (unnecessary) group to keep the change local, which you get for free if you put it inside the dollars. So I always thought we implemented However, seeing how it is used in amsmath I guess you are right and we should not look for |
As a reminder, we find in \def\@mathmeasure#1#2#3{\setbox#1\hbox{\frozen@everymath\@emptytoks
\m@th$#2#3$}} and \def\plainroot@#1\of#2{\setbox\rootbox\hbox{%
$\m@th\scriptscriptstyle{#1}$}%
\def\r@@t#1#2{\setboxz@h{$\m@th#1\sqrtsign{#2}$}%
\dimen@\ht\z@\advance\dimen@-\dp\z@
\setbox\@ne\hbox{$\m@th#1\mskip\uproot@ mu$}%
\advance\dimen@ by1.667\wd\@ne
\mkern-\leftroot@ mu\mkern5mu\raise.6\dimen@\copy\rootbox
\mkern-10mu\mkern\leftroot@ mu\boxz@} |
@josephwright wrote: Maybe we did, but then later it got changed, as I just explained, to not grab the any math that contains it. I did actually check Also, which $, the first or last. Anyway, that is certainly not what the current implementation. That was because it also shows up in 'real' maths (amsmath, etc.). I one believed that took but I have not yet found any examples of this, at least not in amsmath. Where it does occur is in connection with math that is itself contained in "faketext", such as when an alignment or an hbox is used within math to format some purely mathematical construct, Some time ago I wrote an essay to describe a reasonably robust method of distinguishing (within math) between such faketext and real text within the math. This should be implemented so that real math within real text should be grabbed in cases where the current setup does not grab it. I wonder where that file is now? |
For emphasis: |
@FrankMittelbach wrote: However, seeing how it is used in amsmath . . . because quite Please can you point to any example of this that is not immediately inside "faketext", such as an hbox or vbox+array. I really need to find any such examples if they exist. |
@josephwright All of those are examples of "faketext", as I explained. |
Also, of course, if the |
Well actually that is not true. After looking at the emails and code I think @car222222 is quite right. Math is not processed if
gives The problem is only with the tagging code which is outside the processor in
|
Well, that is all Frank's (or maybe Ulrike's?) code, which has probably not been checked. I have not seen it before today. Logically, it would seem reasonable to me that the tagging |
\url
uses internally math mode and this is grabbed and tagged as Formula. The problem is that url does set\m@th
but inside the math at the end:This can be corrected by moving
\m@th
into\Url@MathSetup
, but I wonder if a dedicated command to mark "fake math" is needed, and if the code should detect\m@th
inside dollars?The text was updated successfully, but these errors were encountered: