Page 1 of 1

Ce code LaTeX crée des images encerclées des participants pour un poster d'un séminaire ou une présentation.


\documentclass{standalone}
\standaloneconfig{margin=2mm}
\usepackage{tikz}
\usepackage{graphicx}
\usepackage{ragged2e}

\usepackage{caption}

% Define the radius of the outer circle
\def\outerRadius{2.2cm}
% Define the radius of the inner circle
\def\innerRadius{2cm}

% Get the natural width of the image
\newlength{\imgwidth}

\newcommand\pic[2]{
    \begin{tikzpicture}
      \begin{scope}
        \draw[yellow] (0,0) circle (\outerRadius);
        \draw[yellow] (0,0) circle (\innerRadius);

        \fill[yellow] (0,0) circle (\outerRadius) -- (0,0) circle (\innerRadius);

        % Clip the image to the shape of the inner circle
        \clip (0,0) circle (\innerRadius);

        % Calculate the correct width to fit the image perfectly inside the inner circle
        \settowidth{\imgwidth}{\includegraphics{#1}}
        \pgfmathsetmacro{\scalefactor}{\innerRadius / (0.5 * \imgwidth)}

        % Include the image inside the inner circle with the calculated width
        \node at (0,0) {\includegraphics[scale=\scalefactor]{#1}};
      \end{scope}
      \node[blue,below, font=\Large\bfseries, align=center, inner sep=2pt, minimum width=2cm, minimum height=2cm, text width=3.5cm, text badly centered] at (0,-\outerRadius) {\Centering #2};
    \end{tikzpicture}
}


\begin{document}

\pic{outputimage.jpg}{Dr. Ethan Thompson}
\pic{female.png}{PhD. Sophia Rodriguez}
\pic{13mlw3.jpg}{Mia Anderson}
\pic{ef153.jpg}{Dr Mohamed Ali Soltan}

\end{document}


Leave a comment if you like this content أترك تعليقا إن أعجبك المحتوى

Class: Figures
Views:  135




0 Comments, Latest

No comments yet. Be the first to Comment

Most viewed courses: