如何使用 fancyhdr 对标题中的对象进行对齐?

如何使用 fancyhdr 对标题中的对象进行对齐?

在此处输入图片描述 在此处输入图片描述

这两个对象位于标题栏中,但我无法对齐线条以使其位于框的底部。

这条线和一幅图像,它的左侧部分有这种退化,是否可以在乳胶中制作一条有退化的线?

是否可以创建一个根据文本缩放且位于集中文本前后1cm的makebox?

文件“徽标”在此处输入图片描述 文件“行”在此处输入图片描述

\documentclass[12pt,a4paper]{article}

\usepackage{fancyhdr}

\fancyhf{}%

\pagestyle{fancy}

\thispagestyle{plain}

\fancypagestyle{plain}{

\fancyhead[C]{\vspace{3.cm}\includegraphics[width=14.5cm]{Logo/Line}}

\fancyhead[R]{\colorbox{gray}{\makebox[5.0cm]{\textbf{\textcolor{white}{RESEARCH ARTICLE}}}}}
\renewcommand{\headrulewidth}{0pt}
}

\title{\vspace{2cm}Zootherapy and rural livestock farmers in semiarid Patagonia: the transfer of animal aptitudes for health}

\date{}

\begin{document}
\maketitle

\end{document}

答案1

使用 TikZ 和页面样式fancyplain

\documentclass[12pt,a4paper]{article}
\usepackage{lipsum}% only for dummy text

\usepackage{tikz}
\usetikzlibrary{shadings}

\usepackage{fancyhdr}
\pagestyle{fancyplain}
\fancyhf{}

\fancyhead[C]{%
  \fancyplain
    {%
      \raisebox{-\dp\strutbox}{%
      \begin{tikzpicture}
        \node[anchor=south east,gray,fill,text=white,font=\bfseries,inner xsep=1cm,outer sep=0pt](n)at(\headwidth,0){RESEARCH ARTICLE};
        \useasboundingbox(0,0)--(n.south east);
        \shade[left color=white,right color=gray](0.3,0)rectangle([yshift=2pt]n.south west);
        \node[anchor=south west] at (0,0){\includegraphics[width=.33\textwidth]{logo}};
      \end{tikzpicture}%
      }%
  }
  {Header on pages with fancy style}% settings for page style fancy
}
\fancyfoot[C]{\thepage}% page number on both plain and fancy pages

\setlength\headheight{16.06573pt}

\title{\vspace{2cm}Zootherapy and rural livestock farmers in semiarid Patagonia: the transfer of animal aptitudes for health}
\author{}
\date{}

\begin{document}
\maketitle
\lipsum
\end{document}

结果:

在此处输入图片描述

答案2

您可以进行盒子放置。

\documentclass[12pt,a4paper]{article}
\usepackage{xcolor,graphicx}
\usepackage{fancyhdr}

\fancypagestyle{first}{%
  \fancyhf{}%
  \fancyhead[L]{\maketop}%
  \renewcommand{\headrulewidth}{0pt}%
}

\newcommand{\maketop}{%
  \leavevmode\smash{\makebox[\textwidth][l]{%
    \includegraphics[width=0.5\textwidth]{ethnologo}\hfill
    \makebox[0pt][r]{\includegraphics[width=0.6\textwidth]{ethnoline}}%
    \colorbox{gray}{\bfseries\textcolor{white}{RESEARCH ARTICLE}}%
  }}%
}

\setlength{\headheight}{14.5pt}

\title{Zootherapy and rural livestock farmers in semiarid Patagonia: 
       the transfer of animal aptitudes for health}

\author{A. Uthor}

\date{}

\begin{document}

\maketitle\thispagestyle{first}

\end{document}

在此处输入图片描述

相关内容