Linked Questions

3
votes
0answers
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 ...
3
votes
0answers
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?
102
votes
4answers
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 ...
36
votes
6answers
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...)
69
votes
3answers
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-...
38
votes
5answers
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 ...
37
votes
3answers
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 \...
20
votes
6answers
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 ...
23
votes
6answers
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 ?
16
votes
6answers
2k views

Defining new commands inside a for loop

I would like to define a number of related commands by using the counter in a for-loop. For example, I want to define 26 commands like this: \newcommand{\calA}{{\cal A}} \newcommand{\calB}{{\cal B}} ...
4
votes
4answers
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 ...
20
votes
4answers
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 ...
19
votes
3answers
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[...
25
votes
3answers
5k views

Why are so many symbols restricted to math mode?

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 ...
19
votes
3answers
3k views

Writing a macro in LaTeX for getting a vector i,j,k representation by passing parameters

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 ...

15 30 50 per page
1
2 3 4 5