0

I am working with creating an operator which has too look like this:

Example of the desired symbols

I wanna make clear that I need to change the arguments many times in my document because I am showing relation properties between the operation. The ideal scenary is that it would work as the $\sum$ operator from LaTeX.

Since I need arguments both above and below, I tried to create an operator in latex by using the following function:

\DeclareMathOperator*{\OperOmega}{\Omega}

I worked pretty well until now... However, I am having the following issues. I hope someone can help...

  1. The place where I created the operator has an error, asking to put the operator into math mode. However, when I do so, I got a complete destruction of my document.
  2. I need to put the symbol < in one of the operations, but I got an error in the compiler. It says I am missing the item.
  3. I need to put an $\star$ in one of the subindex and it appers to still have problems.
  4. I would like that everything shows strictly above and below if possible. Is it possible without including the \displaystyle command?

Here's a minimal code:

\documentclass{standalone}

\usepackage{amsmath}

\usepackage{enumitem}

\DeclareMathOperator*{\OperOmega}{\Omega}

\begin{document}

    \begin{enumerate}[label =  $\star$]
         \item $\displaystyle\OperOmega_{<}^{\lambda}[P(x)]$ es BLA.
         \item $\displaystyle\OperOmega_{\star}^{\lambda}[P(x)]$ es BLA.
         \item $\displaystyle\OperOmega_{\leq}^{\lambda_{1}}[P(x)]$ es BLA.
    \end{enumerate}
    
\end{document}
1
  • Maybe you replace standalone to article?
    – Clara
    Commented Feb 21 at 6:43

1 Answer 1

0

Here's a way to do it.

Once you can overlook the kind and number of variations in writing you can generalize these into one or more macros using \newcommand. Mine are just an example from your posted code:

  • IF the argument is always P(x), then it should be absorbed too, i.e. no longer be a variable passed
  • you can't number macros like \OS1{}{}, \OS2{}{}, that's why I used some other approach

Benefits:

  • your text becomes more legible
  • change in one place only to get it right everywhere (hopefully ;-)
%\documentclass{standalone} % see clara https://tex.stackexchange.com/questions/710046/creating-operator-with-arguments-above-and-below#comment1766031_710046
\documentclass[10pt,a4paper]{article}

\usepackage{amsmath}
\usepackage{enumitem}

% ~~~ shortcuts ~~~~~~~~~~~~~~~~~~~
\DeclareMathOperator*{\OperOmega}{\Omega}
\newcommand\OS[2]{$\displaystyle\OperOmega_{#1}^{\lambda}[#2]$}% OperatorSymbol
\newcommand\OSS[2]{$\displaystyle\OperOmega_{#1}^{\lambda_{1}}[#2]$}% OperatorSymbol

% ~~~~~~~~~~~~~~~~~~~~~~~~~
\begin{document}

    \begin{enumerate}[label =  $\star$]
         \item $\displaystyle\OperOmega_{<}^{\lambda}[P(x)]$ es BLA.
         \item $\displaystyle\OperOmega_{\star}^{\lambda}[P(x)]$ es BLA.
         \item $\displaystyle\OperOmega_{\leq}^{\lambda_{1}}[P(x)]$ es BLA.
    \end{enumerate}

\hrule
    \begin{enumerate}[label =  $\star$]
         \item \OS{<}{P(x)} es BLA.
         \item \OS{\star}{P(x)} es BLA.
         \item \OSS{\leq}{P(x)} es BLA.
    \end{enumerate}
    
\end{document}

result

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .