Skip to content

Instantly share code, notes, and snippets.

@phck
Created August 13, 2020 15:56
Show Gist options
  • Save phck/0ebda3dd4c54db50ba1e46a60982b3c1 to your computer and use it in GitHub Desktop.
Save phck/0ebda3dd4c54db50ba1e46a60982b3c1 to your computer and use it in GitHub Desktop.
Randomly select between sub and super-scripts for ends and coends.
\documentclass{minimal}
% Help from https://tex.stackexchange.com/a/116198
\ifnum\numexpr\pdfuniformdeviate 2\relax<1\relax
\newcommand{\End}[1]{\int_{#1}}
\newcommand{\coEnd}[1]{\int^{#1}}%
\else
\newcommand{\End}[1]{\int^{#1}}
\newcommand{\coEnd}[1]{\int_{#1}}%
\fi
\begin{document}
Let us test: \(\End{c\in C} F\) and \(\coEnd{d\in D} G\).
\end{document}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment