Skip to main content

New answers tagged

0 votes
Accepted

New command optional arguments for sub, supra, and argument of an operator

Don't use the g argument type: it's deprecated. Besides, you'd need empty arguments if the subscript is missing and it's difficult to remember the order of arguments. \documentclass{article} \...
egreg's user avatar
  • 1.1m
2 votes

Build a new command "newsymbol" with NewDocumentCommand

You have the \IfNoValueTF tests reversed: you're using the arguments in the true branch instead of the false branch. This is cured by using \IfValueTF. Next, \expandafter\newcommand*\csname #2\...
egreg's user avatar
  • 1.1m
2 votes

Build a new command "newsymbol" with NewDocumentCommand

I can’t say I like this syntax, but \documentclass{article} % Define \newsymbol using xparse \NewDocumentCommand{\newsymbol}{s m o o m}{ \IfBooleanTF{#1}{ \IfValueTF{#3}{ \...
Gaussler's user avatar
  • 12.9k
0 votes

Command doesn't show put after a new line

To simplify Ulrike's answer, you can make a new command that automates the refstep part: \documentclass{article} \newcommand{\createSyntesLabel}[1]{% \refstepcounter{syntes}% \label{#1}% } \...
Teepeemm's user avatar
  • 7,125
2 votes

Command doesn't show put after a new line

The normal way would be to use \label directly after the \refstepcounter. That would simply work: \documentclass[12pt]{article} \newcounter{syntes} \begin{document} \refstepcounter{syntes}\label{pyro-...
Ulrike Fischer's user avatar
3 votes
Accepted

\IfBlankF in \NewDocumentCommand removes content leading up to argument

You specified four optional arguments that should go in brackets []. Anyway, I don't think it's a good interface. \documentclass{article} \NewDocumentCommand{\newrule}{ m O{} O{} O{} O{} }{% \...
egreg's user avatar
  • 1.1m
0 votes

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

Looking back, this issue, as @Ulrich said, is actually about the differences between \cref{\extract{label,page}{1}} and \cref{\passresult{\extract}{label,page}{1}}, at least on the surface. At that ...
谢尘竹's user avatar
3 votes
Accepted

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

the return of a dual-parameter \innercommand{param1}{param2} into another \outercommand{} as one of its arguments (which might be a label) TeX has several stages of processing. Using Knuth's analogy ...
Ulrich Diez's user avatar
  • 29.8k
0 votes

Problem with environment expansion and the Tikz external library.

Without the environ package using \NewDocumentEnvironment: \documentclass{article} \usepackage{tikz} \usetikzlibrary{external} \tikzexternalize \NewDocumentEnvironment{mytikz}{m m o b} {\begin{figure}...
Michael's user avatar
  • 622
0 votes
Accepted

commands within \subimport

TeXnically, you could use a \space instead of {}: \documentclass[]{letter} \usepackage{import} \def\AV{510} \def\AVVers{4} \begin{document} The test-values are AV \AV\space V\AVVers. \subimport{}{...
samcarter_is_at_topanswers.xyz's user avatar
2 votes
Accepted

Nesting two environments

You can use \tcolorboxenvironment. \documentclass{article} \usepackage{amsthm} \usepackage{tcolorbox} \usepackage{lipsum} \newtheoremstyle{mystyle} {0ex} {0ex} {} {} {\bfseries} {} {1....
egreg's user avatar
  • 1.1m
2 votes

Nesting two environments

\documentclass{article} \usepackage{amsthm} \usepackage{tcolorbox} \usepackage{lipsum} \newtheoremstyle{mystyle}{0ex}{0ex}{}{}{\bfseries}{}{1.5ex}{\llap{\thmnumber{#2}\hskip2mm}\thmname{#1}\thmnote{ \...
hair-splitter's user avatar
0 votes

How do I add optional arguments in newcommand?

Here's how I would do it (if \c is not used to add a cedilla) (@frougon has mentioned how it works): \newcommand{\c}[1][]{$#1C$} Since \c is a defined LaTeX command, we can use another syntax: \...
Alexander Chew's user avatar
2 votes
Accepted

How to make own title of the part of text?

You can define it as a heading so latex takes care of avoiding bad page breaks, I defined it to be level -1 like \part so it's not really in the normal sectioning heirarchy. \documentclass[12pt,...
David Carlisle's user avatar
1 vote

Matrix multiplication (and other operations) macro using lua module

You could also refer to the package https://ctan.org/pkg/lualinalg?lang=en.
user61681's user avatar
  • 1,769
2 votes

What is the right way to redefine macros defined by babel?

Currently, babel provides a user interface to redefine captions. In your case, it’s as follows: \setlocalecaption{english}{contents}{Foo}
Javier Bezos's user avatar
  • 10.5k
1 vote

Creating a command to display blackboard font

Old LaTeX still kicking. \documentclass{article} \usepackage{amssymb} \makeatletter \@tfor\x:=ABCDEFGHIJKLMNOPQRSTUVWXYZ\do{% \ifcsname \x\x\endcsname \typeout{Not redefining \@...
user691586's user avatar
  • 2,298
4 votes

Creating a command to display blackboard font

An alternative which allows arbitrary lists of letters or ranges. \documentclass{article} \usepackage{pgffor} \usepackage{amsfonts} \def\batchdef#1#2#3{% \def\processletter##1{\expandafter\gdef\...
mxybi's user avatar
  • 41
13 votes

Creating a command to display blackboard font

\documentclass{article} \usepackage{amssymb} \ExplSyntaxOn \int_step_inline:nnn { 1 } { 26 } { \cs_if_exist:cTF { \int_to_Alph:n {#1} \int_to_Alph:n {#1} } { \iow_term:e { Not~redefining~\...
egreg's user avatar
  • 1.1m

Top 50 recent answers are included