相当于 css “position:relative” 稍微移动一个图形

相当于 css “position:relative” 稍微移动一个图形

我有一个包含两列的标题;在第一列上,我有一张图片(徽标),我想稍微调整一下它的位置。以下是相关代码:

\fancyhead[LE,LO]{\tt\begin{multicols}{2}\includegraphics[scale=0.5]{logo.eps}\vfill\columnbreak some more text...\end{multicols}}

可以将我的图像稍微向左上方移动一点吗?

[编辑]

这是一个最小的工作示例:

\documentclass[a4paper,11pt]{article}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{multicol}
\pagestyle{fancy}
\fancyhead{} % clear all header fields
\fancyhead[LE,LO]{\begin{multicols}{2}\includegraphics[height=3cm]{logo.eps}\vfill\columnbreak Right column text\end{multicols}}
\setlength\topmargin{2cm}
\setlength\oddsidemargin{2cm}
\setlength\textheight{200 mm}
\setlength\textwidth{17cm}
\setlength\headheight{3cm}
\setlength\headsep{2cm}
\begin{document}
some content
\end{document}

谢谢

答案1

multicols不是最好的标题;我建议使用表格;此外,geometry可以更容易地定义页面尺寸。

\documentclass[a4paper,11pt]{article}
\usepackage[
  top=1cm, % top margin
  left=2cm, % left margin
  textwidth=17cm,
  textheight=20cm,
  includehead, % the header is included in the computations
  headheight=3cm, % height of the header
  headsep=2cm,
  heightrounded, % to have an integer number of lines
]{geometry}

\usepackage[demo]{graphicx}

\usepackage{url}    % for demonstration purposes
\usepackage{lipsum} % mock text

%% Define the text in the header
\newcommand{\headertext}{%
  The name of the firm\newline
  Address \newline
  \url{http://firm.com}
}

%% Let's define the header
\usepackage{fancyhdr}
\pagestyle{fancy}
\renewcommand{\headrulewidth}{0pt}
\fancyhead{} % clear all header fields
\fancyhead[L]{%
  %% assuming the width of the logo is 4cm, we put it 1cm left in the margin
  %% and we cut 3cm (width - offset) from the remaining space, for the text
  \hspace*{-1cm}\begin{tabular}{@{}lp{\dimexpr\textwidth-3cm-2\tabcolsep}@{}}
  \raisebox{\dimexpr-\height+\ht\strutbox}{\includegraphics[height=3cm,width=4cm]{logo.eps}}
  & \headertext
  \end{tabular}%
}

\begin{document}
\lipsum[1-2]
\end{document}

将徽标与标题文本区分开并不困难

在此处输入图片描述

相关内容