Replies: 1 comment
-
You can use \def\setdef#1{\left\{#1\@ifnextchar[\setdefMid\setdefEnd}
\def\setdefMid[#1]{\mid #1\setdefEnd}
\def\setdefEnd{\right\}}
\setdef{1,2,3};
\setdef{x^2}[x \in S] |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
This is probably more of a
LaTeX
than aKaTeX
question but maybe someone here can help me out.In my usual
.tex
files I define personal macros with thexparse
package. It should be possible to adapt most of them for use withKaTeX
but I am struggling with the following one:As you can see, the macro expansion changes depending on whether
IfNoValueTF{#2}
returnstrue
orfalse
. Is there a way to achieve something similar with\def
or\newcommand
, or someKaTeX
trickery? I don't really mind if the solution requires a lot of low leveltex
code as long as I can automate parsing fromxparse
toKaTeX
.Beta Was this translation helpful? Give feedback.
All reactions