diff options
Diffstat (limited to 'Master/texmf-doc/doc/english/FAQ-en/html/FAQ-newfunction.html')
-rw-r--r-- | Master/texmf-doc/doc/english/FAQ-en/html/FAQ-newfunction.html | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/Master/texmf-doc/doc/english/FAQ-en/html/FAQ-newfunction.html b/Master/texmf-doc/doc/english/FAQ-en/html/FAQ-newfunction.html new file mode 100644 index 00000000000..2651b36a52d --- /dev/null +++ b/Master/texmf-doc/doc/english/FAQ-en/html/FAQ-newfunction.html @@ -0,0 +1,34 @@ +<head> +<title>UK TeX FAQ -- question label newfunction</title> +</head><body> +<h3>Defining a new log-like function in LaTeX</h3> +<p>Use the <code>\</code><code>mathop</code> command, as in: +<pre> + \newcommand{\diag}{\mathop{\mathrm{diag}}} +</pre> +<p>Subscripts and superscripts on <code>\</code><code>diag</code> will be placed as they are on +<code>\</code><code>lim</code>. If you want your subscripts and superscripts always placed +to the right, do: +<blockquote> + +<pre> +\newcommand{\diag}{\mathop{\mathrm{diag}}\nolimits} +</pre> +</blockquote> +<p>AMSLaTeX (in its <i>amsopn</i> package) provides a command +<code>\</code><code>DeclareMathOperator</code> that takes does the same job as the first +definition above. To create our original <code>\</code><code>diag</code> command, one would +say: +<pre> + \DeclareMathOperator{\diag}{diag} +</pre> +<code>\</code><code>DeclareMathOperator*</code> declares the operator always to have its +sub- and superscripts in the +"<a href="FAQ-limits.html"><code>\</code><code>limits</code> position</a>". +<p>(It should be noted that "log-like" was reportedly a <em>joke</em> on +Lamport's part; it is of course clear what was meant.) +<dl> +<dt><tt><i>amsopn.sty</i></tt><dd>In the AMSLaTeX distribution <a href="ftp://cam.ctan.org/tex-archive/macros/latex/required/amslatex.zip">macros/latex/required/amslatex</a> (<a href="ftp://cam.ctan.org/tex-archive/macros/latex/required/amslatex.tar.gz">gzipped tar</a>, <a href="http://www.tex.ac.uk/tex-archive/macros/latex/required/amslatex/">browse</a>) +</dl> +<p><p>This question on the Web: <a href="http://www.tex.ac.uk/cgi-bin/texfaq2html?label=newfunction">http://www.tex.ac.uk/cgi-bin/texfaq2html?label=newfunction</a> +</body> |