如何在 LaTeX 中将页码放在书中的徽标内。也就是说,在书中的页脚处,我想添加一个徽标,并在徽标内添加页码。我该怎么做?
\documentclass[12pt]{book}
\usepackage{fancyhdr}
\begin{document}
%\includegraphics[scale=.25]{logo.png} this line throws an error ---> just to include a simple image for demo
\chapter{A Sample Chapter}
This is a sample chapter.
\end{document}
这是我的徽标:
答案1
让我们用大炮击打这只小鸟;)
\documentclass[12pt]{book}
\usepackage{fancyhdr,blindtext,tikz}
\fancypagestyle{myfancy}{%
\fancyhf{}%
\fancyfoot[C]{\tikz[baseline={(0,0)},anchor=center] \node[label={center:\thepage}]{\includegraphics[scale=.1]{pecemblem}};}%
\renewcommand{\headrulewidth}{0pt}%
\renewcommand{\footrulewidth}{0pt}%
}%
%% without the following the chapter pages won't have fancy page style
\makeatletter
\let\ps@plain\ps@myfancy
\makeatother
%
\pagestyle{myfancy}
\begin{document}
\Blinddocument
\end{document}
如果\fancyfoot[C]{...
你使用\fancyfoot[LE,RO]{....
,则会得到以下结果:
编辑:
有了您的徽标,也许这就是您想要的:
\fancyfoot[LE,RO]{\tikz[baseline={(0,0)},anchor=center] \node[draw,inner sep=0pt,
outer sep=0pt,label={[xshift=-.13cm,yshift=0.1cm]center:\footnotesize\thepage}]
{\includegraphics[scale=.15]{logoSSS}};}%
这使: