Questions tagged [macros]
{macros} is for questions specifically concerning TeX's macro processor. Note that, because TeX uses macros ubiquitously, most questions about code that uses macros are not looking for information about how macros work, and so are not appropriate for this tag.
8,306
questions
0
votes
0
answers
38
views
Splitting and forwarding to bool_lazy_any in LaTeX3?
I currently have a function which does the following:
\NewDocumentCommand{\myfunction}{m m m}{
\str_if_eq:eeTF{\c_sys_engine_str}{#1}{#2}{#3}
}
which allows me to do something as: \myfunction{...
0
votes
1
answer
31
views
New command optional arguments for sub, supra, and argument of an operator
I'm trying to specify a command that allows to display an operator, its evaluation at a certain argument, and add sub and supra indexes. That is, the commands
\f
\f{a}
\f{a}{i}
\f{a}{i}{j}
Should ...
1
vote
0
answers
22
views
Using \ifthenelse and \isempty in newcommand used in glossaries's name
I want to use \ifthenelse while defining symbols with \newcommand. This works all fine, until I try to use those symbols (here \densCanv) in my glossary as a name:
\documentclass[a4paper,10pt]{article}...
0
votes
0
answers
68
views
Defining a macro yielding acceptable output to \setlength command
My problem arose in the process of trying to solve a shapepar question/challenge (similar to this ---not fully solved--- one) in the following scenario:
Mimic rather simple page layout of children ...
2
votes
2
answers
131
views
Build a new command "newsymbol" with NewDocumentCommand
I want to create a new command \newsymbol, which functions like \newcommand, but with the difference that math is ensured. I also have another reason, why I want to define this new command, namely so ...
0
votes
2
answers
34
views
Command doesn't show put after a new line
I used \newcommand to make a label and then label it.
\documentclass[12pt]{article}
\makeatletter
\newcommand{\createlabel}[2]{%
\@bsphack
\expandafter\edef\csname #1\endcsname{#2}\@...
4
votes
1
answer
59
views
\IfBlankF in \NewDocumentCommand removes content leading up to argument
I'm trying to define a command with \NewDocumentCommand that create a subsection with a given name (mandatory) and optionally some descriptive paragraph. Since I don't want these paragraph to be ...
0
votes
1
answer
23
views
commands within \subimport
Using a command within subimport leads to problems.
Consider the following files, which have to lay side-by-side in the same folder. test.tex:
\documentclass[]{letter}
\usepackage{import}
\def\AV{510}...
0
votes
2
answers
138
views
design a \Command that allows a Dual-parameter \Command passing its return into another \Command as one (which might be a label) of its inputs
Design: a (La)TeX command (maybe look like this \passresult{\outercommand}{\innercommand}{param1}{param2}),
which pass the return of a dual-parameter \innercommand{param1}{param2} into another \...
1
vote
2
answers
116
views
Nesting two environments
The snippet below has been obtained nesting two environments taken from amsthm and tcolorbox.
I would like to redefine the environment theorem to produce the same output (I can only modify the ...
1
vote
1
answer
47
views
How to make own title of the part of text?
I'm trying to create titles for pieces of text that won't appear as the last element at the bottom of the page. I haven't been able to find a method to prevent page breaks directly below the title. ...
6
votes
3
answers
500
views
Creating a command to display blackboard font
I am relatively new to LaTeX and I want to know whether there is a way to create a command such that it takes whatever capital letter the command is and prints the blackboard font. Here's what I mean: ...
5
votes
2
answers
259
views
Expand a `.cs` defined by key inside the function
I have a prop list in which I save items using the \addtoprop
command and then loop through the prop list and print it with the
\foreachinprop command. The \foreachinprop command has several
keys, but ...
0
votes
2
answers
75
views
How to check if command received a command as argument
I tried to use ifdef command for that, but it doesn't work. It outputs text when it's passed and executes the true branch.
\documentclass{article}
\usepackage{etoolbox}
\begin{document}
\...
1
vote
1
answer
65
views
How does one fully expand a macro between \csname and \encsname?
The best way to ask this question is to present two MWEs, one of which works and one of which does not. Naturally, I would like to get this into the second form, but I am at a loss as to what is ...