9

This question already has an answer here:

I am writing some proofs using LaTeX, and following the standard procedure in the ConTeXt, I need to write something as follows:

enter image description here

However, I have no idea how to create the "double bracket", like the one includes x := y + z...

Could anyone give me some help on this?

marked as duplicate by TeXnician, gernot, Martin Schröder, Andrew Swann, Steven B. Segletes math-mode May 1 '17 at 18:51

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

14

Use \llbracket and \rrbracket from fourier package (for example) for those doubled bracket symbols.

\documentclass{article}


\usepackage{mathtools}    
\usepackage{fourier}

\begin{document}
 $ f_{Z} \llbracket x \coloneqq y + z\rrbracket (\sigma) = [ x \mapsto Z ] (\sigma)$

\end{document}

enter image description here

If using the whole fourier package is too much, importing symbols might be an option: Import one symbol from `fourier`

Here's the version with import of the symbols (code copied from fourier.sty)

\documentclass{article}

\usepackage{mathtools}
\DeclareFontEncoding{FML}{}{}%
\DeclareFontSubstitution{FML}{futm}{m}{it}%
\DeclareFontEncoding{FMS}{}{}
\DeclareFontSubstitution{FMS}{futm}{m}{n}
\DeclareFontEncoding{FMX}{}{}
\DeclareFontSubstitution{FMX}{futm}{m}{n}
\DeclareSymbolFont{symbols}{FMS}{futm}{m}{n}%
\DeclareSymbolFont{largesymbols}{FMX}{futm}{m}{n}%

\DeclareMathDelimiter{\llbracket}{\mathopen}{symbols}{153}{largesymbols}{133}
\DeclareMathDelimiter{\rrbracket}{\mathclose}{symbols}{154}{largesymbols}{134}


\begin{document}
$ f_{Z} \llbracket x \coloneqq y + z\rrbracket (\sigma) = [ x \mapsto Z ] (\sigma)$

\end{document}

enter image description here

Please note the difference between the regular symbols f, x etc. from the screen shots.

  • You anticipated me for a few minutes and of course I voted positively for your answer. – Sebastiano Apr 30 '17 at 20:42
  • @Sebastiano: As I have done vice versa – user31729 Apr 30 '17 at 20:47
  • I imagined and for me it is also a sign of respect and esteem for your great talent. – Sebastiano Apr 30 '17 at 20:50
14

enter image description here

\documentclass[a4paper,12pt]{article}

\usepackage{stmaryrd}

\begin{document}

\begin{equation}
  f_Z\llbracket  x: y z t   \rrbracket      
\end{equation}

\end{document}
  • 2
    The downvote here is not justified! – user31729 Apr 30 '17 at 20:50
  • 1
    @ChristianHupfer The downvote (not mine) it's probably because this answer is equal to my comment I posted one minute before... – CarLaTeX Apr 30 '17 at 20:53
  • 1
    @CarLaTeX: That's a coincidence then, I think. Sometimes I post an answer and see that somebody has posted a comment in between -- it's hard to recognize this. – user31729 Apr 30 '17 at 20:55
  • 2
    @ChristianHupfer Yes, I think so, that's why I did not downvote... – CarLaTeX Apr 30 '17 at 20:56
  • 3
    This is the best answer in the lot: no complicated code for borrowing symbols from bigger families. I find the downvote completely unjustified. – egreg Apr 30 '17 at 22:00
13

In addition to the fourier and stmaryd packages, the mathabx package also provides "double-struck" square brackets; the macro names are \ldbrack and \rdbrack, respectively.

enter image description here

\documentclass{article}
\usepackage{mathabx} % for `\ldbrack` and `\rdbrack` macros
\begin{document}
$ f_{Z} \ldbrack x := y + z\rdbrack (\sigma) = [x\mapsto Z]\sigma$     
\end{document}
  • Mico, I have votated also your answer. But why does anyone always give me negative votes? :( – Sebastiano Apr 30 '17 at 20:51
  • 3
    @Sebastiano - Wow, I have no idea why anyone would have downvoted your answer! That's just awful behavior. Do rest assured that I upvoted your answer. – Mico Apr 30 '17 at 21:12
  • 1
    I don't recommend loading mathabx: it changes all symbols and some of them become quite peculiar. – egreg Apr 30 '17 at 22:01
9

If you do not want mathabx to replace the default symbol fonts, you can define commands only for the symbols, which are extensible, with this code:

\documentclass{article}
\usepackage{mathtools}

\DeclareFontFamily{U}{matha}{\hyphenchar\font45}
\DeclareFontShape{U}{matha}{m}{n}{ <-6> matha5 <6-7> matha6 <7-8>
matha7 <8-9> matha8 <9-10> matha9 <10-12> matha10 <12-> matha12 }{}
\DeclareSymbolFont{matha}{U}{matha}{m}{n}
%
\DeclareFontFamily{U}{mathx}{\hyphenchar\font45}
\DeclareFontShape{U}{mathx}{m}{n}{ <-6> mathx5 <6-7> mathx6 <7-8>
mathx7 <8-9> mathx8 <9-10> mathx9 <10-12> mathx10 <12-> mathx12 }{}
\DeclareSymbolFont{mathx}{U}{mathx}{m}{n}

\DeclareMathDelimiter{\ldbrack} {4}{matha}{"76}{mathx}{"30}
\DeclareMathDelimiter{\rdbrack} {5}{matha}{"77}{mathx}{"38}

\begin{document}

    \[ f_{Z} \bigl\ldbrack x \coloneqq y + z\bigr\rdbrack(\sigma) = [x\mapsto Z]\sigma \]

\end{document} 

Also, do not use :=: the colon is not centred on the math axis. With the standard fonts, mathtools defines a \coloneqq command, wich produces a correct version.

enter image description here

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