Linked Questions

25 votes
2 answers
14k views

Number in name of commands? [duplicate]

Possible Duplicate: Definining commands/abbreviations that contain numbers I wanted to know if it was possible to define a new command with a name that contains numbers? e.g. \newcommand{\agent1}...
Peutch's user avatar
  • 2,192
8 votes
3 answers
9k views

How to define macros with numbers in them? [duplicate]

Possible Duplicate: Definining commands/abbreviations that contain numbers How can I define macros as \text1,\text2...\text3 which, when invoked will produce text with different widths?
yannisl's user avatar
  • 118k
2 votes
1 answer
3k views

difficulty using \newcommand with previously specified new commands [duplicate]

Possible Duplicate: Definining commands/abbreviations that contain numbers I'm having some difficulty with setting a command using \newcommand. The command I'm trying to create is as follows: \...
d3pd's user avatar
  • 1,718
6 votes
2 answers
225 views

Creating a command with numbers on it [duplicate]

As I work with matrices all the time, I want to create the following command: \newcommand{\2x2}{2 \times 2} So that, for example, I can write: Let A \in \mathbb{K}^{\2x2}, ... etc. I have seen that ...
FacuO.Z.'s user avatar
  • 161
0 votes
1 answer
718 views

\newcomand causes failure [duplicate]

im new to Latex, so pleas make explenation easy ;) im working with latest latex version on miktex i tried some \newcommand today and caused an error with this command: \newcommand{\N0}{ n_{0} }. when ...
Daniel's user avatar
  • 1
1 vote
1 answer
208 views

How do I create a newcommand which outputs a letter with an index? [duplicate]

When I use \newcommand{\F1}{$\mathrm{F}_1$} I get the Missing \begin{document}. error and missing $ inserted if I move it inside the document. How do I define a macro so that \F1 would expand to $\...
sds's user avatar
  • 515
2 votes
1 answer
237 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 ...
Mike's user avatar
  • 889
1 vote
1 answer
80 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 ...
Huang Elizabeth's user avatar
0 votes
0 answers
68 views

How to use \s16o2 as a newcommand in latex and bibtex? [duplicate]

I would like to use the \s16o2 newcommand for S$^{16}$O$_2$. How to define it? Thank you for your help!
Roloka's user avatar
  • 203
0 votes
0 answers
24 views

names of commands that include numbers [duplicate]

I would like to use numbers in \newcommand names. Would this be possible ? \newcommand{\p13} {\geometry{paperwidth=13cm,paperheight=21cm}} \newcommand{\p26} {\geometry{paperwidth=26cm,...
Veak's user avatar
  • 1
30 votes
3 answers
16k views

Command/macro name cannot include numbers and symbols

I would like put picture into table, and my idea is define new command as below> \newcommand{\EJ471}{\includegraphics[scale=0.150]{EJ_471.jpg}} But compiler reports an error. If I use the command ...
JardaFait's user avatar
  • 3,952
8 votes
4 answers
7k views

tikz foreach index in variable name

I want to have a set of variables holding numerical values (e.g., cnt1, cnt2, cnt3) and access them based on the foreach index. For example: \foreach \i in {1,...,5} { \pgfmathtruncatemacro{\cnt\...
user10097's user avatar
  • 183
9 votes
3 answers
4k views

Numbers in Newcommand

I have some thousands of special text lines specifically numbered. 001001=aaaaaaaa 001002=bbbbbbbb 001003=cccccccc 002001=dddddddd 002002=mmmmmmmm 002003=jjjjjjjj 003001=uuuuuuuu 003002=iiiiiiii ...
Nina's user avatar
  • 123
7 votes
4 answers
361 views

Workarounds for including a number in a command (name)? or argument-specific macro definitions

I was wondering if there are any clever workaround for including a number in a custom macro name? I'm working with a platform that integrates LaTeX with a computer algebra system, and frequently have ...
Rax Adaam's user avatar
  • 1,767
6 votes
3 answers
800 views

macro names with special characters

Is it possible to create macro names with special characters in it? I would like to creates some macro's that have names like \s1.4 and also to be able to use them like \s1.4Test where Test is not ...
AbstractDissonance's user avatar

15 30 50 per page