3

I have this MWE where there are two long set

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,amssymb}

\begin{document} Supponiamo che l'insieme sia $A={a,b,c}$. L'insieme delle parti di $A$ è l'insieme che ha come elementi tutti i possibili sottoinsiemi dell'insieme $A$. Per tutti i possibili sottoinsiemi di $A$ intendiamo proprio tutti i suoi sottoinsiemi, compresi quelli impropri, cioè l'insieme vuoto e l'insieme $A$ stesso.

Abbiamo [\mathcal{P}(A) = { B \mid B \subseteq A } = {\emptyset, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, A}= {\emptyset, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, A}]

Devo trovare $\mathcal{P}(\mathcal{P}(A))$. Se indico gli elementi di $\mathcal{P}(A)$ con $S_1=\emptyset, S_2={a}, \ldots S_8=A$, posso costruire

$\mathcal{P}(\mathcal{P}(A))= {S_1, S_2, S_3, S_4, S_5, S_6, S_7, S_8, {S_1, S_2},{S_1, S_3},{S_1, S_4},\ldots{S_1, S_8},{S_2, S_3}\ldots,{S_2, S_8},\ldots}$ $\mathcal{P}(\mathcal{P}(A))= {\emptyset, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, A, {\emptyset, {a}},{{a}, {b}},{{b}, {c}},\ldots{\emptyset, A}, {{a}, {b}}\ldots,{{a}, A},\ldots}$

e così via. È corretto? Se $|\mathcal{P}(A)|=2^n$ elementi, allora $\mathcal{P}(\mathcal{P}(A))=2^{|\mathcal P(A)|}=2^{2^n}$?

Se la definizione di $\mathcal{P}(A) = { B \mid B \subseteq A }$ qual è la definizione di $\mathcal{P}(\mathcal{P}(A))$ per poter capire come si costruiscono?

\end{document}

What is the best method to be able to see them on aligned two o more lines? Break them using, for example a split, or a multiline or to write it consequentially as if it were of the text?

enter image description here

Sebastiano
  • 54,118
  • 3
    You shouldn't listen to me, but if it was logic, I wouldn't list it inline. In the first case, wouldn't it make sense to align on the =? (I guess that's 'break it up', but I don't really understand what you mean by the second option, so maybe I'm just in the dark.) – cfr Sep 27 '23 at 23:58
  • 1
    @cfr +1 on the comment. I hope it has made my question clearer. Thank you very much. – Sebastiano Sep 28 '23 at 06:41
  • 1
    Ah, you mean keep it inline but write it sequentially! Thanks for editing. – cfr Sep 28 '23 at 13:49

2 Answers2

6

To my opinion is your text better readable, if long sets are written in display math form:

enter image description here

For this I use aligned* and multlined of mathtools package:

\documentclass[a4paper,12pt]{article}
\usepackage{mathtools,amssymb}

\begin{document} Supponiamo che l'insieme sia $A={a,b,c}$. L'insieme delle parti di $A$ è l'insieme che ha come elementi tutti i possibili sottoinsiemi dell'insieme $A$. Per tutti i possibili sottoinsiemi di $A$ intendiamo proprio tutti i suoi sottoinsiemi, compresi quelli impropri, cioè l'insieme vuoto e l'insieme $A$ stesso.

Abbiamo \begin{align} \mathcal{P}(A) & = { B \mid B \subseteq A } \ & = \bigl{\emptyset, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, A\bigr} \ & = \bigl{\emptyset, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, A\bigr} \end{align}

Devo trovare $\mathcal{P}(\mathcal{P}(A))$. Se indico gli elementi di $\mathcal{P}(A)$ con $S_1=\emptyset, S_2={a}, \dotsc, S_8=A$, posso costruire \begin{align} \mathcal{P}(\mathcal{P}(A)) & = \begin{multlined}[t] \bigl{S_1, S_2, S_3, S_4,S_5,S_6,S_7,S_8, \ {S_1,S_2},{S_1,S_3},\dotsc,{S_1,S_8},{S_2,S_3},\dotsc,{S_2,S_8},\dots\bigr} \ \end{multlined} \[-\baselineskip] %\mathcal{P}(\mathcal{P}(A)) & = \begin{multlined}[t][0.6\linewidth] \bigl{\emptyset,{a},{b},{c}, {a,b},{a,c},{b,c}, \ {\emptyset,{a}},{{a},{b}},{{b},{c}},\dotsc,A, \ {\emptyset,A},{{a},{b}},\dotsc,{{a},A},\dots\bigr} \end{multlined} \end{align} e così via. È corretto? Se $|\mathcal{P}(A)|=2^n$ elementi, allora $\mathcal{P}(\mathcal{P}(A))=2^{|\mathcal P(A)|}=2^{2^n}$?

Se la definizione di $\mathcal{P}(A) = { B \mid B \subseteq A }$ qual è la definizione di $\mathcal{P}(\mathcal{P}(A))$ per poter capire come si costruiscono?

\end{document}

Zarko
  • 296,517
4

I doubt that there's a general rule that answers your question.

  • There will be cases for which it's clearly preferable to put the math material containing commas out of the running text and into a display -- and use of the amsmath/mathtools multline-display environments, if need be.

  • Similarly, there will be cases for which there's no compelling reason to apply the previous choice -- and hence for which a solution may have to be found that allows line breaks at commas while in (inline) math mode.

  • And, naturally, there will be cases where one could proceed either way.

Speaking for myself (who else?!), I'd say that for the material at hand, case 1 applies in paragraph (the one that starts with "Abbiamo"/"We have"), while keeping inline math mode would appear to be the better choice in paragraph 3. (See Allowing line break at ',' in inline math mode for a method that automates allowing line breaks after commas in inline math mode.) Of course, others may disagree with my view.

enter image description here

\documentclass[a4paper,12pt]{article}
\usepackage{amsmath,amssymb}
\usepackage[T1]{fontenc}
\usepackage[italian]{babel}
\usepackage{microtype} % <-- optional

% See https://tex.stackexchange.com/a/1960/5001: \makeatletter \def\old@comma{,} \catcode`,=13 \def,{% \ifmmode% \old@comma\discretionary{}{}{}% \else% \old@comma% \fi% } \makeatother

\begin{document}

Supponiamo che l'insieme sia $A={a,b,c}$. L'insieme delle parti di~$A$ è l'insieme che ha come elementi tutti i possibili sottoinsiemi dell'insieme~$A$. Per tutti i possibili sottoinsiemi di~$A$ intendiamo proprio tutti i suoi sottoinsiemi, compresi quelli impropri, cioè l'insieme vuoto e l'insieme $A$ stesso.

Abbiamo \begin{equation} \begin{split} \mathcal{P}(A) &= { B \mid B \subseteq A } \ &= {\emptyset, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, A} \ &= {\emptyset, {a}, {b}, {c}, {a, b}, {a, c}, {b, c}, A} ,. \end{split} \end{equation}

Devo trovare $\mathcal{P}(\mathcal{P}(A))$. Se indico gli elementi di $\mathcal{P}(A)$ con $S_1=\emptyset, S_2={a}, \dots, S_8=A$, posso costruire $\mathcal{P}(\mathcal{P}(A))= {S_1, S_2, S_3, S_4,S_5,S_6,S_7,S_8,{S_1,S_2},{S_1,S_3},{S_1,S_4},\dots,{S_1,S_8},{S_2,S_3},\dots,{S_2,S_8},\dots}$. $\mathcal{P}(\mathcal{P}(A))= {\emptyset,{a},{b},{c},{a,b},{a,c},{b,c},A,{\emptyset,{a}},{{a},{b}},{{b},{c}},\dots,{\emptyset,A},{{a},{b}},\dots,{{a},A},\dots}$ e così via. È corretto? Se $|\mathcal{P}(A)|=2^n$ elementi, allora $\mathcal{P}(\mathcal{P}(A))=2^{|\mathcal P(A)|}=2^{2^n}$?

Se la definizione di $\mathcal{P}(A) = { B \mid B \subseteq A }$ qual è la definizione di $\mathcal{P}(\mathcal{P}(A))$ per poter capire come si costruiscono?

\end{document}

Mico
  • 506,678