Skip to main content

Questions tagged [newdocumentcommand]

Use this tag for specific problems of using NewDocumentCommand

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
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
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 ...
Blair's user avatar
  • 407
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
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} \...
Nate's user avatar
  • 347
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 \...
Boris Month's user avatar
-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 { ...
Bulldrive's user avatar
  • 161
-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 ...
Bulldrive's user avatar
  • 161
-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 ...
Bulldrive's user avatar
  • 161
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[...
Tobi's user avatar
  • 56.8k