Implementation of “clouds” for notes in the text [duplicate]












3
















This question already has an answer here:




  • Rectanglar cloud shaped node in TikZ

    4 answers




It is hard to describe what I want in a setence, better take a look on how I usually write down (lecture) notes.



enter image description here



I want to point your attention to these little "clouds" which contain some useful, but not necessary information about a sentence, for example.



It is important to me that I have these notes in the text and not "outside" (as a footnote or so).



Also notice that notes are placed wherever there is enough space.



We already have examples of such clouds here on TEX.SX:
cloud examples



So I search for something like a stackrel or overbrace command that does all the alignment and spacing for me (obviously it would take ages to align manually with all those clouds otherwise).










share|improve this question















marked as duplicate by subham soni, Phelype Oleinik, JouleV, Stefan Pinnow, Raaja 11 hours ago


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.























    3
















    This question already has an answer here:




    • Rectanglar cloud shaped node in TikZ

      4 answers




    It is hard to describe what I want in a setence, better take a look on how I usually write down (lecture) notes.



    enter image description here



    I want to point your attention to these little "clouds" which contain some useful, but not necessary information about a sentence, for example.



    It is important to me that I have these notes in the text and not "outside" (as a footnote or so).



    Also notice that notes are placed wherever there is enough space.



    We already have examples of such clouds here on TEX.SX:
    cloud examples



    So I search for something like a stackrel or overbrace command that does all the alignment and spacing for me (obviously it would take ages to align manually with all those clouds otherwise).










    share|improve this question















    marked as duplicate by subham soni, Phelype Oleinik, JouleV, Stefan Pinnow, Raaja 11 hours ago


    This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.





















      3












      3








      3









      This question already has an answer here:




      • Rectanglar cloud shaped node in TikZ

        4 answers




      It is hard to describe what I want in a setence, better take a look on how I usually write down (lecture) notes.



      enter image description here



      I want to point your attention to these little "clouds" which contain some useful, but not necessary information about a sentence, for example.



      It is important to me that I have these notes in the text and not "outside" (as a footnote or so).



      Also notice that notes are placed wherever there is enough space.



      We already have examples of such clouds here on TEX.SX:
      cloud examples



      So I search for something like a stackrel or overbrace command that does all the alignment and spacing for me (obviously it would take ages to align manually with all those clouds otherwise).










      share|improve this question

















      This question already has an answer here:




      • Rectanglar cloud shaped node in TikZ

        4 answers




      It is hard to describe what I want in a setence, better take a look on how I usually write down (lecture) notes.



      enter image description here



      I want to point your attention to these little "clouds" which contain some useful, but not necessary information about a sentence, for example.



      It is important to me that I have these notes in the text and not "outside" (as a footnote or so).



      Also notice that notes are placed wherever there is enough space.



      We already have examples of such clouds here on TEX.SX:
      cloud examples



      So I search for something like a stackrel or overbrace command that does all the alignment and spacing for me (obviously it would take ages to align manually with all those clouds otherwise).





      This question already has an answer here:




      • Rectanglar cloud shaped node in TikZ

        4 answers








      tikz-pgf horizontal-alignment formatting vertical-alignment






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 14 hours ago







      Aericura

















      asked 14 hours ago









      AericuraAericura

      526




      526




      marked as duplicate by subham soni, Phelype Oleinik, JouleV, Stefan Pinnow, Raaja 11 hours ago


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









      marked as duplicate by subham soni, Phelype Oleinik, JouleV, Stefan Pinnow, Raaja 11 hours ago


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
























          2 Answers
          2






          active

          oldest

          votes


















          4














          Unless you want to spend all your time manually placing text so as to wrap around your clouds, I suggest combining it with a marginpar mechanism. The only change to the layout I did was to decrease the textwidth to leave room for the clouds.



          documentclass{article}
          textwidth=dimexprtextwidth-1inrelax
          usepackage{tikz,tabto,lipsum}
          usetikzlibrary{shapes}

          newcommandmargincloud[1]{{%
          tabto{textwidth}%
          llap{%
          rule[-dpstrutbox]{.5pt}{dpstrutbox}%
          rule[-dpstrutbox]{dimexprtextwidth-TabPrevPosrelax}{.5pt}%
          kern-3pt
          smash{rlap{rotatebox[origin=lb]{45}{rule[-dpstrutbox]{60pt}{.5pt}}}}}%
          tabto*{TabPrevPos}%
          marginpar{%
          smash{begin{tikzpicture}
          node [cloud, fill=blue!5, draw,cloud puffs=10,cloud puff arc=120,
          aspect=1.5, inner ysep=1em]{parbox{1in}{raggedright#1}};
          end{tikzpicture}%
          }}%
          }}

          begin{document}
          This is a testmargincloud{My marginnote of some length} of a cloudy
          marginpar. I will continue to write so as to make sure that the line
          is appropriately set at the right height. lipsum[1]

          Now I get to try it again, to see if it still works. Let us do it here%
          margincloud{I would like a longer marginnote to see how this works}
          and see. lipsum[2]

          Finally, we get to try it one last time on the page. I will work
          my way a bit into the paragraph, in order to see if that makes any
          difference at all. Ok, we prepare for this final test of the page.
          Here goes...margincloud{Boo!} lipsum[3]
          end{document}


          enter image description here



          At the OP's request, a version with dotted connectors:



          documentclass{article}
          textwidth=dimexprtextwidth-1inrelax
          usepackage{tikz,tabto,lipsum}
          usetikzlibrary{shapes}
          defdotfill#1{cleadershbox to #1{scalebox{1.4}{.}}hfill}
          newcommanddotline[2][.5em]{leavevmodehbox to #2{dotfill{#1}hfil}}
          newcommandmargincloud[1]{{%
          tabto{textwidth}%
          llap{raisebox{-dpstrutbox}{%
          dotline{dimexprtextwidth-TabPrevPosrelax}%
          kern-3pt
          smash{rlap{rotatebox[origin=lb]{45}{dotline[.7em]{60pt}}}}}}%
          tabto*{TabPrevPos}%
          marginpar{%
          smash{begin{tikzpicture}
          node [cloud, fill=blue!5, draw,cloud puffs=10,cloud puff arc=120,
          aspect=1.5, inner ysep=1em]{parbox{1in}{raggedright#1}};
          end{tikzpicture}%
          }}%
          }}
          sloppy
          begin{document}
          This is a testmargincloud{My marginnote of some length} of a cloudy
          marginpar. I will continue to write so as to make sure that the line
          is appropriately set at the right height. lipsum[1]

          Now I get to try it again, to see if it still works. Let us do it here%
          margincloud{I would like a longer marginnote to see how this works}
          and see. lipsum[2]

          Finally, we get to try it one last time on the page. I will work
          my way a bit into the paragraph, in order to see if that makes any
          difference at all. Ok, we prepare for this final test of the page.
          Here goes...margincloud{Boo!} lipsum[3]
          end{document}


          enter image description here



          Better yet, a version with bubbles:



          documentclass{article}
          textwidth=dimexprtextwidth-1inrelax
          usepackage{tikz,tabto,lipsum}
          usetikzlibrary{shapes}
          defdotfill#1#2{cleadershbox to #1{scalebox{#2}{$circ$}}hfill}
          newcommanddotline[3][.6em]{leavevmodehbox to #2{dotfill{#1}{#3}hfil}}
          newcommandmargincloud[1]{{%
          tabto{textwidth}%
          llap{raisebox{-dpstrutbox}{%
          dotline{dimexprtextwidth-TabPrevPosrelax}{.6}%
          kern-3pt
          smash{rlap{rotatebox[origin=lb]{45}{dotline[.8em]{60pt}{1}}}}}}%
          tabto*{TabPrevPos}%
          marginpar{%
          smash{begin{tikzpicture}
          node [cloud, fill=blue!5, draw,cloud puffs=10,cloud puff arc=120,
          aspect=1.5, inner ysep=1em]{parbox{1in}{raggedright#1}};
          end{tikzpicture}%
          }}%
          }}
          sloppy
          begin{document}
          This is a testmargincloud{My marginnote of some length} of a cloudy
          marginpar. I will continue to write so as to make sure that the line
          is appropriately set at the right height. lipsum[1]

          Now I get to try it again, to see if it still works. Let us do it here%
          margincloud{I would like a longer marginnote to see how this works}
          and see. lipsum[2]

          Finally, we get to try it one last time on the page. I will work
          my way a bit into the paragraph, in order to see if that makes any
          difference at all. Ok, we prepare for this final test of the page.
          Here goes...margincloud{Boo!} lipsum[3]
          end{document}


          enter image description here






          share|improve this answer


























          • That is a good idea. Can I make the line dotted like in my picture?

            – Aericura
            14 hours ago











          • @Aericura Please see my edit.

            – Steven B. Segletes
            13 hours ago











          • Huge thank you!

            – Aericura
            13 hours ago











          • @Aericura Wait for it... a version with bubbles!

            – Steven B. Segletes
            13 hours ago











          • It gets better and better :) Thank you :)

            – Aericura
            13 hours ago



















          5














          With tikz and tikzmark you can do such things.



          documentclass{article}
          usepackage{amsmath}
          usepackage{tikz}
          usetikzlibrary{tikzmark,shapes.symbols,decorations.markings}
          tikzset{thought dots/.style={decoration={markings,
          mark=between positions 4pt and 0.95 step 9pt
          with
          {
          draw (0,0) circle[radius=2pt];
          }
          },decorate}}
          begin{document}
          Standard philosophy $displaystyle (M,sigma_M)
          xrightarrow[tikzmarknode{n}{mathrm{nervously}}]{mathrm{study}}(M,sigma_M)$
          begin{tikzpicture}[overlay,remember picture]
          path[thought dots] (n) -- ++(0.5,-1) node[below,cloud,draw,align=center,aspect=2,inner sep=0pt]{study structure\
          of sets by studying\ maps between them};
          end{tikzpicture}
          end{document}


          enter image description here



          You can address the alignment problem with either shapepar or wrapfig or something along those lines. Which of these options suits you best may only be gauged once you provide us with an MWE, from which we can see which packages you are using and so on. The following is to give you an idea.



          documentclass{article}
          usepackage{amsmath}
          usepackage{wrapfig}
          usepackage{lipsum}
          usepackage{tikz}
          usetikzlibrary{tikzmark,shapes.symbols,decorations.markings}
          tikzset{thought dots/.style={decoration={markings,
          mark=between positions 4pt and 0.95 step 9pt
          with
          {
          draw (0,0) circle[radius=2pt];
          }
          },decorate},iCloud/.style={cloud,draw,align=center,aspect=2,inner sep=0pt}}
          begin{document}
          setcounter{section}{3}
          section{Measurable maps}
          Standard philosophy $displaystyle (M,sigma_M)
          xrightarrow[tikzmarknode{n}{mathrm{nervously}}]{mathrm{study}}(M,sigma_M)$

          begin{wrapfigure}[10]{r}[10pt]{6cm}
          tikzmarknode[iCloud]{nn}{study structure\
          of sets by studying\ maps between them}
          begin{tikzpicture}[overlay,remember picture]
          path[thought dots] (n) -- (nn);
          end{tikzpicture}
          end{wrapfigure}
          $triangleright$ measurable maps

          a map $f:Mto N$ is called measurable if dots lipsum[1]

          end{document}


          enter image description here



          If you want them in the margin, then I'd use tikzpagenodes.



          documentclass{article}
          usepackage[left=1in,top=1.5in,bottom=1.5in,right=2in]{geometry}
          usepackage{amsmath}
          usepackage{lipsum}
          usepackage{tikz}
          usepackage{tikzpagenodes}
          usetikzlibrary{tikzmark,shapes.symbols,decorations.markings}
          tikzset{thought dots/.style={decoration={markings,
          mark=between positions 4pt and 1-4pt step 9pt
          with
          {
          draw (0,0) circle[radius=2pt];
          }
          },decorate},iCloud/.style={cloud,draw,align=center,aspect=2,inner sep=0pt}}
          newcounter{clouds}
          newcommand{AddThought}[3]{begin{tikzpicture}[overlay,remember picture]
          stepcounter{clouds}
          node[iCloud,anchor=west,#1] (cloud-numbervalue{clouds}) at
          (#2.south-|current page text area.east)
          {#3};
          path[thought dots] (#2) -- (cloud-numbervalue{clouds});
          end{tikzpicture}}
          begin{document}
          setcounter{section}{3}
          section{Measurable maps}
          Standard philosophy $displaystyle (M,sigma_M)
          xrightarrow[tikzmarknode{n}{mathrm{nervously}}]{mathrm{study}}(M,sigma_M)$
          AddThought{n}{study structure\
          of sets by studying\ maps between them}

          $triangleright$ measurable maps

          a map $f:Mto N$ is called measurable if dots lipsum[1]

          Something about tikzmarknode{d}{ducks}
          AddThought[yshift=-1cm]{d}{Why always\
          ducks? Don't we\ have enough\ ducks?}

          end{document}


          enter image description here






          share|improve this answer


























          • Okay, but now I have a problem: When putting dummy text after your example, the text.gets placed over the cloud (study nervously :))) Can I place the text around the cloud?

            – Aericura
            14 hours ago













          • @Aericura Your comment was 23 seconds early, I added an example addressing this.

            – marmot
            14 hours ago











          • Ah, I see, that's a great way of doing it (I was looking for something like this)! Thank you!

            – Aericura
            14 hours ago




















          2 Answers
          2






          active

          oldest

          votes








          2 Answers
          2






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          4














          Unless you want to spend all your time manually placing text so as to wrap around your clouds, I suggest combining it with a marginpar mechanism. The only change to the layout I did was to decrease the textwidth to leave room for the clouds.



          documentclass{article}
          textwidth=dimexprtextwidth-1inrelax
          usepackage{tikz,tabto,lipsum}
          usetikzlibrary{shapes}

          newcommandmargincloud[1]{{%
          tabto{textwidth}%
          llap{%
          rule[-dpstrutbox]{.5pt}{dpstrutbox}%
          rule[-dpstrutbox]{dimexprtextwidth-TabPrevPosrelax}{.5pt}%
          kern-3pt
          smash{rlap{rotatebox[origin=lb]{45}{rule[-dpstrutbox]{60pt}{.5pt}}}}}%
          tabto*{TabPrevPos}%
          marginpar{%
          smash{begin{tikzpicture}
          node [cloud, fill=blue!5, draw,cloud puffs=10,cloud puff arc=120,
          aspect=1.5, inner ysep=1em]{parbox{1in}{raggedright#1}};
          end{tikzpicture}%
          }}%
          }}

          begin{document}
          This is a testmargincloud{My marginnote of some length} of a cloudy
          marginpar. I will continue to write so as to make sure that the line
          is appropriately set at the right height. lipsum[1]

          Now I get to try it again, to see if it still works. Let us do it here%
          margincloud{I would like a longer marginnote to see how this works}
          and see. lipsum[2]

          Finally, we get to try it one last time on the page. I will work
          my way a bit into the paragraph, in order to see if that makes any
          difference at all. Ok, we prepare for this final test of the page.
          Here goes...margincloud{Boo!} lipsum[3]
          end{document}


          enter image description here



          At the OP's request, a version with dotted connectors:



          documentclass{article}
          textwidth=dimexprtextwidth-1inrelax
          usepackage{tikz,tabto,lipsum}
          usetikzlibrary{shapes}
          defdotfill#1{cleadershbox to #1{scalebox{1.4}{.}}hfill}
          newcommanddotline[2][.5em]{leavevmodehbox to #2{dotfill{#1}hfil}}
          newcommandmargincloud[1]{{%
          tabto{textwidth}%
          llap{raisebox{-dpstrutbox}{%
          dotline{dimexprtextwidth-TabPrevPosrelax}%
          kern-3pt
          smash{rlap{rotatebox[origin=lb]{45}{dotline[.7em]{60pt}}}}}}%
          tabto*{TabPrevPos}%
          marginpar{%
          smash{begin{tikzpicture}
          node [cloud, fill=blue!5, draw,cloud puffs=10,cloud puff arc=120,
          aspect=1.5, inner ysep=1em]{parbox{1in}{raggedright#1}};
          end{tikzpicture}%
          }}%
          }}
          sloppy
          begin{document}
          This is a testmargincloud{My marginnote of some length} of a cloudy
          marginpar. I will continue to write so as to make sure that the line
          is appropriately set at the right height. lipsum[1]

          Now I get to try it again, to see if it still works. Let us do it here%
          margincloud{I would like a longer marginnote to see how this works}
          and see. lipsum[2]

          Finally, we get to try it one last time on the page. I will work
          my way a bit into the paragraph, in order to see if that makes any
          difference at all. Ok, we prepare for this final test of the page.
          Here goes...margincloud{Boo!} lipsum[3]
          end{document}


          enter image description here



          Better yet, a version with bubbles:



          documentclass{article}
          textwidth=dimexprtextwidth-1inrelax
          usepackage{tikz,tabto,lipsum}
          usetikzlibrary{shapes}
          defdotfill#1#2{cleadershbox to #1{scalebox{#2}{$circ$}}hfill}
          newcommanddotline[3][.6em]{leavevmodehbox to #2{dotfill{#1}{#3}hfil}}
          newcommandmargincloud[1]{{%
          tabto{textwidth}%
          llap{raisebox{-dpstrutbox}{%
          dotline{dimexprtextwidth-TabPrevPosrelax}{.6}%
          kern-3pt
          smash{rlap{rotatebox[origin=lb]{45}{dotline[.8em]{60pt}{1}}}}}}%
          tabto*{TabPrevPos}%
          marginpar{%
          smash{begin{tikzpicture}
          node [cloud, fill=blue!5, draw,cloud puffs=10,cloud puff arc=120,
          aspect=1.5, inner ysep=1em]{parbox{1in}{raggedright#1}};
          end{tikzpicture}%
          }}%
          }}
          sloppy
          begin{document}
          This is a testmargincloud{My marginnote of some length} of a cloudy
          marginpar. I will continue to write so as to make sure that the line
          is appropriately set at the right height. lipsum[1]

          Now I get to try it again, to see if it still works. Let us do it here%
          margincloud{I would like a longer marginnote to see how this works}
          and see. lipsum[2]

          Finally, we get to try it one last time on the page. I will work
          my way a bit into the paragraph, in order to see if that makes any
          difference at all. Ok, we prepare for this final test of the page.
          Here goes...margincloud{Boo!} lipsum[3]
          end{document}


          enter image description here






          share|improve this answer


























          • That is a good idea. Can I make the line dotted like in my picture?

            – Aericura
            14 hours ago











          • @Aericura Please see my edit.

            – Steven B. Segletes
            13 hours ago











          • Huge thank you!

            – Aericura
            13 hours ago











          • @Aericura Wait for it... a version with bubbles!

            – Steven B. Segletes
            13 hours ago











          • It gets better and better :) Thank you :)

            – Aericura
            13 hours ago
















          4














          Unless you want to spend all your time manually placing text so as to wrap around your clouds, I suggest combining it with a marginpar mechanism. The only change to the layout I did was to decrease the textwidth to leave room for the clouds.



          documentclass{article}
          textwidth=dimexprtextwidth-1inrelax
          usepackage{tikz,tabto,lipsum}
          usetikzlibrary{shapes}

          newcommandmargincloud[1]{{%
          tabto{textwidth}%
          llap{%
          rule[-dpstrutbox]{.5pt}{dpstrutbox}%
          rule[-dpstrutbox]{dimexprtextwidth-TabPrevPosrelax}{.5pt}%
          kern-3pt
          smash{rlap{rotatebox[origin=lb]{45}{rule[-dpstrutbox]{60pt}{.5pt}}}}}%
          tabto*{TabPrevPos}%
          marginpar{%
          smash{begin{tikzpicture}
          node [cloud, fill=blue!5, draw,cloud puffs=10,cloud puff arc=120,
          aspect=1.5, inner ysep=1em]{parbox{1in}{raggedright#1}};
          end{tikzpicture}%
          }}%
          }}

          begin{document}
          This is a testmargincloud{My marginnote of some length} of a cloudy
          marginpar. I will continue to write so as to make sure that the line
          is appropriately set at the right height. lipsum[1]

          Now I get to try it again, to see if it still works. Let us do it here%
          margincloud{I would like a longer marginnote to see how this works}
          and see. lipsum[2]

          Finally, we get to try it one last time on the page. I will work
          my way a bit into the paragraph, in order to see if that makes any
          difference at all. Ok, we prepare for this final test of the page.
          Here goes...margincloud{Boo!} lipsum[3]
          end{document}


          enter image description here



          At the OP's request, a version with dotted connectors:



          documentclass{article}
          textwidth=dimexprtextwidth-1inrelax
          usepackage{tikz,tabto,lipsum}
          usetikzlibrary{shapes}
          defdotfill#1{cleadershbox to #1{scalebox{1.4}{.}}hfill}
          newcommanddotline[2][.5em]{leavevmodehbox to #2{dotfill{#1}hfil}}
          newcommandmargincloud[1]{{%
          tabto{textwidth}%
          llap{raisebox{-dpstrutbox}{%
          dotline{dimexprtextwidth-TabPrevPosrelax}%
          kern-3pt
          smash{rlap{rotatebox[origin=lb]{45}{dotline[.7em]{60pt}}}}}}%
          tabto*{TabPrevPos}%
          marginpar{%
          smash{begin{tikzpicture}
          node [cloud, fill=blue!5, draw,cloud puffs=10,cloud puff arc=120,
          aspect=1.5, inner ysep=1em]{parbox{1in}{raggedright#1}};
          end{tikzpicture}%
          }}%
          }}
          sloppy
          begin{document}
          This is a testmargincloud{My marginnote of some length} of a cloudy
          marginpar. I will continue to write so as to make sure that the line
          is appropriately set at the right height. lipsum[1]

          Now I get to try it again, to see if it still works. Let us do it here%
          margincloud{I would like a longer marginnote to see how this works}
          and see. lipsum[2]

          Finally, we get to try it one last time on the page. I will work
          my way a bit into the paragraph, in order to see if that makes any
          difference at all. Ok, we prepare for this final test of the page.
          Here goes...margincloud{Boo!} lipsum[3]
          end{document}


          enter image description here



          Better yet, a version with bubbles:



          documentclass{article}
          textwidth=dimexprtextwidth-1inrelax
          usepackage{tikz,tabto,lipsum}
          usetikzlibrary{shapes}
          defdotfill#1#2{cleadershbox to #1{scalebox{#2}{$circ$}}hfill}
          newcommanddotline[3][.6em]{leavevmodehbox to #2{dotfill{#1}{#3}hfil}}
          newcommandmargincloud[1]{{%
          tabto{textwidth}%
          llap{raisebox{-dpstrutbox}{%
          dotline{dimexprtextwidth-TabPrevPosrelax}{.6}%
          kern-3pt
          smash{rlap{rotatebox[origin=lb]{45}{dotline[.8em]{60pt}{1}}}}}}%
          tabto*{TabPrevPos}%
          marginpar{%
          smash{begin{tikzpicture}
          node [cloud, fill=blue!5, draw,cloud puffs=10,cloud puff arc=120,
          aspect=1.5, inner ysep=1em]{parbox{1in}{raggedright#1}};
          end{tikzpicture}%
          }}%
          }}
          sloppy
          begin{document}
          This is a testmargincloud{My marginnote of some length} of a cloudy
          marginpar. I will continue to write so as to make sure that the line
          is appropriately set at the right height. lipsum[1]

          Now I get to try it again, to see if it still works. Let us do it here%
          margincloud{I would like a longer marginnote to see how this works}
          and see. lipsum[2]

          Finally, we get to try it one last time on the page. I will work
          my way a bit into the paragraph, in order to see if that makes any
          difference at all. Ok, we prepare for this final test of the page.
          Here goes...margincloud{Boo!} lipsum[3]
          end{document}


          enter image description here






          share|improve this answer


























          • That is a good idea. Can I make the line dotted like in my picture?

            – Aericura
            14 hours ago











          • @Aericura Please see my edit.

            – Steven B. Segletes
            13 hours ago











          • Huge thank you!

            – Aericura
            13 hours ago











          • @Aericura Wait for it... a version with bubbles!

            – Steven B. Segletes
            13 hours ago











          • It gets better and better :) Thank you :)

            – Aericura
            13 hours ago














          4












          4








          4







          Unless you want to spend all your time manually placing text so as to wrap around your clouds, I suggest combining it with a marginpar mechanism. The only change to the layout I did was to decrease the textwidth to leave room for the clouds.



          documentclass{article}
          textwidth=dimexprtextwidth-1inrelax
          usepackage{tikz,tabto,lipsum}
          usetikzlibrary{shapes}

          newcommandmargincloud[1]{{%
          tabto{textwidth}%
          llap{%
          rule[-dpstrutbox]{.5pt}{dpstrutbox}%
          rule[-dpstrutbox]{dimexprtextwidth-TabPrevPosrelax}{.5pt}%
          kern-3pt
          smash{rlap{rotatebox[origin=lb]{45}{rule[-dpstrutbox]{60pt}{.5pt}}}}}%
          tabto*{TabPrevPos}%
          marginpar{%
          smash{begin{tikzpicture}
          node [cloud, fill=blue!5, draw,cloud puffs=10,cloud puff arc=120,
          aspect=1.5, inner ysep=1em]{parbox{1in}{raggedright#1}};
          end{tikzpicture}%
          }}%
          }}

          begin{document}
          This is a testmargincloud{My marginnote of some length} of a cloudy
          marginpar. I will continue to write so as to make sure that the line
          is appropriately set at the right height. lipsum[1]

          Now I get to try it again, to see if it still works. Let us do it here%
          margincloud{I would like a longer marginnote to see how this works}
          and see. lipsum[2]

          Finally, we get to try it one last time on the page. I will work
          my way a bit into the paragraph, in order to see if that makes any
          difference at all. Ok, we prepare for this final test of the page.
          Here goes...margincloud{Boo!} lipsum[3]
          end{document}


          enter image description here



          At the OP's request, a version with dotted connectors:



          documentclass{article}
          textwidth=dimexprtextwidth-1inrelax
          usepackage{tikz,tabto,lipsum}
          usetikzlibrary{shapes}
          defdotfill#1{cleadershbox to #1{scalebox{1.4}{.}}hfill}
          newcommanddotline[2][.5em]{leavevmodehbox to #2{dotfill{#1}hfil}}
          newcommandmargincloud[1]{{%
          tabto{textwidth}%
          llap{raisebox{-dpstrutbox}{%
          dotline{dimexprtextwidth-TabPrevPosrelax}%
          kern-3pt
          smash{rlap{rotatebox[origin=lb]{45}{dotline[.7em]{60pt}}}}}}%
          tabto*{TabPrevPos}%
          marginpar{%
          smash{begin{tikzpicture}
          node [cloud, fill=blue!5, draw,cloud puffs=10,cloud puff arc=120,
          aspect=1.5, inner ysep=1em]{parbox{1in}{raggedright#1}};
          end{tikzpicture}%
          }}%
          }}
          sloppy
          begin{document}
          This is a testmargincloud{My marginnote of some length} of a cloudy
          marginpar. I will continue to write so as to make sure that the line
          is appropriately set at the right height. lipsum[1]

          Now I get to try it again, to see if it still works. Let us do it here%
          margincloud{I would like a longer marginnote to see how this works}
          and see. lipsum[2]

          Finally, we get to try it one last time on the page. I will work
          my way a bit into the paragraph, in order to see if that makes any
          difference at all. Ok, we prepare for this final test of the page.
          Here goes...margincloud{Boo!} lipsum[3]
          end{document}


          enter image description here



          Better yet, a version with bubbles:



          documentclass{article}
          textwidth=dimexprtextwidth-1inrelax
          usepackage{tikz,tabto,lipsum}
          usetikzlibrary{shapes}
          defdotfill#1#2{cleadershbox to #1{scalebox{#2}{$circ$}}hfill}
          newcommanddotline[3][.6em]{leavevmodehbox to #2{dotfill{#1}{#3}hfil}}
          newcommandmargincloud[1]{{%
          tabto{textwidth}%
          llap{raisebox{-dpstrutbox}{%
          dotline{dimexprtextwidth-TabPrevPosrelax}{.6}%
          kern-3pt
          smash{rlap{rotatebox[origin=lb]{45}{dotline[.8em]{60pt}{1}}}}}}%
          tabto*{TabPrevPos}%
          marginpar{%
          smash{begin{tikzpicture}
          node [cloud, fill=blue!5, draw,cloud puffs=10,cloud puff arc=120,
          aspect=1.5, inner ysep=1em]{parbox{1in}{raggedright#1}};
          end{tikzpicture}%
          }}%
          }}
          sloppy
          begin{document}
          This is a testmargincloud{My marginnote of some length} of a cloudy
          marginpar. I will continue to write so as to make sure that the line
          is appropriately set at the right height. lipsum[1]

          Now I get to try it again, to see if it still works. Let us do it here%
          margincloud{I would like a longer marginnote to see how this works}
          and see. lipsum[2]

          Finally, we get to try it one last time on the page. I will work
          my way a bit into the paragraph, in order to see if that makes any
          difference at all. Ok, we prepare for this final test of the page.
          Here goes...margincloud{Boo!} lipsum[3]
          end{document}


          enter image description here






          share|improve this answer















          Unless you want to spend all your time manually placing text so as to wrap around your clouds, I suggest combining it with a marginpar mechanism. The only change to the layout I did was to decrease the textwidth to leave room for the clouds.



          documentclass{article}
          textwidth=dimexprtextwidth-1inrelax
          usepackage{tikz,tabto,lipsum}
          usetikzlibrary{shapes}

          newcommandmargincloud[1]{{%
          tabto{textwidth}%
          llap{%
          rule[-dpstrutbox]{.5pt}{dpstrutbox}%
          rule[-dpstrutbox]{dimexprtextwidth-TabPrevPosrelax}{.5pt}%
          kern-3pt
          smash{rlap{rotatebox[origin=lb]{45}{rule[-dpstrutbox]{60pt}{.5pt}}}}}%
          tabto*{TabPrevPos}%
          marginpar{%
          smash{begin{tikzpicture}
          node [cloud, fill=blue!5, draw,cloud puffs=10,cloud puff arc=120,
          aspect=1.5, inner ysep=1em]{parbox{1in}{raggedright#1}};
          end{tikzpicture}%
          }}%
          }}

          begin{document}
          This is a testmargincloud{My marginnote of some length} of a cloudy
          marginpar. I will continue to write so as to make sure that the line
          is appropriately set at the right height. lipsum[1]

          Now I get to try it again, to see if it still works. Let us do it here%
          margincloud{I would like a longer marginnote to see how this works}
          and see. lipsum[2]

          Finally, we get to try it one last time on the page. I will work
          my way a bit into the paragraph, in order to see if that makes any
          difference at all. Ok, we prepare for this final test of the page.
          Here goes...margincloud{Boo!} lipsum[3]
          end{document}


          enter image description here



          At the OP's request, a version with dotted connectors:



          documentclass{article}
          textwidth=dimexprtextwidth-1inrelax
          usepackage{tikz,tabto,lipsum}
          usetikzlibrary{shapes}
          defdotfill#1{cleadershbox to #1{scalebox{1.4}{.}}hfill}
          newcommanddotline[2][.5em]{leavevmodehbox to #2{dotfill{#1}hfil}}
          newcommandmargincloud[1]{{%
          tabto{textwidth}%
          llap{raisebox{-dpstrutbox}{%
          dotline{dimexprtextwidth-TabPrevPosrelax}%
          kern-3pt
          smash{rlap{rotatebox[origin=lb]{45}{dotline[.7em]{60pt}}}}}}%
          tabto*{TabPrevPos}%
          marginpar{%
          smash{begin{tikzpicture}
          node [cloud, fill=blue!5, draw,cloud puffs=10,cloud puff arc=120,
          aspect=1.5, inner ysep=1em]{parbox{1in}{raggedright#1}};
          end{tikzpicture}%
          }}%
          }}
          sloppy
          begin{document}
          This is a testmargincloud{My marginnote of some length} of a cloudy
          marginpar. I will continue to write so as to make sure that the line
          is appropriately set at the right height. lipsum[1]

          Now I get to try it again, to see if it still works. Let us do it here%
          margincloud{I would like a longer marginnote to see how this works}
          and see. lipsum[2]

          Finally, we get to try it one last time on the page. I will work
          my way a bit into the paragraph, in order to see if that makes any
          difference at all. Ok, we prepare for this final test of the page.
          Here goes...margincloud{Boo!} lipsum[3]
          end{document}


          enter image description here



          Better yet, a version with bubbles:



          documentclass{article}
          textwidth=dimexprtextwidth-1inrelax
          usepackage{tikz,tabto,lipsum}
          usetikzlibrary{shapes}
          defdotfill#1#2{cleadershbox to #1{scalebox{#2}{$circ$}}hfill}
          newcommanddotline[3][.6em]{leavevmodehbox to #2{dotfill{#1}{#3}hfil}}
          newcommandmargincloud[1]{{%
          tabto{textwidth}%
          llap{raisebox{-dpstrutbox}{%
          dotline{dimexprtextwidth-TabPrevPosrelax}{.6}%
          kern-3pt
          smash{rlap{rotatebox[origin=lb]{45}{dotline[.8em]{60pt}{1}}}}}}%
          tabto*{TabPrevPos}%
          marginpar{%
          smash{begin{tikzpicture}
          node [cloud, fill=blue!5, draw,cloud puffs=10,cloud puff arc=120,
          aspect=1.5, inner ysep=1em]{parbox{1in}{raggedright#1}};
          end{tikzpicture}%
          }}%
          }}
          sloppy
          begin{document}
          This is a testmargincloud{My marginnote of some length} of a cloudy
          marginpar. I will continue to write so as to make sure that the line
          is appropriately set at the right height. lipsum[1]

          Now I get to try it again, to see if it still works. Let us do it here%
          margincloud{I would like a longer marginnote to see how this works}
          and see. lipsum[2]

          Finally, we get to try it one last time on the page. I will work
          my way a bit into the paragraph, in order to see if that makes any
          difference at all. Ok, we prepare for this final test of the page.
          Here goes...margincloud{Boo!} lipsum[3]
          end{document}


          enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 13 hours ago

























          answered 14 hours ago









          Steven B. SegletesSteven B. Segletes

          161k9206416




          161k9206416













          • That is a good idea. Can I make the line dotted like in my picture?

            – Aericura
            14 hours ago











          • @Aericura Please see my edit.

            – Steven B. Segletes
            13 hours ago











          • Huge thank you!

            – Aericura
            13 hours ago











          • @Aericura Wait for it... a version with bubbles!

            – Steven B. Segletes
            13 hours ago











          • It gets better and better :) Thank you :)

            – Aericura
            13 hours ago



















          • That is a good idea. Can I make the line dotted like in my picture?

            – Aericura
            14 hours ago











          • @Aericura Please see my edit.

            – Steven B. Segletes
            13 hours ago











          • Huge thank you!

            – Aericura
            13 hours ago











          • @Aericura Wait for it... a version with bubbles!

            – Steven B. Segletes
            13 hours ago











          • It gets better and better :) Thank you :)

            – Aericura
            13 hours ago

















          That is a good idea. Can I make the line dotted like in my picture?

          – Aericura
          14 hours ago





          That is a good idea. Can I make the line dotted like in my picture?

          – Aericura
          14 hours ago













          @Aericura Please see my edit.

          – Steven B. Segletes
          13 hours ago





          @Aericura Please see my edit.

          – Steven B. Segletes
          13 hours ago













          Huge thank you!

          – Aericura
          13 hours ago





          Huge thank you!

          – Aericura
          13 hours ago













          @Aericura Wait for it... a version with bubbles!

          – Steven B. Segletes
          13 hours ago





          @Aericura Wait for it... a version with bubbles!

          – Steven B. Segletes
          13 hours ago













          It gets better and better :) Thank you :)

          – Aericura
          13 hours ago





          It gets better and better :) Thank you :)

          – Aericura
          13 hours ago











          5














          With tikz and tikzmark you can do such things.



          documentclass{article}
          usepackage{amsmath}
          usepackage{tikz}
          usetikzlibrary{tikzmark,shapes.symbols,decorations.markings}
          tikzset{thought dots/.style={decoration={markings,
          mark=between positions 4pt and 0.95 step 9pt
          with
          {
          draw (0,0) circle[radius=2pt];
          }
          },decorate}}
          begin{document}
          Standard philosophy $displaystyle (M,sigma_M)
          xrightarrow[tikzmarknode{n}{mathrm{nervously}}]{mathrm{study}}(M,sigma_M)$
          begin{tikzpicture}[overlay,remember picture]
          path[thought dots] (n) -- ++(0.5,-1) node[below,cloud,draw,align=center,aspect=2,inner sep=0pt]{study structure\
          of sets by studying\ maps between them};
          end{tikzpicture}
          end{document}


          enter image description here



          You can address the alignment problem with either shapepar or wrapfig or something along those lines. Which of these options suits you best may only be gauged once you provide us with an MWE, from which we can see which packages you are using and so on. The following is to give you an idea.



          documentclass{article}
          usepackage{amsmath}
          usepackage{wrapfig}
          usepackage{lipsum}
          usepackage{tikz}
          usetikzlibrary{tikzmark,shapes.symbols,decorations.markings}
          tikzset{thought dots/.style={decoration={markings,
          mark=between positions 4pt and 0.95 step 9pt
          with
          {
          draw (0,0) circle[radius=2pt];
          }
          },decorate},iCloud/.style={cloud,draw,align=center,aspect=2,inner sep=0pt}}
          begin{document}
          setcounter{section}{3}
          section{Measurable maps}
          Standard philosophy $displaystyle (M,sigma_M)
          xrightarrow[tikzmarknode{n}{mathrm{nervously}}]{mathrm{study}}(M,sigma_M)$

          begin{wrapfigure}[10]{r}[10pt]{6cm}
          tikzmarknode[iCloud]{nn}{study structure\
          of sets by studying\ maps between them}
          begin{tikzpicture}[overlay,remember picture]
          path[thought dots] (n) -- (nn);
          end{tikzpicture}
          end{wrapfigure}
          $triangleright$ measurable maps

          a map $f:Mto N$ is called measurable if dots lipsum[1]

          end{document}


          enter image description here



          If you want them in the margin, then I'd use tikzpagenodes.



          documentclass{article}
          usepackage[left=1in,top=1.5in,bottom=1.5in,right=2in]{geometry}
          usepackage{amsmath}
          usepackage{lipsum}
          usepackage{tikz}
          usepackage{tikzpagenodes}
          usetikzlibrary{tikzmark,shapes.symbols,decorations.markings}
          tikzset{thought dots/.style={decoration={markings,
          mark=between positions 4pt and 1-4pt step 9pt
          with
          {
          draw (0,0) circle[radius=2pt];
          }
          },decorate},iCloud/.style={cloud,draw,align=center,aspect=2,inner sep=0pt}}
          newcounter{clouds}
          newcommand{AddThought}[3]{begin{tikzpicture}[overlay,remember picture]
          stepcounter{clouds}
          node[iCloud,anchor=west,#1] (cloud-numbervalue{clouds}) at
          (#2.south-|current page text area.east)
          {#3};
          path[thought dots] (#2) -- (cloud-numbervalue{clouds});
          end{tikzpicture}}
          begin{document}
          setcounter{section}{3}
          section{Measurable maps}
          Standard philosophy $displaystyle (M,sigma_M)
          xrightarrow[tikzmarknode{n}{mathrm{nervously}}]{mathrm{study}}(M,sigma_M)$
          AddThought{n}{study structure\
          of sets by studying\ maps between them}

          $triangleright$ measurable maps

          a map $f:Mto N$ is called measurable if dots lipsum[1]

          Something about tikzmarknode{d}{ducks}
          AddThought[yshift=-1cm]{d}{Why always\
          ducks? Don't we\ have enough\ ducks?}

          end{document}


          enter image description here






          share|improve this answer


























          • Okay, but now I have a problem: When putting dummy text after your example, the text.gets placed over the cloud (study nervously :))) Can I place the text around the cloud?

            – Aericura
            14 hours ago













          • @Aericura Your comment was 23 seconds early, I added an example addressing this.

            – marmot
            14 hours ago











          • Ah, I see, that's a great way of doing it (I was looking for something like this)! Thank you!

            – Aericura
            14 hours ago


















          5














          With tikz and tikzmark you can do such things.



          documentclass{article}
          usepackage{amsmath}
          usepackage{tikz}
          usetikzlibrary{tikzmark,shapes.symbols,decorations.markings}
          tikzset{thought dots/.style={decoration={markings,
          mark=between positions 4pt and 0.95 step 9pt
          with
          {
          draw (0,0) circle[radius=2pt];
          }
          },decorate}}
          begin{document}
          Standard philosophy $displaystyle (M,sigma_M)
          xrightarrow[tikzmarknode{n}{mathrm{nervously}}]{mathrm{study}}(M,sigma_M)$
          begin{tikzpicture}[overlay,remember picture]
          path[thought dots] (n) -- ++(0.5,-1) node[below,cloud,draw,align=center,aspect=2,inner sep=0pt]{study structure\
          of sets by studying\ maps between them};
          end{tikzpicture}
          end{document}


          enter image description here



          You can address the alignment problem with either shapepar or wrapfig or something along those lines. Which of these options suits you best may only be gauged once you provide us with an MWE, from which we can see which packages you are using and so on. The following is to give you an idea.



          documentclass{article}
          usepackage{amsmath}
          usepackage{wrapfig}
          usepackage{lipsum}
          usepackage{tikz}
          usetikzlibrary{tikzmark,shapes.symbols,decorations.markings}
          tikzset{thought dots/.style={decoration={markings,
          mark=between positions 4pt and 0.95 step 9pt
          with
          {
          draw (0,0) circle[radius=2pt];
          }
          },decorate},iCloud/.style={cloud,draw,align=center,aspect=2,inner sep=0pt}}
          begin{document}
          setcounter{section}{3}
          section{Measurable maps}
          Standard philosophy $displaystyle (M,sigma_M)
          xrightarrow[tikzmarknode{n}{mathrm{nervously}}]{mathrm{study}}(M,sigma_M)$

          begin{wrapfigure}[10]{r}[10pt]{6cm}
          tikzmarknode[iCloud]{nn}{study structure\
          of sets by studying\ maps between them}
          begin{tikzpicture}[overlay,remember picture]
          path[thought dots] (n) -- (nn);
          end{tikzpicture}
          end{wrapfigure}
          $triangleright$ measurable maps

          a map $f:Mto N$ is called measurable if dots lipsum[1]

          end{document}


          enter image description here



          If you want them in the margin, then I'd use tikzpagenodes.



          documentclass{article}
          usepackage[left=1in,top=1.5in,bottom=1.5in,right=2in]{geometry}
          usepackage{amsmath}
          usepackage{lipsum}
          usepackage{tikz}
          usepackage{tikzpagenodes}
          usetikzlibrary{tikzmark,shapes.symbols,decorations.markings}
          tikzset{thought dots/.style={decoration={markings,
          mark=between positions 4pt and 1-4pt step 9pt
          with
          {
          draw (0,0) circle[radius=2pt];
          }
          },decorate},iCloud/.style={cloud,draw,align=center,aspect=2,inner sep=0pt}}
          newcounter{clouds}
          newcommand{AddThought}[3]{begin{tikzpicture}[overlay,remember picture]
          stepcounter{clouds}
          node[iCloud,anchor=west,#1] (cloud-numbervalue{clouds}) at
          (#2.south-|current page text area.east)
          {#3};
          path[thought dots] (#2) -- (cloud-numbervalue{clouds});
          end{tikzpicture}}
          begin{document}
          setcounter{section}{3}
          section{Measurable maps}
          Standard philosophy $displaystyle (M,sigma_M)
          xrightarrow[tikzmarknode{n}{mathrm{nervously}}]{mathrm{study}}(M,sigma_M)$
          AddThought{n}{study structure\
          of sets by studying\ maps between them}

          $triangleright$ measurable maps

          a map $f:Mto N$ is called measurable if dots lipsum[1]

          Something about tikzmarknode{d}{ducks}
          AddThought[yshift=-1cm]{d}{Why always\
          ducks? Don't we\ have enough\ ducks?}

          end{document}


          enter image description here






          share|improve this answer


























          • Okay, but now I have a problem: When putting dummy text after your example, the text.gets placed over the cloud (study nervously :))) Can I place the text around the cloud?

            – Aericura
            14 hours ago













          • @Aericura Your comment was 23 seconds early, I added an example addressing this.

            – marmot
            14 hours ago











          • Ah, I see, that's a great way of doing it (I was looking for something like this)! Thank you!

            – Aericura
            14 hours ago
















          5












          5








          5







          With tikz and tikzmark you can do such things.



          documentclass{article}
          usepackage{amsmath}
          usepackage{tikz}
          usetikzlibrary{tikzmark,shapes.symbols,decorations.markings}
          tikzset{thought dots/.style={decoration={markings,
          mark=between positions 4pt and 0.95 step 9pt
          with
          {
          draw (0,0) circle[radius=2pt];
          }
          },decorate}}
          begin{document}
          Standard philosophy $displaystyle (M,sigma_M)
          xrightarrow[tikzmarknode{n}{mathrm{nervously}}]{mathrm{study}}(M,sigma_M)$
          begin{tikzpicture}[overlay,remember picture]
          path[thought dots] (n) -- ++(0.5,-1) node[below,cloud,draw,align=center,aspect=2,inner sep=0pt]{study structure\
          of sets by studying\ maps between them};
          end{tikzpicture}
          end{document}


          enter image description here



          You can address the alignment problem with either shapepar or wrapfig or something along those lines. Which of these options suits you best may only be gauged once you provide us with an MWE, from which we can see which packages you are using and so on. The following is to give you an idea.



          documentclass{article}
          usepackage{amsmath}
          usepackage{wrapfig}
          usepackage{lipsum}
          usepackage{tikz}
          usetikzlibrary{tikzmark,shapes.symbols,decorations.markings}
          tikzset{thought dots/.style={decoration={markings,
          mark=between positions 4pt and 0.95 step 9pt
          with
          {
          draw (0,0) circle[radius=2pt];
          }
          },decorate},iCloud/.style={cloud,draw,align=center,aspect=2,inner sep=0pt}}
          begin{document}
          setcounter{section}{3}
          section{Measurable maps}
          Standard philosophy $displaystyle (M,sigma_M)
          xrightarrow[tikzmarknode{n}{mathrm{nervously}}]{mathrm{study}}(M,sigma_M)$

          begin{wrapfigure}[10]{r}[10pt]{6cm}
          tikzmarknode[iCloud]{nn}{study structure\
          of sets by studying\ maps between them}
          begin{tikzpicture}[overlay,remember picture]
          path[thought dots] (n) -- (nn);
          end{tikzpicture}
          end{wrapfigure}
          $triangleright$ measurable maps

          a map $f:Mto N$ is called measurable if dots lipsum[1]

          end{document}


          enter image description here



          If you want them in the margin, then I'd use tikzpagenodes.



          documentclass{article}
          usepackage[left=1in,top=1.5in,bottom=1.5in,right=2in]{geometry}
          usepackage{amsmath}
          usepackage{lipsum}
          usepackage{tikz}
          usepackage{tikzpagenodes}
          usetikzlibrary{tikzmark,shapes.symbols,decorations.markings}
          tikzset{thought dots/.style={decoration={markings,
          mark=between positions 4pt and 1-4pt step 9pt
          with
          {
          draw (0,0) circle[radius=2pt];
          }
          },decorate},iCloud/.style={cloud,draw,align=center,aspect=2,inner sep=0pt}}
          newcounter{clouds}
          newcommand{AddThought}[3]{begin{tikzpicture}[overlay,remember picture]
          stepcounter{clouds}
          node[iCloud,anchor=west,#1] (cloud-numbervalue{clouds}) at
          (#2.south-|current page text area.east)
          {#3};
          path[thought dots] (#2) -- (cloud-numbervalue{clouds});
          end{tikzpicture}}
          begin{document}
          setcounter{section}{3}
          section{Measurable maps}
          Standard philosophy $displaystyle (M,sigma_M)
          xrightarrow[tikzmarknode{n}{mathrm{nervously}}]{mathrm{study}}(M,sigma_M)$
          AddThought{n}{study structure\
          of sets by studying\ maps between them}

          $triangleright$ measurable maps

          a map $f:Mto N$ is called measurable if dots lipsum[1]

          Something about tikzmarknode{d}{ducks}
          AddThought[yshift=-1cm]{d}{Why always\
          ducks? Don't we\ have enough\ ducks?}

          end{document}


          enter image description here






          share|improve this answer















          With tikz and tikzmark you can do such things.



          documentclass{article}
          usepackage{amsmath}
          usepackage{tikz}
          usetikzlibrary{tikzmark,shapes.symbols,decorations.markings}
          tikzset{thought dots/.style={decoration={markings,
          mark=between positions 4pt and 0.95 step 9pt
          with
          {
          draw (0,0) circle[radius=2pt];
          }
          },decorate}}
          begin{document}
          Standard philosophy $displaystyle (M,sigma_M)
          xrightarrow[tikzmarknode{n}{mathrm{nervously}}]{mathrm{study}}(M,sigma_M)$
          begin{tikzpicture}[overlay,remember picture]
          path[thought dots] (n) -- ++(0.5,-1) node[below,cloud,draw,align=center,aspect=2,inner sep=0pt]{study structure\
          of sets by studying\ maps between them};
          end{tikzpicture}
          end{document}


          enter image description here



          You can address the alignment problem with either shapepar or wrapfig or something along those lines. Which of these options suits you best may only be gauged once you provide us with an MWE, from which we can see which packages you are using and so on. The following is to give you an idea.



          documentclass{article}
          usepackage{amsmath}
          usepackage{wrapfig}
          usepackage{lipsum}
          usepackage{tikz}
          usetikzlibrary{tikzmark,shapes.symbols,decorations.markings}
          tikzset{thought dots/.style={decoration={markings,
          mark=between positions 4pt and 0.95 step 9pt
          with
          {
          draw (0,0) circle[radius=2pt];
          }
          },decorate},iCloud/.style={cloud,draw,align=center,aspect=2,inner sep=0pt}}
          begin{document}
          setcounter{section}{3}
          section{Measurable maps}
          Standard philosophy $displaystyle (M,sigma_M)
          xrightarrow[tikzmarknode{n}{mathrm{nervously}}]{mathrm{study}}(M,sigma_M)$

          begin{wrapfigure}[10]{r}[10pt]{6cm}
          tikzmarknode[iCloud]{nn}{study structure\
          of sets by studying\ maps between them}
          begin{tikzpicture}[overlay,remember picture]
          path[thought dots] (n) -- (nn);
          end{tikzpicture}
          end{wrapfigure}
          $triangleright$ measurable maps

          a map $f:Mto N$ is called measurable if dots lipsum[1]

          end{document}


          enter image description here



          If you want them in the margin, then I'd use tikzpagenodes.



          documentclass{article}
          usepackage[left=1in,top=1.5in,bottom=1.5in,right=2in]{geometry}
          usepackage{amsmath}
          usepackage{lipsum}
          usepackage{tikz}
          usepackage{tikzpagenodes}
          usetikzlibrary{tikzmark,shapes.symbols,decorations.markings}
          tikzset{thought dots/.style={decoration={markings,
          mark=between positions 4pt and 1-4pt step 9pt
          with
          {
          draw (0,0) circle[radius=2pt];
          }
          },decorate},iCloud/.style={cloud,draw,align=center,aspect=2,inner sep=0pt}}
          newcounter{clouds}
          newcommand{AddThought}[3]{begin{tikzpicture}[overlay,remember picture]
          stepcounter{clouds}
          node[iCloud,anchor=west,#1] (cloud-numbervalue{clouds}) at
          (#2.south-|current page text area.east)
          {#3};
          path[thought dots] (#2) -- (cloud-numbervalue{clouds});
          end{tikzpicture}}
          begin{document}
          setcounter{section}{3}
          section{Measurable maps}
          Standard philosophy $displaystyle (M,sigma_M)
          xrightarrow[tikzmarknode{n}{mathrm{nervously}}]{mathrm{study}}(M,sigma_M)$
          AddThought{n}{study structure\
          of sets by studying\ maps between them}

          $triangleright$ measurable maps

          a map $f:Mto N$ is called measurable if dots lipsum[1]

          Something about tikzmarknode{d}{ducks}
          AddThought[yshift=-1cm]{d}{Why always\
          ducks? Don't we\ have enough\ ducks?}

          end{document}


          enter image description here







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 13 hours ago

























          answered 14 hours ago









          marmotmarmot

          117k5150283




          117k5150283













          • Okay, but now I have a problem: When putting dummy text after your example, the text.gets placed over the cloud (study nervously :))) Can I place the text around the cloud?

            – Aericura
            14 hours ago













          • @Aericura Your comment was 23 seconds early, I added an example addressing this.

            – marmot
            14 hours ago











          • Ah, I see, that's a great way of doing it (I was looking for something like this)! Thank you!

            – Aericura
            14 hours ago





















          • Okay, but now I have a problem: When putting dummy text after your example, the text.gets placed over the cloud (study nervously :))) Can I place the text around the cloud?

            – Aericura
            14 hours ago













          • @Aericura Your comment was 23 seconds early, I added an example addressing this.

            – marmot
            14 hours ago











          • Ah, I see, that's a great way of doing it (I was looking for something like this)! Thank you!

            – Aericura
            14 hours ago



















          Okay, but now I have a problem: When putting dummy text after your example, the text.gets placed over the cloud (study nervously :))) Can I place the text around the cloud?

          – Aericura
          14 hours ago







          Okay, but now I have a problem: When putting dummy text after your example, the text.gets placed over the cloud (study nervously :))) Can I place the text around the cloud?

          – Aericura
          14 hours ago















          @Aericura Your comment was 23 seconds early, I added an example addressing this.

          – marmot
          14 hours ago





          @Aericura Your comment was 23 seconds early, I added an example addressing this.

          – marmot
          14 hours ago













          Ah, I see, that's a great way of doing it (I was looking for something like this)! Thank you!

          – Aericura
          14 hours ago







          Ah, I see, that's a great way of doing it (I was looking for something like this)! Thank you!

          – Aericura
          14 hours ago





          Popular posts from this blog

          How to label and detect the document text images

          Vallis Paradisi

          Tabula Rosettana