2
$\begingroup$

MathJax does not work for hyperbolic $ \sech \,x$... Can it be now included? Thanks in advance.

EDIT1:

From user1729's comment suggestion, they work okay:

$$\operatorname{sech}(x) $$

$$ \DeclareMathOperator{\sech}{sech} $$

$$\sech (y)$$

$\endgroup$
  • $\begingroup$ Do you know that you can define it manually? \operatorname{sech}(x) renders as $\operatorname{sech}(x)$. $\endgroup$ – user1729 Jan 15 at 9:40
  • $\begingroup$ Also, you can use \DeclareMathOperator{\sech}{sech}$\DeclareMathOperator{\sech}{sech}$ to define it everywhere in your post. So typing sech(x) now gives $\sech(x)$. (There is a way, or used to be a way, to define commands for a whole page, but I can't remember it at the moment.) $\endgroup$ – user1729 Jan 15 at 9:44
  • $\begingroup$ $\csch$ doesn't work either, but $\coth$ does. It's not just Mathjax: those commands aren't in Latex either. $\endgroup$ – Peter Phipps Jan 15 at 11:48
  • $\begingroup$ Thanks. First one works, but the second one ( *Declare..) does n't seem to. May be all hyperbolic functions and their inverses should be made readily available without user definition. $\endgroup$ – Narasimham Jan 15 at 16:20
  • 2
    $\begingroup$ This answer mentions various way to define things locally (in one post) - using \DeclarMathOperator, \newcommand, \def, \let. @user1729 The scope of a macro is now only a single post (or a single comment) and not the entire page - this was changed in January 2019, the change was announced in this answer. $\endgroup$ – Martin Sleziak Jan 15 at 16:51
  • $\begingroup$ \DeclareMathOperator should work, in the sense that it worked above for me... $\endgroup$ – user1729 Jan 15 at 16:51
  • $\begingroup$ @Martin Thanks for the links. It's good that the scope was changed; it's silly otherwise (as the links demonstrate!). $\endgroup$ – user1729 Jan 15 at 16:53
  • $\begingroup$ @1729 both work, may be was some error. $\endgroup$ – Narasimham Jan 15 at 17:16
3
$\begingroup$

To make my comments into an answer:

Firstly, you can define it manually, so \operatorname{sech}(x) renders as $\operatorname{sech}(x)$. A more fancy way is to put \DeclareMathOperator{\sech}{sech} somewhere in your post, and then \sech will work everywhere in the post.

For example, I'll declare the operator (invisibly) here: $\DeclareMathOperator{\sech}{sech}$

And it renders nicely here: $\sech(x)$

(Click on "edit", below, to see my code.)


There are other ways to do this. For example, you can use \newcommand rather than \DeclareMathOperator: \newcommand{\csch}{\operatorname{csch} $\newcommand{\csch}{\operatorname{csch}}$ gives $\csch(x)$.

(One way not to do it is to use \mathrm{csch} rather than \operatorname{csch}. For example, \operatorname{csch}x $\operatorname{csch}x$ is correctly spaced while \mathrm{csch} $\mathrm{csch}x$ is not. See here for more details.)

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .