Linked Questions

5
votes
3answers
267 views

What is the command \csname used for? [duplicate]

Maybe a stupid question...but I often see the usage of \csname in code -- especially in packages. Can someone explain what its purpose is? As far as I see it generates a new command based on an ...
23
votes
1answer
1k views

Why doesn't \makeatletter work inside \newcommand?

After hours of banging my brain against my skull, I narrowed down an issue I'm having to the fact that \makeatletter doesn't work inside \newcommand. Commands that I call after \makeatletter are ...
6
votes
5answers
1k views

Scalable If/Then Structure

I am trying to make some math fact equation sheets that are based on random number generation. I have quite a bit of learning to do... but this is where I think should start: Use random numbers to ...
11
votes
4answers
465 views

What if I use a \def name starting with “if”

Following this answer to Is it possible to use some sort of internationalization in LaTeX? I'm setting up my own dictionaries. When compiling the files I get this error: ! Use of \if doesn't match ...
10
votes
2answers
2k views

How can I combine two text strings to represent the name of a command?

I want to combine one command with a text string to represent a second command. In MatLab it would be possible to concatenate these two strings into one string and evaluate this new string. However I ...
5
votes
3answers
908 views

Define macro for sequence/list/tuple macros

I would like to define a macro for defining further macros to display sequences/lists/tuples of elements by specifying the following parameters: The name of the new command. What to display for an ...
10
votes
1answer
3k views

Are LaTeX's label names case-sensitive? Can label names contain spaces?

According to Guide to LaTeX, 4th edition, when creating a \label{name}, The keyword name may be any combination of letters, numbers, or symbols. Is the name of a label case-sensitive? Can the name ...
17
votes
1answer
620 views

ConTeXt: How do you create your own commands?

There seems to be a Current and Standard way to define new (core) commands in ConTeXt. For example, an e-mail by Wolfgang states: Many of the \define... and \setup... commands are now auto ...
7
votes
3answers
875 views

Expanding macros within \csname

I have some macros that expand to some text but when used together they should expand to something completely different. In this example: \foo -> x \bar -> y \foo\bar -> Hello World Doing it with \...
7
votes
2answers
4k views

Define a new command with parameters inside newcommand

I have read the question and answers about: Defining a newcommand, with variable name, inside another newcommand How to define a macro to create a new macro with a name passed as its argument? What ...
5
votes
1answer
2k views

Concatenate two strings to make a new command

I took some habits with my sciences reports so I developed some personalized commands. First, I define in the preamble all the variables that I need like this: \newcommand{\cvba}{Cv_{\beta/\alpha}} ...
7
votes
1answer
1k views

Need help to understand xkeyval example

I found an "easy" example how to use xkeyval here using the following code: \ProvidesPackage{myemph}[2011/03/12 v1.0 a test package] \providecommand\my@emphstyle{\em} % Note that the argument must ...
7
votes
2answers
194 views

Wrap text to quote it later in the same document

I was wondering if there's a way to do the following: to wrap an excerpt of text in an environment and to label it; to quote it (entirely) later in the same document, via a \ref command or similar. ...
1
vote
2answers
2k views

Help defining a newcommand for short cut to equation

Is there anyway to define a newcommand for an environment shortcut ? This is what I have so far, but is not working as I would like to. \newcommand{\beq}{\begin{equation} \label{eq:} and \...
3
votes
1answer
1k views

Redefine DeclareMathOperator [duplicate]

I'm looking for a way to replace \DeclareMathOperator{\Operator}{Operator} by something which would resemble \MathOperator{Operator}. I tried to define a new command \newcommand\MathOperator[1]{\...

15 30 50 per page