61 questions linked to/from When not to use \ensuremath for math macro?
155 views

### Good habits: using \ensuremath to typeset math in text mode [duplicate]

All of this question is about \ensuremath command. I would like to know, possibly from expert users, if there are any counter effects in using math commands in the text via \ensuremath and whether ...
148 views

### Is removing \ensuremath the best practice? [duplicate]

First of all, let's see the following dialogue. Generally speaking, is removing \ensuremath the best practice?
617k views

### How to write partial differential equation (Ex. dQ/dt=ds/dt) with real partial derivative signs?

I would like to make a partial differential equation by using the following notation: dQ/dt (without / but with a real numerator and denomenator). Earlier today I got help from this page on how to ...
19k views

### Faster way of writing \mathbf

Is there a quicker way of doing boldface in math mode instead of typing out \mathbf{} each time? (It gets cumbersome when you denote simple vectors with boldface...)
4k views

### When is it harmful to add percent character at end of lines in a \newcommand, or similar

Since egreg has graciously agreed to not comment at least for a day to When not to use \ensuremath for math macro? :-), I thought I would take advantage of that and post a question about another (non-...
58k views

### Macro for degree symbol

I wanted to find a simple way to made degree symbol ° and have tried textcomp and gensymb, but none of them works. I wanted to avoid using ^{\circ}, which isn't nice when you have a long document. I ...
16k 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 \...
18k views

### Text in squared box

I'd like to bot a square box around some text. I'd like to denote a labelled object of size 1, in combinatorics this is often symbolised by something like \boxed{1}. It would be nicer if the box was a ...
58k views

### Defining my own proof environment?

How would I define a proof environment that is basically used with \begin{proof} some proof here \end{proof} and it would be equivalent to: \paragraph{Proof:} some proof here \hfill \box ?
2k views

### Defining new commands inside a for loop

1k views

### Why aren't all math functions wrapped in ensuremath? [closed]

It seems like it would make life easier, right? \vec{x} vs $\vec{x}$ Could there be a way to say, force all, or most math commands to automatically ensure math? Maybe an environment? I realize math ...
6k views

### No space present after ensuremath

When I insert a short maths section in a sentence, it renders fine with a space each side as expected: ...returned $\mathcal{P}$ from... If I define a command to do the same thing, it also renders ...
55k views

### What is the capital Greek letter for tau? [duplicate]

I would like to typeset the capital Greek letter for tau. I used \Tau, but I got error for that: Undefined control sequence. My preamble is \documentclass[10pt,a4paper]{article} \usepackage[...
A common beginner's mistake is to forget $$...$$/$...$ around symbols that require math mode. Why doesn't (La)TeX let people use isolated symbols in text mode by default? I am sure there are at ...
I want to create a newcommand \vecty to create a vector which will take 3 parameters like \vecty{1}{2}{3} and this should display as $\hat{i}+2\hat{j}+3\hat{k}$ and if I give \vecty{0}{3}{-3} then it ...