Fonts & Character Sets\bigparallel as variable-size prefix operator symbol in [xe|lua]latex

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
Post Reply
user49915
Posts: 81
Joined: Wed Apr 17, 2019 12:51 pm

\bigparallel as variable-size prefix operator symbol in [xe|lua]latex

Post by user49915 »

What is the proper™ way to obtain a variable-size parallel operator to be used in the prefix position? If I see it right, stmaryrd's \bigparallel already does the job for pdflatex, but how about [xe|lua]latex? My attempts so far are cumbersome:

\RequirePackage{ifxetex,ifluatex}
\newif\ifxetexorluatex
\ifxetex
\xetexorluatextrue
\else
\ifluatex
\xetexorluatextrue
\else
\xetexorluatexfalse
\fi
\fi
\documentclass{article}
\pagestyle{empty}
\usepackage{mathtools}\mathtoolsset{mathic=true} %%% See http://tex.stackexchange.com/a/3496
\ifxetexorluatex
\usepackage{unicode-math}%%% Makes things worse but is included anyway, as we need it in an unrelated portion of the document.
\providecommand{\bigparallel}{\mathop{\mathchoice
{\big\Vert}
{\Vert}
{\scriptstyle\Vert}
{\scriptscriptstyle\Vert}
}
}
\else
\usepackage{stmaryrd}
\fi
\begin{document}
Let \(M_i\) be machines over the shared state space \(S\).

Consider their parallel composition
\[\bigparallel_{\mathclap{i=1}}^n M_i\,.\]
Consider its set of states
\[\mathrm{States}_{\bigparallel_{i=1}^n M_i}\]
and define a predicate
\[p_{\mathrm{States}_{\bigparallel_{i=1}^n M_i}}\]
on it.

Alternatively, consider their parallel composition \(\bigparallel_{i=1}^n M_i\).
Consider its set of states \(\mathrm{States}_{\bigparallel_{i=1}^n M_i}\) and define a predicate \(p_{\mathrm{States}_{\bigparallel_{i=1}^n M_i}}\) on it.
\end{document}


xelatex produces this:
mwe.png
mwe.png (80.39 KiB) Viewed 3369 times
Is there a less cumbersome (and, perhaps, more natural way) to get the same or a better-looking result? Perhaps, someone has already done the exercise?

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

Post Reply