4

I borrowed a predefined command (below), which uses math mode. Within the [[ ]], obviously, it doesn't observe spacing. Is there a way to make the command observe spacing within the [[ ]]

\documentclass{article}
\usepackage{stmaryrd}
\usepackage{fullpage}
\setlength{\parindent}{0in}
\newcommand{\sem}[2][]{\mbox{$[\!\bf[ #2 ]\!]^{#1}$}}
\begin{document}
\sem{Two words}
\end{document}
Adam_G
  • 816

1 Answers1

3

Just close math mode and reopen it:

\documentclass{article}
\usepackage{stmaryrd}

\newcommand{\sem}[2][]{%
  \mbox{$\llbracket$\bfseries #2$\rrbracket^{#1}$}%
}

\begin{document}
Here are \sem{Two words} and here is \sem[1]{One}.
\end{document}

enter image description here

egreg
  • 1,121,712