我在文件\lfoot
标题(我正在使用\usepackage{fancyhdr}
)中添加了我的姓名,我想叠加我的签名图片以获得屏幕截图的效果
我实际上可以在正常文本框架内的居中位置进行此操作:
\begin{center}
\begin{tikzpicture}
\draw (0,0) node[midway,yshift=1.2cm](c){\includegraphics[width=3cm]{JohnBrownSignature}};
\node[yshift=10mm] at (c.south) {\Large \textit{John Brown}};
\end{tikzpicture}
\end{center}
但我无法找到标题。我尝试了\lfoot{\includegraphics
、\lfoot{\begin{picture}
或\lfoot{\begin{tikzpicture}
。
MWE 如下:
\documentclass[a4paper,12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{tikz}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0.3pt}
\rfoot{Page~\thepage~of~\pageref{LastPage}}
\lfoot{John Brown}
% WRONG:
%\lfoot{John Brown{\begin{tikzpicture}\draw(0,0){\includegraphics[width=3cm]{JohnBrownSignature}}\end{tikzpicture}}
\cfoot{\today}
标题有什么不同?它们被视为“特殊”区域吗?
答案1
不使用 TikZ 等:
\documentclass[a4paper,12pt]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[english]{babel}
\usepackage{graphicx}
\usepackage{blindtext}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\renewcommand{\headrulewidth}{0pt}
\renewcommand{\footrulewidth}{0.3pt}
\rfoot{Page~\thepage~of~\pageref{LastPage}}
\def\signWimage{%
\setbox0\hbox{John Brown}%
\hskip0.5\wd0%
\parbox[c][0pt][c]{0pt}{%
\makebox[0pt]{\includegraphics[width=1.1\wd0,height=2.2\ht0]{example-image-a}}}%
\parbox[c][0pt][c]{0pt}{\makebox[0pt]{\unhbox0}}}
\lfoot{\signWimage}
\cfoot{\today}
\begin{document}
\blinddocument
\label{LastPage}
\end{document}