561

Task

Show off your best scientific illustration !

The main purpose of this question is to share beautiful scientific pictures, preferably with an educational aspect.


Content

Your post must contain a nice picture and the associated code. One can post several pictures, but it must be done in different replies. Of course, it must be done with LaTeX & Friends : the post must start with a short sentence to present the language that you chose (TikZ, Asymptote ...) and the main packages that helped you to make the picture. Don't hesitate to add comments.


Reward

The satisfaction to share without expecting a reward :)

Ok ... 300 points reputation bounty for the best up-voted post until the 15th of Feb.


Related links

I'll contact Texample.net webmaster to see if he is interested to share the best illustrations, with the participant's agreement of course.

Contest: Show Off Your Skillz in TeX & Friends

28
  • 18
    that's easy :p dx.doi.org/10.1007/978-3-642-36763-2_46
    – percusse
    Feb 5, 2014 at 8:43
  • 19
    I'll be glad if Till Tantau himself decide to participate, but that would be a bit unfair ... :)
    – Thomas
    Feb 5, 2014 at 8:47
  • 6
    I'm surprised this question wasn't closed already by people like this, on the grounds that it's not a question. Or does that apply only to SO, not to tex.SE? Feb 7, 2014 at 0:06
  • 7
    @DanDascalescu: Here on TeX.SX the mood is much more laazyyy. Think alone the existence of a tag big-list (click on it).
    – Speravir
    Feb 7, 2014 at 0:22
  • 5
    A fantastic proposition... Such "competitions" should be held more often...
    – Aashutosh
    Feb 7, 2014 at 5:51

67 Answers 67

1 2
3
9

Here is our TikZpicture for the Poincare's disk model. We pay attention to that from the announcement of the Fields Medal 2018 - Akshay Venkatesh https://plus.maths.org/content/AV.

% TikZ codes by Le Huy Tien and Bui Quy
% For other TikZ/PGF, Asymptote code, see
% http://tikz.vn/vi/hinhve/mo-hinh-dia-poincare/
\documentclass[tikz,border=5mm]{standalone}
\usetikzlibrary{calc}
\newcommand{\geodesicarc}[4]
{
\def\R{#1} % radius of the big circle
\def\qone{#2} % start angle of the geodesic arc
\def\qtwo{#3} % end angle of the geodesic arc
\def\geodesiccolor{#4} % color of the geodesic arc

\pgfmathsetmacro{\f}{(\qtwo-\qone)/2}
\pgfmathsetmacro{\dq}{abs(\f)}
\pgfmathsetmacro{\r}{\R*tan(\dq)} % radius of the geodesic arc
\pgfmathsetmacro{\rp}{sqrt(\r*\r+\R*\R)} % distance of 2 centers 

\coordinate (I) at (\f+\qone:\rp);
\fill [color=\geodesiccolor] (I) circle (\r);
}% end of \geodesicarc command
\begin{document}
\begin{tikzpicture}
\def\RR{3} % radius of the Poincare's disk
\colorlet{Pdiskcolor}{violet} % color of the Poincare's disk

\clip (0:0) circle (\RR);
\fill[Pdiskcolor] (0,0) circle (\RR);

% Initiate geodesic triangle
\foreach \i in {-30,90,210}
\geodesicarc{\RR}{\i}{\i+120}{white};

% 1st iteration
\foreach \i in {-30,30,...,330}
\geodesicarc{\RR}{\i}{\i+60}{Pdiskcolor};

% 2nd iteration
\foreach \i in {-30,0,...,330}
\geodesicarc{\RR}{\i}{\i+30}{white};

% 3rd iteration
\foreach \i in {-30,-15,...,345}
\geodesicarc{\RR}{\i}{\i+15}{Pdiskcolor};

% 4th iteration
\foreach \i in {-30,-22.5,...,352.5}
\geodesicarc{\RR}{\i}{\i+7.5}{white};

% 5th iteration
\foreach \i in {-30,-26.25,...,356.25}
\geodesicarc{\RR}{\i}{\i+3.75}{Pdiskcolor};

% 6th iteration
\foreach \i in {-30,-28.125,...,358.125}
\geodesicarc{\RR}{\i}{\i+1.875}{white};

\draw[gray] (0,0) circle(\RR);
\end{tikzpicture} 
\end{document}

enter image description here

0
5

PSTricks in action!

\documentclass[pstricks,border=10mm,12pt]{standalone}
\usepackage{pst-eucl,pst-circ}
\psset
{
    dipolestyle=zigzag,
    labelangle=0,
    labeloffset=-.9,
    intensitylabeloffset=-.4,
    tensionstyle=pm,
    tensionoffset=.9,
    tensionlabeloffset=.9,
    %tensioncolor=red,
    %tensionlabelcolor=blue,
}
\begin{document}
\begin{pspicture}[showgrid=none](12,-12)
    \pstGeonode[PosAngle={135,90,45,0,-45,-90,-135,180,45}]
        (2,-2){A}
        (6,-2){B}
        (10,-2){C}
        (10,-6){D}
        (10,-10){E}
        (6,-10){F}
        (2,-10){G}
        (2,-6){H}
        (6,-6){I}
    %
    \resistor[intensitylabel=$i_1$,tensionlabel=$V_{HA}$](H)(A){$R_1$}
    \resistor[tensionlabel=$V_{AB}$](A)(B){$R_2$}
    \vdc[tensionlabel=$V_{BC}$](B)(C){$E_1$}
    \resistor[tensionlabel=$V_{CB}$](C)(D){$R_3$}
    %
    \resistor[intensitylabel=$i_2$,tensionlabel=$V_{HI}$](H)(I){$R_4$}
    \vdc[tensionlabel=$V_{ID}$](I)(D){$E_2$}
    %
    \resistor[intensitylabel=$i_3$,tensionlabel=$V_{HG}$](H)(G){$R_5$}
    \newSwitch[ison=true,tensionlabel=$V_{GF}$](G)(F){$S_2$}
    \wire(F)(E)
    \resistor[tensionlabel=$V_{DE}$,dipoleconvention=generator](E)(D){$R_6$}
    %
    \vdc[tensionlabel=$V_{FI}$,dipoleconvention=generator](I)(F){$E_3$}
    \newSwitch[intensitylabel=$i_4$,tensionlabel=$V_{BI}$,ison=false](B)(I){$S_1$}  
\end{pspicture}
\end{document}

enter image description here

5

Visualization of CaMKII/PP1 pathway in a spine of a neuron.

CaMKII/PP1 pathway - Cell signalling

Here is standalone document.

% lualatex --shell-escape 
\RequirePackage{luatex85}
\documentclass[crop,tikz]{standalone}
\usepackage{pgfplots}
\usetikzlibrary{calc,graphs,graphdrawing,fit,positioning}
\usetikzlibrary{decorations,decorations.footprints,decorations.shapes}
\usetikzlibrary{shapes,arrows,arrows.meta}
\usegdlibrary{layered}
\usepackage{xstring}
\pgfplotsset{compat=1.15}

\begin{document}

\pgfmathsetseed{10}


\newcommand{\tstar}[5]{% x, y, inner radius, outer radius, tips,
    \pgfmathsetmacro{\starangle}{360/#5}
    \draw[draw=none,fill=blue!40] [xshift=#1cm,yshift=#2cm](0:#3)
    \foreach \x in {1,...,#5}
    { -- (\starangle/2+\x*\starangle-\starangle/2:#4) -- (#4+\x*\starangle:#3)
    }
    -- cycle;
}

\newcommand{\TSTAR}[3]{% pos, radius, tips,
    \node[star,star points=#3,star point ratio=0.3,fill=blue!40,minimum
    size=#2cm,] (inner#3) at (#1) {};
}


\newcommand{\CAMKIIRING}[6] { % name, x, y, indices_of_red_balls, size, tips 
    % get the theta for given number of subunits.
    \begin{scope}[ ]
        \pgfmathsetmacro{\theta}{360/#6};
        \pgfmathsetmacro{\r}{0.5*#5/sin(\theta/2)};
        \def\fitlist{};
        \foreach \i in {1,...,#6}
        {
            \IfSubStr {#4} {\i}
            {
                \node[ball color=red,circle,shading=ball,minimum size=#5cm] (r\i) at
                ($(\i*\theta:\r cm)+(#2,#3)$) {};
            }
            {
                \node[draw=none,ball color=blue,circle,minimum size=#5cm](r\i) at
                ($(\i*\theta:\r cm)+(#2,#3)$) {}; 
            }
            \xdef\fitlist{\fitlist(r\i)};
        };
        % inner subunit.

        \tstar{#2}{#3}{\r/5}{\r}{#6};
        \node[circle,fit=\fitlist,] (#1) {};
        %\node[] at (#2,#3) {#1};
    \end{scope}
}

\newcommand{\CAMKII}[5] { % name, position, indices_of_red_balls, size, tips 
    % get the theta for given number of subunits.
    \node (#1) at (#2) {};
    \begin{scope}[ ]
        \pgfmathsetmacro{\theta}{360/#5};
        \pgfmathsetmacro{\r}{0.5*#4/sin(\theta/2)};
        \def\fitlist{};

        \node[draw=none] (#1_root) at (#1) {};

        \foreach \i in {1,...,#5}
        {
            \IfSubStr {#3} {\i}
            {
                \node[draw=none,inner sep=0,ball color=red,circle,minimum size=#4cm] (r\i) at
                ($(\i*\theta:\r cm)+(#1_root)$) {};
            }
            {
                \node[draw=none,ball color=blue,inner sep=0,circle,minimum size=#4cm](r\i) at
                ($(\i*\theta:\r cm)+(#1_root)$) {}; 
            }
            \xdef\fitlist{\fitlist(r\i)};
        };
        % inner subunit.
        \TSTAR{#1_root.center}{0.5*\r}{#5};
        \node[fit=\fitlist,circle,inner sep=0] (#1) {};
    \end{scope}
}

\newcommand{\CACAM}[3] { % name, (x, y), size 
    % A node is created with given name which fit all others.
    \node (#1) at (#2) { };
    \edef\name{#1_center}
    \begin{scope}[]
        \pgfmathsetmacro{\car}{#3/2}
        \node[star,star points=4,fill=red,minimum size=#3 cm,inner sep=0pt] 
            (\name) at (#1) {};

        \foreach \x in {1,...,4} 
        {
            \pgfmathsetmacro{\theta}{360/4*\x};
            \node[inner sep=0pt,ball color=yellow,circle,minimum size=\car cm] 
            (ca\x) at ($(#2)+(\theta:\car cm)$) {};
        }
        \node[circle,inner sep=0,fit=(ca1) (ca2) (ca3) (ca4) (\name)] (#1)  {};
    \end{scope}
}

\newcommand{\CAM}[3] { % name, (x, y), size 
    \node (#1) at (#2) { };
    \begin{scope}[]
        \pgfmathsetmacro{\car}{#3/2}
        \node[star,star points=4,star point ratio=2
            , fill=red,minimum size=#3 cm,inner sep=0pt] 
            (rcam) at (#1) {};
    \end{scope}
}

% NMDA receptors and other.
% \NMDAOLD}{(x,y)}{width}{gap}{rotation}
\newcommand{\NMDAOLD}[5] {
    \pgfmathsetmacro\rwidth{#3/5.0}
    \pgfmathsetmacro\gap{0.1+#4}

    \edef\ang{#5}
    \node[minimum height=#3 cm,minimum width=\gap cm] (#1) at #2 {};
    \begin{scope}[rotate around={(\ang:#2)}]
        \foreach \xshift/\name in {\gap/#1_right,-\gap/#1_left}
        {
            \node[draw=blue,fill=red!20,rectangle, inner sep=0pt
                , decorate, decoration={random steps,amplitude=1pt,segment length=1pt}
                , minimum height=#3cm ,minimum width=\rwidth cm
            ] (\name) at ([xshift=\xshift cm]#1.east) {};
        }
    \end{scope}
}

% \AMPA{name}{(x0,y0)}{height}{gap or opening size}{rotation}
\newcommand{\AMPA}[5] {
    \pgfmathsetmacro{\rwidth}{#3/5.0}
    \pgfmathsetmacro\rwidth{#3/5.0}
    \pgfmathsetmacro\gap{0.1+#4}
    \edef\ang{#5}

    \node (#1) at #2 {};
    \begin{scope}[rotate around={(\ang:#2)}]
        \foreach \i in {\gap,0}
        {
            \node[minimum height=#3 cm,minimum width=\gap cm
                ,transform shape   % necessary when within scope
                ,cylinder,fill=red
            ] (#1_\i) at ([yshift=\i cm]#1) {};
        }
    \end{scope}
}

% \CA{label}{coordinate}{label}
\newcommand{\CA}[3] {
    \node (#1) at #2 {};
    \node[shading=ball,circle,ball color=yellow,inner sep=0,minimum size=2 mm]
        at (#1) { };
}


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Chemical equilibrium arrow 

\newdimen\arrowsize
\newdimen\mylw
\pgfkeys{/my arrows/chemeq/.style={draw,thick,double distance=3pt,onearc-onearc}}
\pgfkeys{/my arrows/size/.code={\pgfsetarrowoptions{onearc}{#1}}}
\def\myalw{1pt}
\pgfarrowsdeclare{onearc}{onearc}{%
  \mylw=\myalw
  \pgfarrowsleftextend{-\pgfgetarrowoptions{onearc}-.5\mylw}
  \pgfarrowsrightextend{1pt}
}{%
  \pgfsetdash{}{0pt}
  \mylw=\pgflinewidth
  \pgfsetlinewidth{\myalw}
  \advance\arrowsize by.5\pgflinewidth
  \pgfpathmoveto{\pgfpoint{-\pgfgetarrowoptions{onearc}}{-\pgfgetarrowoptions{onearc}-.5\mylw}}%
  \pgfpatharc{180}{90}{\pgfgetarrowoptions{onearc}}
  \pgfusepathqstroke
}


%  \PHOSPHO{name}{location}
\newcommand\PHOSPHO[2]
{
    \node[circle,fill=yellow,inner sep=0pt] (#1) at (#2) {\tiny P};
}



\begin{tikzpicture}[scale=1, every node/.style={},% node distance=5mm
    ]

    % Grid 
    %\node (origin) at (0,0) {+};
    \draw[thin,step=1,gray!10] (-10,-10) grid (5,5);

    % Draw synapse.
    \draw[color=blue,very thick] plot[smooth] coordinates { 
            (-8,-8) (-5,-8.2) (-3, -8)
            (-3, -4) (-7, -2) (-7,1) 
            (0, 1) (3,1) (2.5,-3) 
            (-1,-4) (-1,-8) (3,-8)
        };
    \node[ ] at (-5,-10) {Dendrite};


    % \draw[blue,very thick] plot[smooth] coordinates { 
    %         (-8, -15) (-5, -15.5) (0,-15.1) (3, -15)
    %     };

    % draw PSD.
    \path[fill=blue!50,decorate,decoration={random steps}]
        (-6,1.2) -- (-5,1.2) -- (-4,1.2) -- (0,1.1) -- (3,1.2) 
        --  (1,0) -- (0,0) -- (-3,0) -- (-5,0) -- cycle;

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % A lot of calcium outside  and calmodulin inside.
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \foreach \i/\x/\y in {1/-7/2,2/-6.5/2.1,3/-6.2/1.9,4/-6.8/2.2}
    {
        \CA{ca\i}{(\x,\y)}{};
    }



    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % Draw channels.
    % VDCC or voltage dependant calcium channel opens when membrane potential at
    % spine goes above threshold voltage of channel.
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    \coordinate (vdcc) at (-6,1);
    \node[draw=blue,rotate=110,cylinder,fill=white,label=VDCC,minimum height=7 mm] 
        at (vdcc) {};

    \NMDAOLD{n0}{(-5,1)}{1}{0.05}{-10};
    \node[above=of n0] {NMDA};

    \CA{canmda}{(n0.east)}{};

    \NMDAOLD{n1}{(1,1)}{1}{0.1}{10};

    % Attach a CaMKII below it.
\CAMKII{camkiiPSD}{[shift=(-135:5 mm)]n1}{1,2,3,4,5,6}{0.2}{6};

    \node[left=of n1,yshift=-5 mm,label=PP1,circle,fill=red] (pp1) {};
    \draw[-triangle 90 reversed] (pp1) edge[out=-0,in=180] (camkiiPSD);

    % CaMKII partial.
    \node[left=of camkiiPSD,shift=(60:-2cm)] (camkii) {};
    \CAMKII{camkiiPartial}{[xshift=0 cm]camkii}{1,2,5}{0.2}{6}

    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % Calcium inflow  
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    % Calcium can flow through VDCC
    \CA{ca0}{(vdcc)}{};
    \CACAM{cacam0}{-5,0}{0.3}
    \CAM{cam0}{-6.5,0}{0.3}

    \draw[-*,very thick] (cam0) to[midway] node (binding) {} (cacam0);
    \draw[->] (ca0) to[] (binding);

    \foreach \i in {1,2,...,5}
    {
        \coordinate (cacam) at (rnd*3-6,rnd-1)  {};
        %\CACAM{cacam\i}{cacam}{0.3}
    }


    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
    % Channels 
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    \node[below right=of cacam0] (can) {CaN};
    \node[below=of can] (i1p) {I1P/I2P};
    \node[above right=of i1p,xshift=5 mm] (ppx) {PP1/PP2};
    \node[left=of i1p,rotate=-90] (pka) {PKA};

     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
     % Transportation of AMPA.
     %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

    \draw[->,decorate,decoration={shape backgrounds,shape=dart,shape size=2 mm}] 
        (camkiiPartial) -- (camkiiPSD);

    %\draw[-*] (ca0) edge[ ]  (cacam0);

    \draw[-*] (cacam0) edge[ ] (can);
    \draw[-triangle 90 reversed] (can) edge[ ] (i1p);
    \draw[-triangle 90 reversed] (i1p) edge[ ] (ppx);
    \draw[-triangle 90 reversed] (pka) edge[ ] (i1p);

    % Phosphorylation
    \draw[-*] (cacam0) edge[ ] node[midway] (phospho) {} (camkiiPartial);
    \draw[-latex] (camkiiPartial.north) edge[out=90,in=120] (phospho);
    \draw[-triangle 90 reversed] (ppx) edge[] (camkiiPartial);
    \draw[-triangle 90 reversed] (cacam0) edge[bend right] (pka.west);

    %% Transportation of AMPA channels.
    \AMPA{a0}{(2.8,-2)}{1}{0.1}{10};
    \CAMKII{camkiiCyt1}{[shift=(135:2 cm)]a0}{1,2,3,4,5,6,7}{0.2}{7}
    \draw[-triangle 90 reversed] (ppx) edge[] (camkiiCyt1);

    % CaMKII help translocating AMPA channels via Ras/MaP-K. 
    \AMPA{a1}{(-2,0.8)}{1}{0.15}{90};

    % CaMKII phosphorylated AMPA thus increasing their conductance.
    \CAMKII{camkiiCyt2}{[shift=(-25:0.7 cm)]n0}{1,2,3,4,5,6,7}{0.2}{7}

    \node at ([yshift=10 mm]a1) {AMPA};
    \AMPA{a2}{(2.8,1)}{1}{0.1}{45};
    \draw[-*] (camkiiCyt2) edge[bend right] (a1);

    \draw[->,very thick
            ,decorate, decoration={footprints,foot length=10 pt,stride length=15pt}
            ] ($(a0)+(0.5,.5)$)  to[bend right] node[below,sloped,midway,yshift=-5 mm] (transport) 
            {\small MAPK} ([xshift=3mm]a2);

    \draw[-*] (camkiiCyt1) -- (transport);


\end{tikzpicture}    
\end{document}
5
  • I just found out about this question today (January 2019) because it was listed in the weekly SE newsletter.
  • There are very impressive diagrams and drawings that there are to marvel at.
  • I add some (in comparison very simple) diagrams and drawings of my own.
  • They are all taken from my Ph.D. thesis and are made by tikz or pgfplots (one is an annotated CAD drawing which was generated with an third-party software).

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

2
  • Thanks for your interesting contributions. To maintain the educational aspect of this post, it would be interesting if you could make the source codes of the images available.
    – Thomas
    Jan 18, 2019 at 9:06
  • @Thomas I linked the document template. It will need some time for me to provide the code, since it is distributed throughout my thesis in different files for style, data and so on (which was finished some years ago). Yes, I understand your request. I plan to do it, but not very shortly. Jan 18, 2019 at 13:07
4

This is an illustration of the complex solutions of $z^{n}=1$ from a book I'm writing... not sure if I should add the angles themselves, but I'm happy with how it looks so far:

Figure

Code for generating the solutions as a function of n (needs to be inside an axis environment in tikz, and the axis settings are pretty standard so I won't repeat them here):

\newcommand{\cmplxsol}[1]{
    \coordinate (O) at (0,0);
    \draw[black!20] (1,0) arc (0:360:1);
    \pgfmathsetmacro{\dt}{360/#1}
    \pgfmathsetmacro{\n}{int(#1-1)}
    \pgfplotsinvokeforeach{\n,...,0}{
        \pgfmathparse{##1+1}
        \draw[xcol##1, fill=xcol##1!20] (O) -- ({0.1*##1},0) arc (0:{\dt*##1}:{0.1*##1}) -- cycle;
        \draw[very thick, xcol##1] (O) -- ({cos(\dt*##1)},{sin(\dt*##1)}) node[complex]{};
        \node[xcol##1, fill=xcol##1!10, rounded corners]  at ({1.23*cos(\dt*##1)},{1.23*sin(\dt*##1)}) {$z_{\the\numexpr##1+1\relax}$};
    }
}

The colors:

\definecolor{xcol0}{HTML}{BD4242} % red
\definecolor{xcol1}{HTML}{4268BD} % blue
\definecolor{xcol2}{HTML}{52B256} % green
\definecolor{xcol3}{HTML}{7F52B2} % purple
\definecolor{xcol4}{HTML}{FF9F31} % orange
\definecolor{xcol5}{HTML}{777777} % gray
\definecolor{xcol6}{HTML}{80F5DC} % cyan
3

A reaction that is in almost every book on organic chemistry.

Made with chemfig and Chemmacros.

\documentclass[margin={2mm 3mm}]{standalone}
\usepackage[utf8]{inputenc}
\usepackage{chemfig}
\usepackage[version=4]{mhchem}
\usepackage{chemmacros}

\usechemmodule{orbital}
\setchemfig{atom sep=1.8em,  cram width = 2pt, cram dash width = 0.2pt, cram dash sep = 0.4pt, bond offset = 1pt}
\usetikzlibrary{arrows}

\usetikzlibrary{calc,arrows.meta}% per right to e left to
\tikzset{myedge/.style={->, -{Latex[#1]}}}

\chemsetup[orbital]{
    overlay,
    opacity=.6,
    p/color = blue!75,
    p/scale=3,
    %   p/half,
    s/scale=1.5
}

\begin{document}    
%
\schemestart
%
\chemfig{C(-[6,.2,,,,draw=none]{}{\orbital[half,angle=270,color=blue]{p}})(-[2,.2,,,,draw=none]{}{\orbital[half,color=red!75]{p}})(-[2,1.5,,,,draw=none]\bullet-[0,1.3,,,,dash pattern = on 1pt off 1pt])(-[6,1.5,,,,draw=none]-[0,1.3,,,,dash pattern = on 1pt off 1pt])(<:[:160,2]R)(<[:200,2]R)-[0,1.5]C(-[6,.2,,,,draw=none]{}{\orbital[half,angle=270,color=blue]{p}})(-[2,.2,,,,draw=none]{}{\orbital[half,color=red!75]{p}})(-[2,1.5,,,,draw=none]\bullet)(<:[:20,2]R)(<[:340,2]R)}
%
\chemfig{@{z}}
%
\arrow{0}[-90,.85]{alkene}
%
\arrow(@{z}--){->[\chemfig{HBr}]}[0,1.5]
%
\chemleft[
\subscheme{
%
\chemfig{C(-[:30,.5,,,,draw=none]\scriptscriptstyle{\delta^+})(-[6,.2,,,,draw=none]{}{\orbital[half,angle=270,color=blue]{p}})(-[2,.2,,,,draw=none]{}{\orbital[half,color=red!75]{p}})(<:[:160,2]R)(<[:200,2]R)-[@{y2}0,1.5]@{a}C(-[:60,0.25,,,,draw=none]{\orbital[half,angle=60,scale=3,color=red!75]{p}})(-[:240,.2,,,,draw=none]{\orbital[half,angle=240,scale=1]{p}})(<:[:330,2]R)(<[:300,2]R-[6,1,,,,draw=none])(-[:64,1.8,,,,draw=none]\bullet)(-[:56,1.8,,,,draw=none]\bullet)(=[:60,2,,,,draw=none]-[:60,1.6,,,,dash pattern = on 1pt off 1pt])}
%
\chemfig{@{x}}
%
\arrow(@{a}--){0}[50,1.5]\hspace{-16pt}\chemfig{{\orbital[color=red!75]{s}}(H-[:90,.8,,,,draw=none]{\scriptscriptstyle\delta^+})-[0,1.5,,,,dash pattern = on 1pt off 1pt,shorten <=10pt,shorten >=10pt]{\orbital{s}}(Br-[:80,.8,,,,draw=none]{\scriptscriptstyle\delta^{-}})}
%
}
\chemright{]^{\ddagger}}
%
\arrow{->}
%
\chemfig{C(-[:30,.4,,,,draw=none]\scriptscriptstyle+)(-[6,.2,,,,draw=none]{}{\orbital[half,angle=270,color=blue]{p}})(-[2,.2,,,,draw=none]{}{\orbital[half,color=red!75]{p}})(<:[:160,2]R)(<[:200,2]R)-[@{y}0,1.5]C(-[:60,1.5]H)(<:[:330,2]R)(<[:300,2]R)}
%
%--------------------------------------------------
\arrow(@{y2}--){0}[270,1]{transition state}
\arrow(@{y}--){0}[270,1.4]\parbox{2cm}{carbocation}
%
\schemestop

\end{document}

enter image description here

2

PSTricks can prevent us from being fooled by magicians.

enter image description here

The following code must be compiled with LuaLaTeX.

\RequirePackage{pdfmanagement-testphase}
\DeclareDocumentMetadata{}
\documentclass[beamer,preview,pstricks,border=12pt]{standalone}

\def\A{\pspolygon[fillcolor=green](0,0)(8,0)(8,3)}
\def\B{\pspolygon[fillcolor=red](0,0)(5,0)(5,2)}
\def\C{\pspolygon[fillcolor=blue](0,0)(2,0)(2,1)(5,1)(5,2)(0,2)}
\def\D{\pspolygon[fillcolor=yellow](0,0)(5,0)(5,2)(2,2)(2,1)(0,1)}
\def\E{\pspolygon[fillstyle=none,dimen=m,linestyle=solid,linewidth=0.8pt,linejoin=1](0,0)(13,0)(13,5)}


\begin{document}
\begin{standaloneframe}
\begin{pspicture}[showgrid,fillstyle=solid,opacity=0.5,linestyle=none,linewidth=0](13,5)\pause
    \B\pause
    \rput(5,2){\A}\pause
    \rput(5,0){\C}\pause
    \rput(8,0){\D}\pause
    \E
\end{pspicture}
\end{standaloneframe}
\begin{standaloneframe}
\begin{pspicture}[showgrid,fillstyle=solid,opacity=0.5,linestyle=none,linewidth=0](13,5)\pause
    \A\pause
    \rput(8,3){\B}\pause
    \rput(8,1){\C}\pause
    \rput(8,0){\D}\pause
    \E
\end{pspicture}
\end{standaloneframe}
\end{document}
1 2
3

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.