Linked Questions

1
vote
2answers
7k views

How to write $\pi_1$ [duplicate]

I am writing an article and I need to write the fundamental group. For that we use $\pi_1\left(X,x_0\right)$. However I am arriving at the following error: Use of \pi doesn't match its definition. ...
3
votes
1answer
735 views

Can new command end with a number? [duplicate]

Possible Duplicate: \newcommand name cannot include numbers, e.g., \Mycomand123 I am trying to define commands \s1, \s2, etc. Right now the the substitution is very simple but the idea would be ...
1
vote
1answer
313 views

Use of ___ doesn’t match its definition [duplicate]

I am returning to LaTeX after a bit of a hiatus. Currently running Mac OS High Sierra (10.13.16) and TexShop 4.26. In the past, I have used the following definition command % In pre-amble \def\m3{m$...
2
votes
1answer
178 views

LaTeX commands starting with a numeral [duplicate]

Possible Duplicate: Definining commands/abbreviations that contain numbers newcommand name cannot include numbers for example \Mycomand123 It seems like command names starting with a numeral ...
1
vote
1answer
138 views

Numbering macros [duplicate]

Possible Duplicate: \newcommand name cannot include numbers, e.g., \Mycomand123 I'm trying something that I thought would be simple \def\test{Hello} \def\test2{Hello again} \test \test2 Since I ...
0
votes
1answer
91 views

Use cyrillic values in newcommand [duplicate]

My goal is to be able to write: \newcommand{\сlient_name}{Имя} and use \client_name all over in my document. Right now I'm getting following errors like this: Underfull \hbox (badness 10000) in ...
1
vote
0answers
50 views

Defining command \old| [duplicate]

I want to let the command \old| refer to the command \| (which produces the output ||.) So I do: \let\old|\| LaTeX complains "Missing $ inserted." How can I fix it?
0
votes
1answer
29 views

How to make a new command for inserting an inline matrix? [duplicate]

I know I will be doing many calculations with the basis vectors (1,0) and (0,1) so I'm trying to define a command so I can write this vector inline. However, I'm getting the following error: "LaTeX ...
86
votes
6answers
26k views

Defining commands/abbreviations that contain numbers

I tend to use \newcommand to define macros for symbols I use often, e.g. \newcommand{\hankel}{H^{(1)}_0}. One inconvenience of this approach is the fact that command names cannot include numbers. ...
7
votes
1answer
7k views

pgfplotstableread fails to read the input file

I am trying to typeset two different tables in a moderately large document. The data for the tables are written as comma-separated values in two different .csv files. I am including the different ...
3
votes
2answers
510 views

How to create counters with index?

I need to create counters with names like mycounter1, mycounter2,... Basically this should be a counter-valued data array. The code like \newcounter{index} \newcounter{\csname mycounter\the\value{...
6
votes
2answers
318 views

How to define a command to make new commands with numbers in the name

I'd like to create a command which is currently beyond my capabilities so I was wondering if anyone around here could help me out. What I'm looking to do is define a new command similar to the ...
2
votes
1answer
439 views

How to create another styling format like \emph

I read how to change \emph and changed it to \DeclareTextFontCommand{\emph}{\bfseries}. Now I want to create another command like \secondstyleformat which I can configure aswell. Such a format could ...
3
votes
1answer
534 views

Tables as commands

I have to do a little work but I have to use frequently the same settings for a table and I put the following code \newcommand{\tab41}[4]{\begin{center} \begin{tabular}{|c|l||c|l||c|l||c|l|} \hline (...
1
vote
1answer
88 views

Workaround that allows the use of digits as part of counter names?

I tried to define indexed counters, such as x1, x2, . . . etc, by defining them like this : \newcount\x1, \newcount\x2, . . . etc, but it didn't work. Is there a workaround for this in TeX or LaTeX ? ...
0
votes
1answer
48 views

How to define a macro with digits in its name using \def and a counter value?

I need a \def whose name involves a number, with that number being value of a counter. \documentclass[varwidth,border=5mm]{standalone} \begin{document} % COUNTER \newcounter{myC} \addtocounter{myC}{...
1
vote
2answers
105 views

Use Labels to show equations

I want to be able to create many equations, say $a+b=c$ and $c+d=e$, save the equation as a variable but not have the equation be displayed. I simply want to have the ability to use the label/variable ...
1
vote
1answer
70 views

about newcommand [duplicate]

I have trying to use new command to represent math, and this is what I type in: \\ \newcommand\fpi2[2][\pi][2]{frac{#1}{#2}}\\ \newcommand\mylim[2][x]{lim_{#1\to #2}} I'm trying to create a new ...
0
votes
1answer
48 views

Custom function stopped working for no reason

I defined an operator \DeclareMathOperator{\s2}{s_{2}} And the second time I use it, it tells me "!Use of \s doesn't match its definition. \s 2..." In another instance of the document, it works ...