我正在用\documentclass{article}
它写一篇论文。我必须写一个左对齐、粗体、字体大小为 12 pt 且不斜体的页眉。页码也位于右侧。
我怎样才能拥有它?
它是这样的:
我试过
\usepackage{fancyhdr, blindtext}
\fancyhf{conference}
\fancyhead[L]{\fontsize{9}{11}\selectfont \rightmark}
\fancyhead[L]{\fontsize{9}{11}\selectfont \leftmark}
\fancyfoot[L]{\thepage}
\pagestyle{fancy}
但它不在第一页的顶部,也不在左边。我也试过这个
\usepackage{fancyhdr}
\pagestyle{fancy}
\lhead{conference}
\rhead{\thepage}
但它是斜体。
我按照亲爱的库马尔所说的方法尝试了一下,做了一些修改,但它没有出现在下一页的标题上
\documentclass[11pt]{article}
\usepackage{blindtext}
\usepackage{authblk}
\usepackage{geometry}
\usepackage{caption}
\captionsetup[figure]{labelfont=bf,labelsep=period}
\geometry{
a4paper,
left=30mm,
right=30mm,
top=25mm,
bottom=25mm,
}
\usepackage{fancyhdr}
\fancyhf{}
\lhead{\bfseries Some conference}
\rhead{\thepage}
\renewcommand{\headrulewidth}{0.4pt} %% default
\renewcommand{\footrulewidth}{0.4pt}
%% If you want headers in first page also do the following
\fancypagestyle{plain}{
\fancyhf{}
\lhead{\bfseries Some conference}
\rhead{\thepage} %% or \rfoot??
\renewcommand{\headrulewidth}{0.4pt} %% default
\renewcommand{\footrulewidth}{0.0pt}
}
\usepackage{graphicx} % inserting imagesp
\usepackage[T1]{fontenc}
\renewcommand\rmdefault{ptm}
\usepackage{textcase,url,titlesec}
\titleformat{\section}{\relax}
{\large\BoldAllcaps{\thesection}}{1em}{\large\BoldAllcaps}
\newcommand{\BoldAllcaps}[1]{\MakeTextUppercase{\scshape\bfseries #1}}
\makeatletter
\renewcommand\@maketitle{%
\newpage
\null
\vskip 2em%
\begin{center}%
\let \footnote \thanks
{\Large\bfseries \@title \par}%
\vskip 1.5em%
{\large
\lineskip .5em%
\begin{tabular}[t]{c}%
\@author
\end{tabular}\par}%
\vskip 1em%
{\small \@date}%
\end{center}%
\par
\vskip 1.5em}%
\renewenvironment{abstract}{\section*{\abstractname}}{\relax}
\newcommand{\keywords}[1]{\par\vspace{.5em}\noindent{\large\bfseries \keywordsname:} #1\par}
\def\keywordsname{Keywords}
\makeatletter
\title{some title}
\author{some author1}
\affil{some aff1}
\author{some author2}
\affil{some aff2}
\date{}
\setcounter{Maxaffil}{0}
\renewcommand\Affilfont{\itshape\small}
\begin{document}
\maketitle
\blinddocument
\end{document}
答案1
可能是这样的:
\documentclass[12pt]{article}
\usepackage{fancyhdr}
\usepackage{xcolor}
\usepackage{blindtext}
\usepackage[margin=1in,headheight=16pt,headsep=0.1in,heightrounded]{geometry}
\fancyhf{}
\lhead{\bfseries \textcolor{black!50}{Some conference}}
\rhead{\textcolor{black!50}{\thepage}} %% or \rfoot??
\renewcommand{\headrulewidth}{0.4pt} %% default
\renewcommand{\footrulewidth}{0.4pt}
%% If you want headers in first page also do the following
\fancypagestyle{plain}{
\fancyhf{}
\lhead{\bfseries \textcolor{black!50}{Some conference}}
\rhead{\textcolor{black!50}{\thepage}} %% or \rfoot??
\renewcommand{\headrulewidth}{0.4pt} %% default
\renewcommand{\footrulewidth}{0.4pt}
}
\title{Some paper}
\author{unknown}
\begin{document}
\maketitle
\pagestyle{fancy}
\blinddocument
\end{document}