summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-newfunction.html
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-05-22 23:51:44 +0000
committerKarl Berry <karl@freefriends.org>2009-05-22 23:51:44 +0000
commit566f5207d7e3cafb0633d31277067336ccd9cca7 (patch)
tree7af53e7ac405185168bc1dc38c4e820f442b78d0 /Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-newfunction.html
parentb0beea26ffffd915bb6d9b82f2d65a0a05b7e23b (diff)
move generic english documents out of texmf-doc
git-svn-id: svn://tug.org/texlive/trunk@13396 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-newfunction.html')
-rw-r--r--Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-newfunction.html55
1 files changed, 55 insertions, 0 deletions
diff --git a/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-newfunction.html b/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-newfunction.html
new file mode 100644
index 00000000000..3e6065fe3b8
--- /dev/null
+++ b/Master/texmf-dist/doc/generic/FAQ-en/html/FAQ-newfunction.html
@@ -0,0 +1,55 @@
+<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:
+<blockquote>
+<pre>
+\newcommand{\diag}{\mathop{\mathrm{diag}}}
+</pre>
+</blockquote><p>
+<p/>Subscripts and superscripts on <code>\</code><code>diag</code> will be placed below and
+above the function name, 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>
+<p/>AMSLaTeX (in its <i>amsopn</i> package, which is automatically
+loaded by <i>amsmath</i>) 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:
+<blockquote>
+<pre>
+\DeclareMathOperator{\diag}{diag}
+</pre>
+</blockquote><p>
+<code>\</code><code>DeclareMathOperator*</code> declares the operator always to have its
+sub- and superscripts in the
+&ldquo;<a href="FAQ-limits.html"><code>\</code><code>limits</code> position</a>&rdquo;.
+<p/>The <i>amsopn</i> command <code>\</code><code>operatorname</code> allows you to
+introduce <em>ad hoc</em> operators into your mathematics, so
+<blockquote>
+ <code>\</code><code>[</code> <code>\</code><code>operatorname{foo}</code><code>(bar)</code> <code>\</code><code>]</code>
+</blockquote><p>
+typesets the same as
+<blockquote>
+<pre>
+\DeclareMathOperator{\foo}{foo}
+...
+\[ \foo(bar) \]
+</pre>
+</blockquote><p>
+As with <code>\</code><code>DeclareMathOperator</code> there&rsquo;s a starred version
+<code>\</code><code>operatorname*</code> for sub- and superscripts in the limits position.
+<p/>(It should be noted that &ldquo;log-like&rdquo; was reportedly a <em>joke</em> on
+Lamport&rsquo;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>