将图像置于规则之上

将图像置于规则之上

我正在使用这个模板:https://de.overleaf.com/latex/templates/deedy-cv/bjryvfsjdyxz 我正在尝试在右上角插入一张图片。我修改了 cls 文件中规则的使用,并设法用此代码阻止了图片左侧的线条

\noindent\hspace{-0.48\textwidth}\makebox[\linewidth]{\color{headings}
\rule{\paperwidth}{0.4pt}}
\begin{textblock}{25}(170,20) 
\centering
\fboxsep2.5pt\fcolorbox{headings}{white}%
{\includegraphics[width=3cm,keepaspectratio]{person-png-icon-29.png}}
\end{textblock}

我基本上将规则移到了左边,现在想在右边画第二条线,但无法实现。有没有办法将图像放在规则的顶部,这样它就不会穿过图像?或者画两条单独的线,就像我尝试做的那样。

现在的结果看起来是这样的。我只想让这条线继续在右侧。

在此处输入图片描述

答案1

根据您想要的最终结果,有一种方法可以做到:在绘图之后绘制规则。

在继续使用 Overleaf 之前,我建议先了解并练习一些 Latex 基础知识。有很多不错的书,或者可以看看这里:https://en.wikibooks.org/wiki/LaTeX

页面顶部

\documentclass[10pt]{article}
\usepackage{graphicx}% <<< missing
\usepackage{fancyhdr}% <<< from Overleaf
 
\pagestyle{fancy}% <<< this statement sets the upper rule
%\fancyhf{}% <<< from Overleaf


\begin{document}
    {\hfill% <<< trick to center the image
    \fbox{\includegraphics[width=3cm,keepaspectratio]{person-png-icon-29}}
    \hfill% <<< trick to center the image
    }
    \hrule% <<< the rule you want?
\end{document}

相关内容