Does MathJaX _not_ support \pdiff ?

67 views
Skip to first unread message

Dan Starman

unread,
Nov 16, 2023, 3:11:35 PM11/16/23
to MathJax Users
Hello (this is my first post here!)

   I've tried using \pdiff {} {} under MathJaX, because it would save so much typing and unnecessary characters when working with many pages of partial differential equations!!!
   But it appears to not be supported. Is that true?

   If there is a way to use it under MathJaX, then how?

Dan, TheStarman

Davide Cervone

unread,
Nov 17, 2023, 9:22:48 AM11/17/23
to mathja...@googlegroups.com
I can not find any documentation on a \pdiff LaTeX command.  It does not seem to be listed at CTAN.org.  Do you know what package it is from?

Davide



--
You received this message because you are subscribed to the Google Groups "MathJax Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mathjax-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mathjax-users/08dea079-bfb7-4e94-9cc7-176eb33bdd16n%40googlegroups.com.

Dan Starman

unread,
Nov 17, 2023, 11:33:31 AM11/17/23
to mathja...@googlegroups.com
Hello Davide (and all other viewers),

   I found it on this page under the section "Fractions and Binomials" :
https://cortexjs.io/mathlive/reference/commands/
And the menu at the left states that these are "LaTeX Commands"... although I can see the site is for "CortexJS," if this is not a true "LaTeX" math command, I'm not sure who to complain about it.

Dan, TheStarman.



You received this message because you are subscribed to a topic in the Google Groups "MathJax Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/mathjax-users/aGmX3YpWLcg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to mathjax-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mathjax-users/D78E3573-478A-4FFC-8F1A-FF9FEE6C44C7%40gmail.com.

David W. Farmer

unread,
Nov 17, 2023, 11:38:13 AM11/17/23
to mathja...@googlegroups.com

Can't you just define your own \pdiff newcommand which takes 2 arguments?
> https://groups.google.com/d/msgid/mathjax-users/CAL3wbFQ9t5fQ9aP9xbej29wG77wR0HXbsakdtETZt_oxr%2Bf16Q%40mail.gmail.com.
>
>

Dan Starman

unread,
Nov 17, 2023, 12:05:32 PM11/17/23
to mathja...@googlegroups.com
Hello David,

   Thank you for your reply.  First, be aware that I am very new to all of this; having encountered any LaTeX commands only last month when I came across some examples somewhere for using them under MathJaX. I've had no other input other than seeing some other examples at "tex.stackexchange.com" and then using trial and error to create my pages here:

   For example, it took me some time to finally get \colorbox to work as expected! I not only had to switch to V.3 of MathJaX; which I don't mind at all, since no 'configuration' is necessary (which I was never able to get to work for me!), and also because anyone seeing a page like this for the first time won't be 'sidetracked' by the V.2 menu system popping-up when hovering over the equations (and might also write me asking how they can see something on the page that is neither a picture nor text).

   I'd be most appreciative of any clear examples (you can see my HTML code if you know how to download it under, for example, Firefox or Chrome or any other smart browser) that show how to set up a "newcommand" configuration (or some more comprehensive teaching pages with working examples for doing so).
   If you have any other recommendations for making my pages there better, or especially a very good page to link to for "LaTeX" (like the link I did to "MathJaX" at the bottom of each page), that would be nice too.


Dan, TheStarman

David W. Farmer

unread,
Nov 17, 2023, 12:20:57 PM11/17/23
to mathja...@googlegroups.com

Dear Dan,

You have very basic questions about LaTeX. The MathJax group is
primarily about questions specific to MathJax, from people who
know LaTeX and now want to put math on a web page.

The Overleaf documentation is pretty good. To see how to define
macros:

https://www.overleaf.com/learn/latex/Commands

In particular, the section "Commands with parameters".

Just put your macro definition near the beginning of the
page, and then use it. (There are other ways, but that will
get you started.)

Regards,

David
> https://groups.google.com/d/msgid/mathjax-users/CAL3wbFTfbNs2zFV4tOqU0r40wPaC710P-60dohiac7FmpbU-jg%40mail.gmail.com.
>
>

Dan Starman

unread,
Nov 17, 2023, 12:32:52 PM11/17/23
to MathJax Users
Thank you again for your reply David,

   I will spend more time at the Overleaf site and try as you suggested to shrink my page with some "newcommands". I believe it was an Overleaf page that I first saw some examples at that used MathJaX for displaying LaTeX math commands.


Dan, TheStarman

Dan Starman

unread,
Nov 17, 2023, 3:09:11 PM11/17/23
to mathja...@googlegroups.com
Hello David and everyone,

   Just a 'followup' to say I was finally able to get "\newcommand" to work under MathJaX version 3.
  
   The biggest problem I had was in not finding any actual working examples that were written specifically for doing so under MathJaX, and most disappointingly, not on this page either:

   Here's something real specific for anyone who happens upon this thread:
  
\newcommand{\pddif}[2]{\frac{\partial #1}{\partial #2}}

The MathJaX page above very much implies that these commands come preloaded, but what it doesn't tell you is that you must place a single "$" sign around it in order for it to work:

$\newcommand{\pddif}[2]{\frac{\partial #1}{\partial #2}}$

And then you can get something like this to work:
$$\pddif{x}{y}$$

And, of course, none of the sites that deal only with "LaTeX" documents had anything like that either.


Thank you all again,
Dan, TheStarman

Davide Cervone

unread,
Nov 17, 2023, 4:42:10 PM11/17/23
to mathja...@googlegroups.com
Just a 'followup' to say I was finally able to get "\newcommand" to work under MathJaX version 3.

Glad you got it to work.  (It works the same in v2 as well.)

The biggest problem I had was in not finding any actual working examples that were written specifically for doing so under MathJaX, and most disappointingly, not on this page either:

As with this issue tracker, the MathJax documentation is about using MathJax, not about learning LaTeX, so there are not the kinds of examples you are looking for.  There are lots of LaTeX tutorials on line, and one specifically around MathJax can be found at


The MathJaX page above very much implies that these commands come preloaded, but what it doesn't tell you is that you must place a single "$" sign around it in order for it to work:

$\newcommand{\pddif}[2]{\frac{\partial #1}{\partial #2}}$

Note that the page you link to does include an example of defining macros, and it does include the default LaTeX delimiters, which are "\( ... \)" (equivalent to dollar signs "$ ... $"), though it is true that it doesn't highlight that.  There is also a link on the page you cite, just below the first example, to "Defining TeX Macros":


and that page says explicitly:

Unlike actual TeX, however, in order for MathJax to process such definitions, they must be enclosed in math delimiters (since MathJax only processes macros in math-mode).

So that does indicate that you need to include the delimiters, and why.

Davide

Dan Starman

unread,
Nov 17, 2023, 6:35:57 PM11/17/23
to mathja...@googlegroups.com
Thank you very much for the explanations about the MathJaX page and link, Davide, and for the tutorial link at StackExchange!
Hopefully this thread will be helpful to someone 'googling' \newcommand' in the future.

Dan, TheStarman

Reply all
Reply to author
Forward
0 new messages