Linked Questions
17 questions linked to/from newcommand vs. DeclareMathOperator
0 votes
1 answer
1k views
How to make new commands for function operations that don't italicize [duplicate]
I created new commands for Galois groups and Automorphism groups like so, \newcommand{\Gal}[1]{\text{Gal}(#1)} \newcommand{\Aut}[1]{\text{Aut}(#1)} I wanted to the text of Gal and Aut to be ...
5 votes
0 answers
739 views
Is using DeclareMathOperator for functions the right thing to do? [duplicate]
I'm wondering if I use the \DeclareMathOperator for the wrong things. For example I have a cost function cost(x,y) which takes two arguments. I would declare it as \DeclareMathOperator*{\cost}{cost} ...
1 vote
1 answer
159 views
Place one math expression over the other [duplicate]
The following formula appears in the Stanford ML Course: How do I express this format, in which minimize is in line with the J(...) expression, and directly above the Thetas? I tried looking for a ...
403 votes
5 answers
170k views
What is the difference between \def and \newcommand?
Inspired by a question about \let and \def, I have some that essentially all boil down to asking What are the differences between \def and \newcommand? In particular, I wonder Is it possible to have ...
201 votes
2 answers
49k views
Drawbacks of xspace
I'm certain I have read that xspace can cause more problems than it solves. But I cannot find anything to that effect either on this site or the web. Are there any drawbacks or risks associated with ...
109 votes
2 answers
248k views
bm package versus \boldsymbol
I'm typing a bold vector small x with a tilde sign above it. Now when I want to write its derivative, I'm putting a dot on top of everything. This is giving me problems and I found one solution: \...
64 votes
4 answers
4k views
How do you make your own symbol when Detexify fails?
My first visit to TeX.SX came when I was looking for a symbol for a twisted product: I knew about Detexify and the Comprehensive LaTeX Symbol List, but I could not find the symbol there. I tried the ...
62 votes
2 answers
124k views
What is the Latex convention for sign function? [closed]
What is the correct type for sign(x)(signum function)? I'm using: \documentclass[journal,transmag]{IEEEtran} \usepackage{amsmath} \usepackage{amssymb} \newcommand{\sign}{\text{sign}} Is that ...
42 votes
3 answers
24k views
\DeclareMathOperator won't take arguments
I'd like to define a family of math operators that have the same superscript, but different subscripts. My first attempt was: \DeclareMathOperator{\Upd}[1]{U^M_{#1}} But the log tells me that: l.3 \...
6 votes
3 answers
415 views
DeclareMathOperator and widearcarrow with kpfonts
The title says it all, I am using the package kpfonts and I would like to declare a math operator that has a widearc on top. However, when I compile I don't get any arc. \documentclass{article} \...
8 votes
1 answer
3k views
How can I align the terms of this equation nicely?
I have the following alignat segment: \begin{alignat*}{3} \text{max}_{\underline{\lambda}} \text{min}_{\underline{x}} \quad & \underline{c}^T \underline{x} + \underline{\lambda}^T(\underline{d} ...
1 vote
1 answer
3k views
New DeclareMathOperator
In my MWE below, I wanted the create a shortcut for some operators. How can I get the \DeclareMathOperator command to show up like the conventional way of using the actual command $\mathbf{z}(k)$ ? ...
0 votes
1 answer
914 views
Get a proper double-struck one while using amsmath
I am using the amssymb package and from time to time I want to print a proper looking double-struck digit 1 as I could get by using the bbold package. However they both are using the \mathbb{} ...
1 vote
3 answers
551 views
How to avoid using curly braces when placing a \DeclareMathOperator command in subscript or superscript, while preserving spacing?
Let's say in my preamble I define \DeclareMathOperator\rad{rad} and have the text Let $f$ be a smooth function and $f^{\rad}$ its radial symmetrization. It is inconvenient to have to enclose the \rad ...
1 vote
2 answers
634 views
Two lines in an equation of one line
What I want to do is to include two lines at the begging in an one-line equation, just like in the following picture. Does anyone have any idea in order to achieve it? Thanks a lot.