Questions tagged [newdocumentcommand]
Use this tag for specific problems of using NewDocumentCommand
10
questions
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 ...
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 ...
2
votes
2
answers
62
views
Supplying data to hyperref's pdfauthor: different command types give different results
The hyperref package allows a list of authors to be assigned to the pdfauthor option. For example, this works for me
\hypersetup{ pdfauthor={Me, Bobby McGee} }
The two authors are recognised in the ...
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\...
4
votes
1
answer
126
views
Using command defined with \NewDocumentCommand in TikZ
I’m trying to use a command defined using \NewDocumentCommand in a tikzpicture environment and cannot resolve an error. Here’s a minimal example of what I’m trying to do:
\documentclass{article}
\...
2
votes
1
answer
50
views
`already defined` error with scoped newcommand
I want to make it easier on myself to write large commands
like this by "naming" the arguments.
I did this:
% Define the command for vector projection with named arguments
\...
-3
votes
1
answer
69
views
Passing keys to \lenest:nn
Is it possible to pass keys to \lenes:nn ?
\documentclass[a4paper,12pt]{article}
\ExplSyntaxOn
\cs_new_protected:Nn \lenes:nn
{
\str_case:nn {#1}
{
{mig}
{ \geometry { ...
-1
votes
1
answer
66
views
Accessing a colour without specifying a list of definecolor
I would like to declare a number of colour palette names and then define only those colours at the beginning of a document. For instance, one can define a colour palette variant is optimized for ...
-1
votes
1
answer
43
views
Include font size specification to a command
I would like to include the specification of the font size (\huge \large \normalsize) in the key-value specification.
\documentclass[a4paper,12pt]{article}
\ExplSyntaxOn
\tl_new:N \l_hlov_tipoa_tl
...
5
votes
1
answer
310
views
\rowcolor in \NewDocumentCommand
It seems to be impossible to wrap \rowcolor in a macro defined with \NewDocumentCommand, while everything is fine with \newcommand. Is ist possible to fixe this?
\documentclass{article}
\usepackage[...