Skip to main content

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.

1 vote
0 answers
21 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}...
Make42's user avatar
  • 1,812
2 votes
2 answers
130 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 ...
Make42's user avatar
  • 1,812
0 votes
2 answers
33 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}\@...
Povi112's user avatar
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 ...
bru3s's user avatar
  • 43
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}...
user7427029's user avatar
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 \...
谢尘竹's user avatar
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 ...
Primo Petri's user avatar
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. ...
forrest's user avatar
  • 970
6 votes
3 answers
497 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: ...
A R's user avatar
  • 161
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 ...
Pablo González L's user avatar
0 votes
2 answers
74 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} \...
Intolighter's user avatar
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 ...
Mike Pugh's user avatar
  • 329
1 vote
1 answer
52 views

Expanding Variables to Input as Arguments for Macro

I have an issue when trying to use variables in a command (\ResearchModule). I read up to 8 lines from a text file and have them set to elements of an array (using code thanks to egreg!), with \...
MrOakPlanks's user avatar
2 votes
4 answers
166 views

How to modify overlay specifications in a new command in LaTeX Beamer?

I would like to modify the overlay specification that is passed to a custom command, but for some reason, < and > are interpreted as ¡ and ¿ when they are included in a new command. MWE: \...
mapf's user avatar
  • 253
4 votes
2 answers
159 views

Confused about optional argument with \NewDocumentCommand result

Given this MWE: \documentclass[12pt]{report} \usepackage{fontspec} \setlength{\parindent}{0pt} \NewDocumentCommand{\testone}{m m m }{% \if\relax\detokenize{#2}\relax \textbf{#1}\dotfill#3\...
hsmyers's user avatar
  • 1,573

15 30 50 per page
1
2 3 4 5
554