将文本环绕在页面顶部的图像周围

将文本环绕在页面顶部的图像周围

对于我的大学报告,我必须在乳胶中创建它。 在此处输入图片描述

我在 latex 上尝试使用 wragfig 和这段代码

\documentclass[10pt,a4paper]{report}
\usepackage[a4paper,vmargin={25mm,25mm},hmargin={25mm,20mm}]{geometry}\usepackage{graphicx,xcolor,wrapfig,tikz,lipsum}
\usetikzlibrary{calc}
\begin{document}
%border
 \begin{tikzpicture}[overlay,remember picture]
    \draw [line width=2pt,rounded corners=2pt,]
        ($ (current page.north west) + (15mm,-9mm) $)
        rectangle
        ($ (current page.south east) + (-9mm,9mm) $);
 \end{tikzpicture}
 %borderend
\begin{wrapfigure}{l}{0.2\textwidth}
 %\centering
 \includegraphics[width=0.8\linewidth]{logo.png}
 % logo.png: 1068x1024 px, 72dpi, 37.68x36.12 cm, bb=0 0 1068 1024
\end{wrapfigure}
\centering
  {\Large \color{blue!50!gray} SARDAR VALLABHBHAI NATIONAL INSTITUTE OF TECHNOLOGY\\ [3mm] SURAT-395007, GUJRAT, INDIA\\[3.5mm] \bfseries DEPARTMENT OF ELECTRICAL ENGINEERING}\\

\begin{tikzpicture}
  \draw[blue!50!gray, ultra thick] (0,0) -- (16,0);
 \end{tikzpicture}
 \vspace{5mm}
 \par
\section*{\Huge \bfseries CERTIFICATE}


\lipsum
\end{document}

这是我得到的

在此处输入图片描述

我再次在互联网上搜索,有人建议使用 tikz 包。所以这就是我所做的

\documentclass[10pt,a4paper]{report}
\usepackage[a4paper,vmargin={25mm,25mm},hmargin={25mm,20mm}]{geometry}\usepackage{graphicx,xcolor,wrapfig,tikz,lipsum}
\usetikzlibrary{calc}
\begin{document}
%border
 \begin{tikzpicture}[overlay,remember picture]
    \draw [line width=2pt,rounded corners=2pt,]
        ($ (current page.north west) + (15mm,-9mm) $)
        rectangle
        ($ (current page.south east) + (-9mm,9mm) $);
 \end{tikzpicture}
 %borderend
\begin{wrapfigure}{l}{2.5cm}
     \begin{tikzpicture}[overlay,remember picture]
    \node[anchor=north west,inner sep=0,outer sep=0] at ($(current page.north west)+(20mm,-34mm)$) {\includegraphics[width=2cm]{logo.png}};
     \end{tikzpicture}
     % logo.png: 1068x1024 px, 72dpi, 37.68x36.12 cm, bb=0 0 1068 1024
    \end{wrapfigure}

\centering
      {\Large \color{blue!50!gray} SARDAR VALLABHBHAI NATIONAL INSTITUTE OF TECHNOLOGY}\\
      [3mm]
      {\Large \color{blue!50!gray} SURAT-395007, GUJRAT, INDIA}\\
      [3.5mm]
      {\Large \color{blue!50!gray}\bfseries DEPARTMENT OF ELECTRICAL ENGINEERING}\\

\begin{tikzpicture}
  \draw[blue!50!gray, ultra thick] (0,0) -- (16,0);
 \end{tikzpicture}
 \vspace{5mm}
 \par
\section*{\Huge \bfseries CERTIFICATE}


\lipsum
\end{document}

但输出仍然不是我想要的 在此处输入图片描述

有人可以帮我一下。

答案1

这假设证书不适合文档其余部分的文本区域。\certificate保存框主要是为了避免将页面源直接放入 tikzpicture 中。

\documentclass[10pt,a4paper]{report}
%\usepackage[a4paper,vmargin={25mm,25mm},hmargin={25mm,20mm},showframe]{geometry}
\usepackage{adjustbox,graphicx,xcolor,tikz,lipsum}
\usetikzlibrary{calc}

\newsavebox{\certificate}
\begin{document}
\thispagestyle{empty}
%create certivicate
\savebox{\certificate}{\begin{minipage}[c][\dimexpr \paperheight-50mm][t]{\dimexpr \paperwidth-45mm}% entire page
  \sbox0{\includegraphics[width=2cm]{example-image}}% logo.png
  \sbox1{\rotatebox[origin=br]{-90}{\resizebox{\ht0}{!}{\textcolor{blue}{\textsf{SVINT}}}}}% fit to logo
  \usebox0\begin{minipage}[b][\ht0][s]{\dimexpr \textwidth-\wd0-\wd1}
    \centering
      {\large \color{blue!50!gray} SARDAR VALLABHBHAI NATIONAL INSTITUTE OF TECHNOLOGY}\par\vfill
      {\large \color{blue!50!gray} SURAT-395007, GUJRAT, INDIA}\par\vfill
      {\large \color{blue!50!gray}\bfseries DEPARTMENT OF ELECTRICAL ENGINEERING}
  \end{minipage}\usebox1\par
  \parindent=\bibindent
  \bigskip
  \centerline{\Huge \bfseries CERTIFICATE}
  \medskip
  \lipsum
\end{minipage}}%
%position with border
 \begin{tikzpicture}[overlay,remember picture]
    \draw [line width=2pt,rounded corners=2pt]
        ($ (current page.north west) + (15mm,-9mm) $)
        rectangle
        ($ (current page.south east) + (-9mm,9mm) $);
    \node[below right, inner sep=0pt] at ($(current page.north west) +(25mm,-25mm)$) {\usebox\certificate};
 \end{tikzpicture}
\newpage

\end{document}

相关内容