2

Below is some code adapted from the mathtools documentation. I'd like to have extensible versions of the \vzigzag command such that the second line in the command below works as expected. What would be the easiest way of accomplishing that?

\documentclass{article}


\usepackage{mathtools}
\usepackage{stix}
\providecommand\given{}

\newcommand\Symbol[1][]{%
    \nonscript\:#1\vzigzag
    \allowbreak
    \nonscript\:
    \mathopen{}}

\DeclarePairedDelimiterX\zigr[1](){\renewcommand\given{\Symbol[\delimsize]}#1}


\begin{document}

$E\zigr{a \given b}$ works.

%$E\zigr[\big]{a \given b}$ does not work.  

\end{document}
6
  • I'm afraid there is no extensible “zig zag” delimiter.
    – egreg
    Apr 30 '19 at 20:30
  • @egreg how do I make one?
    – JPi
    Apr 30 '19 at 20:45
  • There's one in mathabx, but it doesn't behave. :-(
    – egreg
    Apr 30 '19 at 21:03
  • In what sense??
    – JPi
    Apr 30 '19 at 21:09
  • It has a minimum size that's the same as \Big.
    – egreg
    Apr 30 '19 at 21:13
3

Not a very satisfying solution, because the zigzag has a minimum size like \Big.

This uses \lfilet from mathabx.

\documentclass{article}

\usepackage{mathtools}
\usepackage{stix}
\DeclareFontFamily{U}{mathx}{}
\DeclareFontSubstitution{U}{mathx}{m}{n}
\DeclareFontShape{U}{mathx}{m}{n}{ <-> s*[0.4]mathx10 }{}
\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}
\DeclareMathDelimiter{\lfilet}{4}{mathx}{"37}{mathx}{"37}

\providecommand\given{}
\newcommand\Symbol{%
  \nonscript\:%
  \expandafter\ifx\delimsize\empty
    \expandafter\big
  \else
    \expandafter\delimsize
  \fi\lfilet
  \allowbreak
  \nonscript\:%
  \mathopen{}%
}

\DeclarePairedDelimiterX\zigr[1](){%
  \renewcommand\given{\Symbol}#1%
}


\begin{document}

$E\zigr{a \given b}$ (normal)

$E\zigr[\big]{a \given b}$ (big)

$E\zigr[\Big]{a \given b}$ (Big)

$E\zigr[\bigg]{a \given b}$ (bigg)

$E\zigr[\Bigg]{a \given b}$ (Bigg)

\end{document}

enter image description here

1
  • 1
    Arguably you could add further deviation with \footnotesize{\given} (but it looks frail)
    – user170109
    Apr 30 '19 at 21:42
1

This is not an answer because I do not really know how the \DeclarePairedDelimiterX magic works, but to tell you that you can draw zigzags of different sizes easily with TikZ.

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.pathmorphing}
\newcommand{\TikzZigZag}[1][0]{\ifcase#1%
\tikz[baseline=0.35em]{%
\draw[line width=0.06em,decorate,decoration={zigzag,segment
length=0.28em,amplitude=0.07em}](0,0)--(0,1em);}%
\or%
\tikz[baseline=0.5em]{%
\draw[line width=0.08em,decorate,decoration={zigzag,segment
length=0.4em,amplitude=0.1em}](0,0)--(0,1.4em);}%
\or
\tikz[baseline=1em]{%
\draw[line width=0.1em,decorate,decoration={zigzag,segment
length=0.65em,amplitude=0.15em}](0,0)--(0,2.4em);}%
\fi}
\begin{document}

$(\TikzZigZag\big(\TikzZigZag[1] \bigg(\TikzZigZag[2]$
\end{document}

enter image description here

1
  • very nice, thank you.
    – JPi
    May 1 '19 at 13:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.