0

I use multicol in order to describe a picture by adding text on the left/right. But when I use multicol, the text and the picture are not well centered, how can I solve this ?

My code :

\documentclass[12pt, french]{article} % Type d'écrit
\usepackage{lmodern}
\usepackage{geometry} % Début package
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{amsmath,amsthm,amsfonts,amssymb,amscd}
\usepackage{graphicx}
\usepackage{multicol}
\usepackage{caption}

\begin{document}
    Le cas de fonction reciproques : 
     \begin{multicols}{2}
       La fonction reciproque de s, notee arcsin, est la fonction qui prend un nombre $x$ dans [-1, 1] et renvoie l'angle $\alpha$ tel que : $sin(\alpha)=x$

\columnbreak

\begin{center}
    \includegraphics{Image/sin.png}
    \captionof{figure}{$sin : x \hookrightarrow sin(x)$}
\end{center}    

\end{multicols}

\end{document}

And here is the result : enter image description here

2
  • I'd use two minipage environments instead of multicols.
    – leandriis
    Commented Nov 8, 2019 at 19:26
  • Also, I get a different alignment: i.sstatic.net/Pcpm4.png. The only change I made in comparison to your original MWE: I have added the demo option to the graphicx package.
    – leandriis
    Commented Nov 8, 2019 at 19:28

1 Answer 1

1

Here are some different alignments using teo minipage environments instead of multicols:

\documentclass[12pt, french]{article} % Type d'écrit
\usepackage{lmodern}
\usepackage{geometry} % Début package
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{babel}
\usepackage{amsmath,amsthm,amsfonts,amssymb,amscd}
\usepackage[demo]{graphicx}  % remove demo option in actual document.
\usepackage{multicol}
\usepackage{caption}

\usepackage[export]{adjustbox} % adds the valign option

\begin{document}
    Le cas de fonction reciproques : 

    \noindent
     \begin{minipage}{0.5\textwidth}
       La fonction reciproque de s, notee arcsin, est la fonction qui prend un nombre $x$ dans [-1, 1] et renvoie l'angle $\alpha$ tel que : $sin(\alpha)=x$
\end{minipage}%
\begin{minipage}{0.5\textwidth}
\centering
    \includegraphics{Image/.png}
    \captionof{figure}{$sin : x \hookrightarrow sin(x)$}
\end{minipage}


    Le cas de fonction reciproques : 

    \noindent
     \begin{minipage}[t]{0.5\textwidth}
       La fonction reciproque de s, notee arcsin, est la fonction qui prend un nombre $x$ dans [-1, 1] et renvoie l'angle $\alpha$ tel que : $sin(\alpha)=x$
\end{minipage}%
\begin{minipage}[t]{0.5\textwidth}
\centering
    \includegraphics[valign=t]{Image/.png}
    \captionof{figure}{$sin : x \hookrightarrow sin(x)$}
\end{minipage}




\end{document}
2
  • It works perfectly, thanks :)
    – Juju
    Commented Nov 8, 2019 at 19:37
  • @Juju In that case please consider accepting the answer by clicking on the check mark on its left.
    – user194703
    Commented Nov 8, 2019 at 19:40

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .