在矩形框中将文字环绕在图像周围

在矩形框中将文字环绕在图像周围

以下是我的代码,我试图将图像放在我的矩形框内,但相反,它向下移动了一点(参见附图),我试图使用包裹图包来执行此操作。我想将图像对齐到右上角的矩形框中。

\documentclass[10pt,letterpaper]{article}
    \usepackage{geometry}
    \geometry{
        a4paper,
        total={21cm,29.7cm},
        left=10mm,top=10mm,right=10mm,bottom=15mm}
    \usepackage[english]{babel}
    \usepackage[utf8]{inputenc}

    \usepackage{fancyhdr}
    \pagestyle{fancy}
    \fancyhf{}
    \cfoot{MS-CV $|$ \thepage}
    \renewcommand{\headrulewidth}{0mm}


    %\usepackage{palatino}
    \usepackage{tgschola}



    \usepackage{xcolor}   
    \usepackage{framed}
    \definecolor{shadecolor}{RGB}{228, 228, 228}


    \usepackage{amsmath}
    %\usepackage{amsfonts}
    \usepackage{amssymb}
    \usepackage{graphicx}
    \usepackage{marvosym}
    \usepackage{lipsum}
    \usepackage{microtype}
    \usepackage{siunitx}
    \usepackage{ifsym}
    \usepackage[colorlinks=false, pdfborder={0 0 0}]{hyperref}
    \usepackage{multicol}


    \usepackage{plain}
    \usepackage{csquotes}
    \usepackage{enumitem}
    \usepackage{array}
    \renewcommand{\labelenumi}{[\arabic{enumi}]}
    \usepackage{afterpage}
    \usepackage{setspace}
    \usepackage{titlesec}
    \titlespacing{\section}{0mm}{1.2mm}{1.2mm}
    %\titleformat{\section}{\bfseries}{\thesection}{1em}{\setstretch{0.01}}

    %%%%%%%%%%_____________Color Text Box Packages______________%%%%%%%%%%%
    \usepackage{blindtext}
    \usepackage{tcolorbox}
    \usepackage{graphicx}
    \definecolor{myred}{RGB}{139,0,0}
    \definecolor{myblue}{RGB}{0,128,155}





    %%%%%%%   For inserting Images, Just Keep The image files in the folder named 'images'  %%%%%%%%%%%%%%%
    \usepackage{graphicx}
    \graphicspath{ {images/} }

    \usepackage{graphicx,wrapfig,lipsum}

    %%%%%%%%%%_____________Color for Text ______________%%%%%%%%%%%

    \usepackage{color}


    %%%%%%%%%%_____________Start of main document______________%%%%%%%%%%%
    \begin{document}

    \begin{tcolorbox}[width=\textwidth,colframe=myred,outer arc=0mm] 
        \begin{wrapfigure}{r}{26mm}
            \includegraphics[width=1.15in, height=1.40in]{Shuvo_PP.jpg}
        \end{wrapfigure}
    {\Huge \textbf{Md Moinuddin Shuvo}}\vspace{2.5mm}\\
    \textifsymbol{18} House\#1090, Ibrahimpur, Dhaka - 1206,Bangladesh\\
    \Email\href{mailto:[email protected]}{[email protected]} \\
    \ComputerMouse\hspace{0.5mm}\href{https://sites.google.com/view/moinuddinshuvo/}{https://sites.google.com/view/moinuddinshuvo}\\
    \Mobilefone\hspace{0.5mm}+0000000, \Mobilefone\hspace{0.5mm}+00000000\\


    \end{tcolorbox} 

    \end{document}

在此处输入图片描述

答案1

您可以使用plain TeX宏包insbox及其\InsertBoxR{no of untouched lines before insertion in the next paragraph}{object inserted}

\documentclass[10pt,letterpaper]{article}
\usepackage{geometry}
\geometry{
    a4paper,
    total={21cm,29.7cm},
    left=10mm,top=10mm,right=10mm,bottom=15mm}
\usepackage[english]{babel}
\usepackage[utf8]{inputenc}

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\cfoot{MS-CV $|$ \thepage}
\renewcommand{\headrulewidth}{0mm}

%\usepackage{palatino}
\usepackage{tgschola}

\usepackage{xcolor}
\usepackage{framed}
\definecolor{shadecolor}{RGB}{228, 228, 228}

\usepackage{amsmath}
%\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{marvosym}
\usepackage{lipsum}
\usepackage{microtype}
\usepackage{siunitx}
\usepackage{ifsym}
\usepackage[colorlinks=false, pdfborder={0 0 0}]{hyperref}
\usepackage{multicol}

\usepackage{plain}
\usepackage{csquotes}
\usepackage{enumitem}
\usepackage{array}
\renewcommand{\labelenumi}{[\arabic{enumi}]}
\usepackage{afterpage}
\usepackage{setspace}
\usepackage{titlesec}
\titlespacing{\section}{0mm}{1.2mm}{1.2mm}
%\titleformat{\section}{\bfseries}{\thesection}{1em}{\setstretch{0.01}}

%%%%%%%%%%_____________Color Text Box Packages______________%%%%%%%%%%%
\usepackage{blindtext}
\usepackage{tcolorbox}
\definecolor{myred}{RGB}{139,0,0}
\definecolor{myblue}{RGB}{0,128,155}

%%%%%%% For inserting Images, Just Keep The image files in the folder named 'images' %%%%%%%%%%%%%%%
\usepackage{graphicx}
%\graphicspath{ {images/} }

\usepackage{wrapfig,lipsum}

%%%%%%%%%%_____________Color for Text ______________%%%%%%%%%%%
\usepackage{xcolor}

\input{insbox}

%%%%%%%%%%_____________Start of main document______________%%%%%%%%%%%
\begin{document}

\begin{tcolorbox}[width=\textwidth,colframe=myred,outer arc=0mm]
   \leavevmode \InsertBoxR{-1}{\includegraphics[width=1.15in, height=1.25in, keepaspectratio]{euclid}}
{\Huge \textbf{Md Moinuddin Shuvo}}\vspace{2.5mm}\\
\textifsymbol{18} House\#1090, Ibrahimpur, Dhaka - 1206,Bangladesh\\
\Email\href{mailto:[email protected]}{[email protected]} \\
\ComputerMouse\hspace{0.5mm}\href{https://sites.google.com/view/moinuddinshuvo/}{https://sites.google.com/view/moinuddinshuvo}\\
\Mobilefone\hspace{0.5mm}+0000000, \Mobilefone\hspace{0.5mm}+00000000\\[-1ex]
\end{tcolorbox}

\end{document} 

在此处输入图片描述

答案2

\begin{wrapfigure}我没有使用代码来\begin{minipage}解决问题。这是修复后的代码

\begin{document}

\begin{tcolorbox}[width=\textwidth,colframe=myred,outer arc=0mm] 
\begin{minipage}{100mm}% adapt widths of minipages to your needs
    {\Huge \textbf{Md Moinuddin Shuvo}}\\
    \textifsymbol{18} House\#1090, Ibrahimpur, Dhaka - 1206,Bangladesh \hspace{50mm}\\
    \Email\href{mailto:[email protected]}{[email protected]} \\
    \ComputerMouse\hspace{0.5mm}\href{https://sites.google.com/view/moinuddinshuvo/}{https://sites.google.com/view/moinuddinshuvo}\\
    \Mobilefone\hspace{0.5mm}+0000000, \Mobilefone\hspace{0.5mm}+00000\\

\end{minipage}%
\hfill%
\begin{minipage}{26mm}%\raggedleft
\includegraphics[width=1.15in, height=1.40in]{Shuvo_PP.jpg}

\end{minipage}


\end{tcolorbox} 

\end{document}

相关内容