PCCMathSAC / apex-mbx

Repository for a conversion of APEX Calculus to MathBook XML
2 stars 10 forks source link

Manual changes to analytic limits. #43

Closed CVollet closed 8 years ago

CVollet commented 8 years ago

Added implied function macro, fixed some xrefs and added a few asides.

Alex-Jordan commented 8 years ago

David, make sure that any automated changes you make now exclude sec_limits_intro, sec_limits_def, and sec_limits_analytically.

On Wed, Sep 14, 2016 at 4:17 PM, CVollet notifications@github.com wrote:

Added implied function macro, fixed some xrefs and added a few asides.

You can view, comment on, or merge this pull request online at:

https://github.com/PCCMathSAC/apex-mbx/pull/43 Commit Summary

  • Manual changes to analytic limits. Added implied function macro, fixed some xrefs

File Changes

Patch Links:

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/PCCMathSAC/apex-mbx/pull/43, or mute the thread https://github.com/notifications/unsubscribe-auth/AEg3ACWxndluUqgTEe0z-0SNoedvTdENks5qqICVgaJpZM4J9WMk .

Alex Jordan Mathematics Instructor Portland Community College

Alex-Jordan commented 8 years ago

Just realized \fi was a bad choice. It took seeing it on the screen for me to remember that \fi is a core LaTeX command we shouldn't mess with. I'm going to approve this, but if you wouldn't mind changing it to something else.

The purpose is to allow toggling of whether you get "sin(x)" and "ln(x)" or "sin x" and "ln x". I can't come up with the perfect name for such a macro.

Also if anyone wants to vote for "just make it always 'sin(x)' ", that would be great too. Because of local strongly held opinions, we need parentheses everywhere for the PCC version.

davidfarmer commented 8 years ago

Just make it sin(x) everywhere and nobody will object.

I am really against \fe{\sin}{x), because that just breaks the source code for pretty much everyone else who wants to join the project. There are enough hurdles already, and changing the way you write functions will just sound crazy to people.

However, I completely understand why you want do to it; we had an APEX conversion google group discussion about this in early July. Back then I claimed, and I still claim, that I can write a script that does the vast majority of those conversions automatically. So you can have the production version look like you want, and the source can look like I want, but there is one extra step between nice source and nice output.

Similarly, a script can take away all of those carriage returns that make the source human-readable. That is much easier than a script that prettyprints the source.

So, I suggest we tolerate the slightly bad output from human readable source, and I'll provide a script that overcomes the current limitations of the conversion.

On Wed, 14 Sep 2016, Alex Jordan wrote:

Just realized \fi was a bad choice. It took seeing it on the screen for me to remember that \fi is a core LaTeX command we shouldn't mess with. I'm going to approve this, but if you wouldn't mind changing it to something else.

The purpose is to allow toggling of whether you get "sin(x)" and "ln(x)" or "sin x" and "ln x". I can't come up with the perfect name for such a macro.

Also if anyone wants to vote for "just make it always 'sin(x)' ", that would be great too. Because of local strongly held opinions, we need parentheses everywhere for the PCC version.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.[AAM6LIj-cD69rYgaIs8uDPOHUGqAgMLyks5qqIOrgaJpZM4J9WMk.gif]

Alex-Jordan commented 8 years ago

However, I completely understand why you want do to it; we had an APEX conversion google group discussion about this in early July. Back then I claimed, and I still claim, that I can write a script that does the vast majority of those conversions automatically. So you can have the production version look like you want, and the source can look like I want, but there is one extra step between nice source and nice output.

Are you saying that in source we would always use plain parentheses like $c(\frac{x^2}{2}+1)$

and your script would turn all such pairs into

$c\mathopen{}\left(x^2+1\right)\mathclose{}$

?

Maybe that would be OK. "c" can be a variety of things though, in a formal math mode LaTeX sense. An ordinary character, a big operator, a binary operator, a relation, another opening paren, a closing paren, and that's hopefully all we'd have to worry about. I suppose we should check that $c\mathopen{}\left(x^2+1\right)\mathclose{}$ is appropriate for all the things c could be. I think it is, but this feels like there's a gotcha in there somewhere. And then there's also things on the right.

OK, I went off to test. I did find one or two gotchas. If the parens grouping has a ^ or _ following it, then you have to do like:

$c\mathopen{}\left(x^2+1\right)^2\mathclose{}$

not like

$c\mathopen{}\left(x^2+1\right)\mathclose{}^2$

and remember the contents of the exponent could be more complex than just a

  1. And there could be nested exponents.... So it would be more complicated than a straight swapping of simple (...) for \mathopen{}\left(...\mathopen{}\right)

Are you willing to take that on in a script?

Similarly, a script can take away all of those carriage returns that make the source human-readable. That is much easier than a script that prettyprints the source.

So, I suggest we tolerate the slightly bad output from human readable source, and I'll provide a script that overcomes the current limitations of the conversion.

On Wed, 14 Sep 2016, Alex Jordan wrote:

Just realized \fi was a bad choice. It took seeing it on the screen for me to remember that \fi is a core LaTeX command we shouldn't mess with. I'm going to approve this, but if you wouldn't mind changing it to something else.

The purpose is to allow toggling of whether you get "sin(x)" and "ln(x)" or "sin x" and "ln x". I can't come up with the perfect name for such a macro.

Also if anyone wants to vote for "just make it always 'sin(x)' ", that would be great too. Because of local strongly held opinions, we need parentheses everywhere for the PCC version.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.[AAM6LIj-cD69rYgaIs8uDPOHUGqAgMLyks5qqIOrgaJpZM4J9WMk.gif]

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/PCCMathSAC/apex-mbx/pull/43#issuecomment-247198366, or mute the thread https://github.com/notifications/unsubscribe-auth/AEg3ACmvP8m2oOkp6uZCmQBmRaPbeybcks5qqJGKgaJpZM4J9WMk .

Alex Jordan Mathematics Instructor Portland Community College

davidfarmer commented 8 years ago

Dear Alex,

The script I will/(claim I can) write, would replace

c(\frac{x^2}{2}+1)

by

\fe{c}{\frac{x^2}{2}+1}

and

c(\frac{x^2}{2}+1)^2

by

\fe{c}{\frac{x^2}{2}+1}^2

In other words function evaluation, \fe, is shown explicitly. What I am doing is semantic. But it is supposed to fix the presentation problem which you have raised. And you have to write the \fe macro which takes care of the presentation.

Note: I think it is good to use \left( and \right) in the original source, because that is the normal thing to do when the thing in parentheses is big. Just write LaTeX like normal (well, normal for people who have a clue what they are doing). Most people won't even notice anything different with the \fe version.

Do I get the idea, or do I have to do something different?

Regards,

David

On Wed, 14 Sep 2016, Alex Jordan wrote:

However, I completely understand why you want do to it; we had an APEX conversion google group discussion about this in early July. Back then I claimed, and I still claim, that I can write a script that does the vast majority of those conversions automatically. So you can have the production version look like you want, and the source can look like I want, but there is one extra step between nice source and nice output.

Are you saying that in source we would always use plain parentheses like $c(\frac{x^2}{2}+1)$

and your script would turn all such pairs into

$c\mathopen{}\left(x^2+1\right)\mathclose{}$

?

Maybe that would be OK. "c" can be a variety of things though, in a formal math mode LaTeX sense. An ordinary character, a big operator, a binary operator, a relation, another opening paren, a closing paren, and that's hopefully all we'd have to worry about. I suppose we should check that $c\mathopen{}\left(x^2+1\right)\mathclose{}$ is appropriate for all the things c could be. I think it is, but this feels like there's a gotcha in there somewhere. And then there's also things on the right.

OK, I went off to test. I did find one or two gotchas. If the parens grouping has a ^ or _ following it, then you have to do like:

$c\mathopen{}\left(x^2+1\right)^2\mathclose{}$

not like

$c\mathopen{}\left(x^2+1\right)\mathclose{}^2$

and remember the contents of the exponent could be more complex than just a

  1. And there could be nested exponents.... So it would be more complicated than a straight swapping of simple (...) for \mathopen{}\left(...\mathopen{}\right)

Are you willing to take that on in a script?

Similarly, a script can take away all of those carriage returns that make the source human-readable. That is much easier than a script that prettyprints the source.

So, I suggest we tolerate the slightly bad output from human readable source, and I'll provide a script that overcomes the current limitations of the conversion.

On Wed, 14 Sep 2016, Alex Jordan wrote:

Just realized \fi was a bad choice. It took seeing it on the screen for me to remember that \fi is a core LaTeX command we shouldn't mess with. I'm going to approve this, but if you wouldn't mind changing it to something else.

The purpose is to allow toggling of whether you get "sin(x)" and "ln(x)" or "sin x" and "ln x". I can't come up with the perfect name for such a macro.

Also if anyone wants to vote for "just make it always 'sin(x)' ", that would be great too. Because of local strongly held opinions, we need parentheses everywhere for the PCC version.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or mute the thread.[AAM6LIj-cD69rYgaIs8uDPOHUGqAgMLyks5qqIOrgaJpZM4J9WMk.gif]

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/PCCMathSAC/apex-mbx/pull/43#issuecomment-247198366, or mute the thread https://github.com/notifications/unsubscribe-auth/AEg3ACmvP8m2oOkp6uZCmQBmRaPbeybcks5qqJGKgaJ pZM4J9WMk .

Alex Jordan Mathematics Instructor Portland Community College

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.[AAM6LE4eByuVS7r2D1ecG1qLrQSVUClyks5qqLltgaJpZM4J9WMk.gif]

davidfarmer commented 8 years ago

In Theorem 2.3.4 and the display following, the parentheses are explicity sized as "\Big". What to we do with that? (Here "d/dx" is the function being evaluated.)

Alex-Jordan commented 8 years ago

Thanks for trying to work through this with me. Following what you just described, there would be some problems. Sometimes there will be

c(\frac{x^2}{2}+1)^2

where the "c" is something to be multiplied, not a function. Like 2, x, x^2, (1+x), x^{y^2}, etc. The source would be manually written:

c\left(\frac{x^2}{2}+1\right)^2

But anything that automatically changed this to

\fe{c}{\frac{x^2}{2}+1}^2

would be bad. Semantically, of course, because anyone who learns the macro will see it as function evaluation. But it will also be bad because it will unwrap as

$c\mathopen{}\left(x^2+1\right)\mathclose{}^2$

which positions the superscript 2 too low. (The right thing to get out would be $c\mathopen{}\left(x^2+1\right)^2\mathclose{}$.)

This is the obstacle I see to automating it. Like many of these things, I don't know how many instances of the "bad" situations like this would actually occur through this book though and make my concern not worth fretting over.


In at least one place where some variant of \big was used, it looked wrong to me. I say we change all such things to \left...\right. And bring in \mathopen{}, \mathclose{} when needed to correct the spacing.

davidfarmer commented 8 years ago

Dear Alex,

If your main concern is correctly identifying which cases are function evaluation, and which cases are multiplication by juxtaposition, then I am prepared to deal with that.

So what I meant to say was: If c(blah) is the function c applied to blah, then I'll convert it to \fe{c}{blah}. Otherwise do nothing.

If there is yet another conversion needed for the non-function-application cases (which you seem to be indicating by your use of \mathopen and \mathclose), then let's take care of that later.

I am trying to resist the temptation of working on this now, because there are more pressing, but less interesting, things to do.

Regards,

David

ps. Here it a tricky case:

\vec c(t) =

needs to become

\fe{\vec c}{t} =

On Thu, 15 Sep 2016, Alex Jordan wrote:

Thanks for trying to work through this with me. Following what you just described, there would be some problems. Sometimes there will be

c(\frac{x^2}{2}+1)^2

where the "c" is something to be multiplied, not a function. Like 2, x, x^2, (1+x), x^{y^2}, etc. The source would be manually written:

c\left(\frac{x^2}{2}+1\right)^2

But anything that automatically changed this to

\fe{c}{\frac{x^2}{2}+1}^2

would be bad. Semantically, of course, because anyone who learns the macro will see it as function evaluation. But it will also be bad because it will unwrap as

$c\mathopen{}\left(x^2+1\right)\mathclose{}^2$

which positions the superscript 2 too low. (The right thing to get out would be $c\mathopen{}\left(x^2+1\right)^2\mathclose{}$.)

This is the obstacle I see to automating it. Like many of these things, I don't know how many instances of the "bad" situations like this would actually occur through this book though and make my concern not worth fretting over.


In at least one place where some variant of \big was used, it looked wrong to me. I say we change all such things to \left...\right. And bring in \mathopen{}, \mathclose{} when needed to correct the spacing.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.[AAM6LPN-tlWcmrxblyFEA6nduxLxC9gkks5qqX1FgaJpZM4J9WMk.gif]

Alex-Jordan commented 8 years ago

Please resist for now. In your leisure time, keep thinking of tricky cases.

\frac{d}{dt} f(t) needs to become \fe{\frac{d}{dt} f}{t} (or use one of my other macros for Leibniz notation, which is an entirely new can of worms)

f^n(t) becomes \fe{f^n}{t}

Trickiest of all, c(t+1) becomes \fe{c}{t+1} when c is a function in context, but is left alone when c is standing for some constant.