-
Notifications
You must be signed in to change notification settings - Fork 92
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
\rm deprecated in LaTeX #3037
Comments
Can we do a global replace instead of replacing "over time"? |
We can probably take care of most cases automatically by replacing appropriate regexes, but that's not that easy since we need to replace As for the other deprecated commands, I found in set.mm |
A glance through iset.mm shows mostly markup copy-pasted from set.mm. The goal is to keep these identical so it should be feasible to make the edits in set.mm and then copy-paste the syntaxes which are found in both over to iset.mm. Or any other means of achieving (roughly) that result. |
Per #3037, update the LateX to change from the deprecated \rm to the official \mathrm{...}. I started this using this regular expression: sed -E -i '' -e '/latexdef/s/\\rm (\\?[A-Za-z0-9\-^\.\[\]\;]+) *\}/\\mathrm{\1}}/g' set.mm iset.mm .. and then fixed others by hand. I fixed all the entries in set.mm, and many in iset.mm. If this approach seems reasonable we can fix the rest of iset.mm. Signed-off-by: David A. Wheeler <[email protected]>
I have good news, I know regular expressions https://xkcd.com/208/. I made a first stab here: |
Thanks for mentioning me, from my beginner side I can only say that |
Is it fixed if you set the maximum line width from within Metamath.exe? |
As stated in metamath/metamath-exe#129 (comment) setting a line length too high cuts the text out of the latex page. Latex editors don't show which lines generate the errors, they only show that there are some errors somewhere inside the proof (more specifically they collect all the errors and show them at the end of the proof, which is not helpful) . So I found it challenging the first times to figure out what was going on and why since editors just refused to compile. The fact that I spent time trying to understand the cause doesn't mean that other new members would be willing to do the same. I can totally see new Metamath users being discouraged by that, since this error is quite common and some steps are required to understand the cause. I didn't have any specific interest in the "rankidn" theorem, the example I provided was for demonstration purpose only, I just chose it because it was short and easy to understand. Also it's not even guaranteed that a resolving line width exists for all proofs, since for long ones this error appear multiple times, and line breaking could just fell inside a following curly bracket in the same statement or some others. So either it should be written somewhere that when an user sees those errors, he just have to "guess" an appropriate line width to fix it, or the line breaking itself should be adjusted. |
Yes, personally I agree with this approach, everything else looks like a palliative to me. |
Let's try to keep the different issues separate. "Open Latex curly brackets bug" metamath/metamath-exe#129 is about insertion of newlines within braces (which causes TeX errors). I suspect we'll change metamath-exe to stop generating newlines inside TeX, but whatever we do, that discussion belongs there. This issue is the problem of replacing |
While looking at #3039, I also saw that many of these definitions are actually meant to be |
I never use the feature but I just generated a tex file using metamath.c, and here are a few suggestions on the preamble:
|
@benjub - those sound plausible. Can you please create a new issue for those ideas? This issue is about replacing |
* Update LaTeX, \rm -> \mathrm Per #3037, update the LateX to change from the deprecated \rm to the official \mathrm{...}. I started this using this regular expression: sed -E -i '' -e '/latexdef/s/\\rm (\\?[A-Za-z0-9\-^\.\[\]\;]+) *\}/\\mathrm{\1}}/g' set.mm iset.mm .. and then fixed others by hand. I fixed all the entries in set.mm, and many in iset.mm. If this approach seems reasonable we can fix the rest of iset.mm. * Fix long lines * Remove unnecessary {..} around TeX \methrm In TeX, \mathrm{...} is a single unit. This removes the unnecessary {...} surrounding them in many cases. This was done by: ~~~~sh sed -E -e 's/\{\\mathrm\{([A-Za-z0-9;\\</#]+)\}\}/\\mathrm\{\1\}/g' set.mm \ > ,set mv ,set set.mm ~~~~~ Signed-off-by: David A. Wheeler <[email protected]> * Remove unnecessary {...} in TeX on iset.mm Signed-off-by: David A. Wheeler <[email protected]>
I've replaced @benjub - you said that:
If you can tell me what precisely should be replaced with what, I can do a lot of it. E.g., "replace ``\rm FOO I don't know what the TeX community prefers now, but I do know regular expressions :-). |
I think we can (soon) close this issue, but I'm hoping that @benjub will create a new issue identifying the other needed replacements :-). Teamwork! |
All Actually, apart from
Note: the expressions on the LHS above are not always surrounded by braces...
edit: I hadn't seen your latest message above. Tell me if this is enough or your prefer a new issue. |
Those Normally |
Sorry, I saw things about Tarski geometry so I assumed it was you ! But it's @sctfn (e.g., https://us.metamath.org/mpeuni/df-ofs.html). Actually, \bb is for a surrounding box, not for blackboard bold font. I don't know if the former or the latter was meant in the present case. You're right, I should have written |
I'm afraid I've not edited a LaTex file since 1995... :-) Please, feel free to apply any change that solves the issue Glauco |
I don't actually remember adding that! Feel free to change as needed. On Feb 20, 2023, at 12:17 PM, Benoit ***@***.***> wrote:
{\bb xxx} --> xxx
Those \bb are actually for symbols introduced by Scott Fenton and are still only in use in his mathbox, AFAICS.
Sorry, I saw things about Tarski geometry so I assumed it was you ! But it's @sctfn (e.g., https://us.metamath.org/mpeuni/df-ofs.html). Actually, \bb is for a surrounding box, not for blackboard bold font. I don't know if the former or the latter was meant in the present case.
You're right, I should have written \mathrm{xxx} above.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: ***@***.***>
|
All & especially @benjub ... I've been assuming that all generated TeX is in math mode. But I've found that
I get this error message:
|
Hmm, if I check out an old version:
I still get an error with
So maybe this is an unrelated problem (but I'd like to fix it). |
That's because the By the way, here is the tex file generated by my version, which is rather less that 45 lines long (edit: nevermind, I did
|
We should also remove |
Superseded by #3067. |
Since \rm is deprecated in LaTeX (it has been for 28 years), we should replace it overtime with \mathrm{...} (since symbol definitions assume we are in math mode) or at least use the latter for new symbols. Currently, set.mm has 828 occurrences of
\rm
.(Remark: also deprecated in LaTeX are: \rm, \it, \bf, \tt, \sc, \sl, \sf and also
$$ ... $$
for displayed equations.)The text was updated successfully, but these errors were encountered: