2

I have some formulas where I have big simbols like \sum of \bigvee with indexes. For indexes are too long, the argument moves too far to the right:

\item[]\AL
\begin{flalign*}
%
&\bigvee\limits_{\substack{1\leqslant k\leqslant n\\
        1\leqslant i_1<i_1<\ldots<i_{k}\leqslant n}}
\enspace x_{i_1}x_{i_2}\cdots x_{i_{k}}.&\\ 
\end{flalign*}

too big space

I fix it using \mathclap:

\item[]\AL
\begin{flalign*}
%
&\bigvee\limits_{\mathclap{\substack{1\leqslant k\leqslant n\\
            1\leqslant i_1<i_1<\ldots<i_{k}\leqslant n}}}
\enspace x_{i_1}x_{i_2}\cdots x_{i_{k}}.&\\ 
\end{flalign*}

mathclap

But it moves to the left to much. So I try using duct tape:

\item[]\AL
\newlength{\mylll}%
\settowidth{\mylll}{${}_{1\leqslant i_1<i_1<\ldots<i_{k}\leqslant n}$}%
\begin{flalign*}
%
&\hspace{.5\mylll}\bigvee\limits_{\mathclap{\substack{1\leqslant k\leqslant n\\
            1\leqslant i_1<i_1<\ldots<i_{k}\leqslant n}}}
\enspace x_{i_1}x_{i_2}\cdots x_{i_{k}}.&\\ 
\end{flalign*}

enter image description here

Everything seems fine, but it is not. You can see that the formula moved right a bit more than I expected (extra spacing is marked blue):

enter image description here

My question is how to properly deal with such alignement without using ruler to correctly adjust the \hspace{???}

My MWE (LuaLaTex):

\documentclass[10pt,twoside,a4paper]{book}
%\usepackage{showframe}
%\usepackage{layout}
\usepackage{geometry}
\geometry{margin=1in}
%
\usepackage{amsmath}
\usepackage{mathtools}
%
\usepackage{amsthm}
\usepackage{thmtools}
%
\usepackage{newtxmath}
%
\usepackage{lipsum}
%
\usepackage{enumitem}


%%%%%
%Definition of a new list type
\newcounter{qcounter}
\newenvironment{questions}{
    \begin{list}{ 
            \bfseries\upshape\arabic{qcounter}.
        }{
            \renewcommand{\makelabel}[1]{%
                \textbf{\refstepcounter{qcounter}\arabic{qcounter}##1.}}%
            \usecounter{qcounter}
            \setlength{\labelwidth}{0.5em}
            \setlength{\labelsep}{0.5em}
            \setlength{\leftmargin}{\labelwidth+\labelsep+0.5em}
            \setlength{\itemsep}{2pt}
            \setlength{\listparindent}{1em}
            \setlength{\parsep}{1pt}
            \setlength{\topsep}{6pt}
        } 
    }{    
    \end{list}
}

%Command to correctly align environments in the list
\newcommand{\AL}{%
    \setlength{\abovedisplayskip}{0pt}%
    \setlength{\belowdisplayskip}{0pt}%
    \setlength{\abovedisplayshortskip}{0pt}%
    \setlength{\belowdisplayshortskip}{0pt}%
    \setlength{\multlinegap}{0pt}%
    ~\vspace*{-\baselineskip}%
}


\begin{document}

\begin{questions}

%too big space
\item[]\AL
\begin{flalign*}
%
&\bigvee\limits_{\substack{1\leqslant k\leqslant n\\
        1\leqslant i_1<i_1<\ldots<i_{k}\leqslant n}}
\enspace x_{i_1}x_{i_2}\cdots x_{i_{k}}.&\\ 
\end{flalign*}

%too left
\item[]\AL
\begin{flalign*}
%
&\bigvee\limits_{\mathclap{\substack{1\leqslant k\leqslant n\\
            1\leqslant i_1<i_1<\ldots<i_{k}\leqslant n}}}
\enspace x_{i_1}x_{i_2}\cdots x_{i_{k}}.&\\ 
\end{flalign*}

%not very nice looking one
\item[]\AL
\newlength{\mylll}%
\settowidth{\mylll}{${}_{1\leqslant i_1<i_1<\ldots<i_{k}\leqslant n}$}%
\begin{flalign*}
%
&\hspace{.5\mylll}\bigvee\limits_{\mathclap{\substack{1\leqslant k\leqslant n\\
            1\leqslant i_1<i_1<\ldots<i_{k}\leqslant n}}}
\enspace x_{i_1}x_{i_2}\cdots x_{i_{k}}.&\\ 
\end{flalign*}

\item[]\lipsum[2]

\end{questions}

\end{document}
2

You don't need to load both amsmath and mathtools, as the latter loads the former. Furthermore, mathtools provides the nice command \smashoperator, which does precisely what you need:

\item[]\AL
\begin{flalign*}
%
&\smashoperator[r]{\bigvee_{\substack{1\leqslant k\leqslant n\\
            1\leqslant i_1<i_1<\ldots<i_{k}\leqslant n}}}
\enspace x_{i_1}x_{i_2}\cdots x_{i_{k}}.&\\ 
\end{flalign*}

You can omit the explicit call of \limits since \smashoperator automatically uses it.

From the mathtools documentation

[...] mathtools provides a \smashoperator command, which simply ignores the width of the sub- and superscript. It also takes an optional argument, l, r, or lr (default), denoting which side of the operator should be ignored (smashed).

Note that as long as you do not need some alignment, flalign is here an overkill. Just use $\displaymath ... $.

  • Thanks, it works perfectly. What does the optional argumnet [r] do? – Michael Fraiman Mar 20 '17 at 14:49
  • @MichaelFreimann see edit. – campa Mar 20 '17 at 14:53
  • I get it. I also updated the question with additional problem – Michael Fraiman Mar 20 '17 at 14:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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