I'm looking to create a collage of sorts with various equations as well as some commutative diagrams. I normally use tikzcd to make diagrams so if I can use that here it would be helpful. The end goal would be something like this:

enter image description here

Specifically, I'm wondering how to:

  1. Place expressions in arbitrary locations
  2. Place text in arbitrary locations
  3. Include diagrams and possibly pictures

I don't know if it makes any difference, but I normally work in overleaf.

Additional things which would be neat but not really necessary: Changing page/text color (like in the image) and rotating equations.

This question is very similar but it has no answers and I'm not sure I understand the approach the OP took.

I also saw this but I'm having a hard time figuring out how to use beamer. However, I think it may be doable. What are some tips to using beamer to do this sort of thing? Or is there a better way?

  • You could do something like this, perhaps with more \parbox with mathematics and less high quality artwork tex.stackexchange.com/a/213293/1090 Feb 12, 2021 at 0:13
  • Do you want to do it by hand or automatically? Looks doable via MetaPost and a lot of randomizers, but it depends on your willingness to use MetaPost... TikZ would perform too slowly in comparison
    – user226564
    Feb 12, 2021 at 23:11
  • @JairoA.delRio By hand, since I would like precise control over placement of images/text. I'm not familiar with MetaPost, but I'd be willing to learn it (I have no time limit, this is just for fun).
    – P-addict
    Feb 12, 2021 at 23:58

1 Answer 1


It's a fitting job for xcoffins. It is a package created to facilitate the layout of stuff on the page: text, tables, images, graphics, etc., in a very simple way. Handy to construct cover and title pages, and collages...

It works like a graphic design program (almost, no GUI, you have to compile to see the changes) in the sense that it uses the relative positions of the objects, rather than absolute coordinates.

You put the material in special boxes that have several handles (in the corners, in the middle of the sides, in the center and others) that allow you to join the handle of one box with a handle of another box. For example, the lower left corner of the first with the upper left corner of the second: [hc,b] refers to a point at the bottom and the horizontal center of the box, [hc,t] refers to point at the top and the horizontal center of the box, etc.

On top of that, you can add vertical and horizontal offsets to position the content exactly where you want it.


I collected several examples: a table, figures, text (the title), equations, tikz pictures and tikz-cd, and assembled all them (15 objects) using a large box the size of the text area, like a frame (called \Framex, light blue) to collect the others. A couple were rotated.

All the material will go on top of the frame. After all the joins are completed, the frame is typeset on a single page as a text object (it is not a float).

I included a table with the dimensions of the boxes (using the tools provided by xcoffins plus a macro to convert pt to cm), before the assembly process. It might be helpful to build a mock-up model with paper rectangles to find the best arrangement.


I recommend doing one merge (Join) at a time and compiling, to see how the box fits together and if offsets are needed. The process is very fast once you understand the name of the basic identifiers of the handles using the letters l, r, t, b, vc, hc.

I also recommend reading the manual on the package, replicating the example for a quick learning curve.

Please see another answer to a similar question:

How do I binpack a set of tables on a page?

This is the code.


\usepackage[left=1.00cm, right=1.00cm, top=2.00cm, bottom=1.00cm]{geometry}



% #1 = em or ex (or any other unit)
% #2 = dimen to convert
    \texttt{#2~=~\fp_to_decimal:n { round ( (#2)/(1#1), 5 ) }#1}
\DeclareExpandableDocumentCommand{\thelength}{ O{mm} m }
    \fp_to_decimal:n { round ( #2/1#1, 1 ) } #1

%% Filling the boxes    <<<<<<<<<<<<<<<


        \draw[->]   (0,2) -- (0,4) node[above]{$\cos{\bigl(\frac{\pi}{L} x\bigr)}$} ;
        \draw[->]   (-3,3) -- (3,3) node[right]{$x$} ;
        \draw[very thick,line cap=round,domain=-2:2, color=green] plot[samples=200] (\x, {3+2/3*cos(\x*45)}) ;
        \draw       (-2,3.1) -- (-2,2.9)    (2,3.1) -- (2,2.9)  (2.5,3.75) node{$m_x=\frac{1}{2}$} ;        
        \draw[->]   (0,-1) -- (0,1) node[above]{$\sin{\bigl(\frac{2\pi}{L} x\bigr)}$} ;
        \draw[->]   (-3,0) -- (3,0) node[right]{$x$} ;
        \draw[very thick,line cap=round,domain=-2:2,color=red]plot[samples=200] (\x, {2/3*sin(\x*90)}) ;
        \draw       (-2,.1) -- (-2,-.1)     (2,.1) -- (2,-.1)(2.5,.75) node{$m_x=1$} ;  
        \draw[->]   (0,-4) -- (0,-2) node[above]{$\cos{\bigl(\frac{3\pi}{L} x\bigr)}$} ;
        \draw[->]   (-3,-3) -- (3,-3) node[right]{$x$} ;
        \draw[very thick,line cap=round,domain=-2:2,color=blue]plot[samples=200] (\x, {-3+2/3*cos(\x*135)}) ;
        \draw   (-2,-2.9) -- (-2,-3.1)  (2,-2.9) -- (2,-3.1)(2.5,-2.25) node{$m_x=\frac{3}{2}$} ;

    \begin{tikzcd}[ampersand replacement=\&]
        A \arrow{r}{\varphi} \arrow[swap]{d}{\varrho_f} \& B \arrow{d}{\varrho_g} \\%
        A_f \arrow{r}{\varphi_f}\& B_g

    \begin{tikzcd}[swap, ampersand replacement=\&]
        F_t(x) \arrow[Rightarrow]{r}[inner sep = 1ex]{\mathcal{B}_T} 
        \& F(x) \arrow{d}[swap]{\mathcal{B}_X}{\exists} \\  
        A_t \arrow{r}[swap]{\exists}{\mathcal{B}_T} \arrow[dashed,dash]{ur}
        \& A

        \begin{tikzcd}[row sep={40,between origins}, column sep={40,between origins},  ampersand replacement=\&]
        \& X_1 \times_{S_1} Y_1 \ar{rr}\ar{dd}\ar{dl} \&  \& Y_1\vphantom{\times_{S_1}} \ar{dd}\ar{dl} \\
        X_1 \ar[crossing over]{rr} \ar{dd} \& \& S_1 \\
        \& X_2 \times_{S_2} Y_2  \ar{rr} \ar{dl} \& \&  Y_2\vphantom{\times_{S_1}} \ar{dl} \\
        X_2 \ar{rr} \&\& S_2 \ar[from=uu,crossing over]

        & & \multicolumn{3}{|c|}{Particle Type} & Hcharge \\
        & Quarks & $u$ & $c$ & $t$ & $1/6$ \\
        Left &  & $d$ & $s$ & $b$ & $1/6$ \\
        Handed & Leptons & $\nu_{e}$ & $\nu_{\mu}$ & $\nu_{\tau}$ & $-1/2$\\
        & & $e$ & $\mu$ & $\tau$ & $-1/2$ \\
        \hline \hline
        & Quarks & $u$ & $c$  & $t$ & $2/3$\\
        Right & & $d$ & $s$ & $b$ & $-1/3$\\
        Handed & Leptons & & & &\\
        & & $e$ & $\mu$ & $\tau$ & $-1$\\

        declare function={a(\x)=(\x/10)^2;},
        declare function={b(\x)=-(\x/10)^2-10;},
        declare function={f(\x) = 6*sqrt(2)*rad(atan(\x/(2*sqrt(2))))*5/2.99;}
            domain=0:10, xmin=0,
            axis lines=middle,
            axis equal image,
            xtick=\empty, ytick=\empty,
            clip mode=individual, clip=false
            \addplot [red, only marks, mark=*, samples=500, mark size=0.75]  %large con 500000
            (f(x), {0.5*(a(x)+b(x)) + rand * ( a(f(x)) - b(f(x))) / 2});
            \addplot [thick] {a(x)};
            \addplot [thick] {b(x)};

    \begin{tikzpicture}[node distance=2cm, auto]
        \node (C) {$C$};
        \node (P) [below of=C] {$\prod_{i \in I} A_i$};
        \node (Ai) [right of=P] {$A_i$};
        \draw[->,color=red] (C) to node {$f_i$} (Ai);
        \draw[->, dashed] (C) to node [swap] {$\langle f_i \rangle_{i \in I}$} (P);
        \draw[->, color=green] (P) to node [swap] {$\pi_i$} (Ai);

        \int_{-\infty}^{\infty} e^{\pm j2\pi ft}\;dt
        &=&\int_{-\infty}^{\infty} \cos(2\pi ft)\;dt\pm j\int_{-\infty}^{\infty} \sin(2\pi ft)\;dt
        \nonumber \\
        &=&2\int_0^{\infty} \cos(2\pi ft)\;dt=\delta(f)=2\pi \delta(\omega).

        \begin{axis}[only marks, mark size=1.5pt,domain=1:10,scale=0.6]
            ({cos(rnd r)*x+rnd},{(rnd+1)*x+rnd});


        \begin{tikzpicture}[xscale=-1,yscale=0.5,remember picture]
        \begin{axis}[hide axis,width=8cm,height=4cm,clip=false] 
            \addplot[domain=20:300,samples=800, colormap={}{ color(2cm)=(red);
            ultra thick, point meta=x*x,mesh]{sin(pow(x,2)/15)};

    $\Psi(x) \rightarrow \Psi^{\prime}(x) = e^{-i\omega^a(x) \mathbf{t}^a} \Psi(x)$\\
    where the $\mathbf{t}^a$ are the $N^2 -  1$ generators of the group. These generators, $\mathbf{t}^a$, have a distinct algebra \\
    $[\mathbf{t}^a,\mathbf{t}^b] = if^{abc}\mathbf{t}^c$

    \centering \bfseries \Large A collage of equations, figures, tikz pictures, text and tables using {\color{red} xcoffins}

    $s= \left(k_1 + k_2 \right)^2$\\
    The Lorentz invariant phase space for the outgoing state, $d\Phi_N$, \\ is given by\\
    $d\Phi_N = \left(2\pi \right)^4 \delta^4\left(k_{1} + k_2 - \Sigma_i^N k_i \right)$ \\
    $\prod_{i}^{N} \frac{d^4 k_i}{\left(2\pi \right)^4} \left(2\pi\right) \delta \left(k_i^2 - m_i^2 \right)$

%%  Joining the boxes to the frame  and adding offsets <<<<<<<<<<<<<<<<<<<<<<<<<,















%%  Typeset the assembly in the left margin of the first line  <<<<<<<<<<<<<<<      

\section*{Heights and widths}
    ID & height & width \\
    figi    &\thelength[mm]{\CoffinTotalHeight\figi}    & \thelength[mm]{\CoffinWidth\figi}     \\  
    tkzii   & \thelength[mm]{\CoffinTotalHeight\tkzii}  & \thelength[mm]{\CoffinWidth\tkzii}    \\  
    tkziii  & \thelength[mm]{\CoffinTotalHeight\tkziii} & \thelength[mm]{\CoffinWidth\tkziii}   \\   
    tkziv   & \thelength[mm]{\CoffinTotalHeight\tkziv}  & \thelength[mm]{\CoffinWidth\tkziv}    \\  
    tkzv    & \thelength[mm]{\CoffinTotalHeight\tkzv}   & \thelength[mm]{\CoffinWidth\tkzv}     \\ 
    tblvi   & \thelength[mm]{\CoffinTotalHeight\tblvi}  & \thelength[mm]{\CoffinWidth\tblvi}    \\  
    tkzvii  & \thelength[mm]{\CoffinTotalHeight\tkzvii} & \thelength[mm]{\CoffinWidth\tkzvii}   \\   
    tkzviii & \thelength[mm]{\CoffinTotalHeight\tkzviii}& \thelength[mm]{\CoffinWidth\tkzviii}  \\
    eqix    & \thelength[mm]{\CoffinTotalHeight\eqix}   & \thelength[mm]{\CoffinWidth\eqix}     \\
    tkzx    & \thelength[mm]{\CoffinTotalHeight\tkzx}   & \thelength[mm]{\CoffinWidth\tkzx}     \\
    figxi   & \thelength[mm]{\CoffinTotalHeight\figxi}  & \thelength[mm]{\CoffinWidth\figxi}    \\
    tkzxii  & \thelength[mm]{\CoffinTotalHeight\tkzxii} & \thelength[mm]{\CoffinWidth\tkzxii}   \\
    eqxiii  & \thelength[mm]{\CoffinTotalHeight\eqxiii} & \thelength[mm]{\CoffinWidth\eqxiii}   \\
    txtxiv  & \thelength[mm]{\CoffinTotalHeight\txtxiv} & \thelength[mm]{\CoffinWidth\txtxiv}   \\  % title
    eqxv    & \thelength[mm]{\CoffinTotalHeight\eqxv}   & \thelength[mm]{\CoffinWidth\eqxv}     \\

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.