书本类头部黑色带

书本类头部黑色带

我是 Latex 新手。我尝试了书本课程。我得到了如图所示的黑色带。你能给我解决方案吗?非常感谢!

在此处输入图片描述

\documentclass[oneside, 12pt]{book}
\usepackage[utf8]{inputenc}
\usepackage[utf8]{vietnam}
\usepackage[english]{babel}
% Math package
\usepackage{amssymb}

\usepackage[a4paper,top=3cm,bottom=3cm,left=3cm,right=3cm,marginparwidth=0cm]{geometry}
\usepackage{array}
\usepackage{titlesec}
\usepackage{graphicx,lipsum}
\usepackage{fancyhdr}
\pagestyle{fancy} % enable fancy page style
\renewcommand{\headrulewidth}{50pt} % comment if you want the rule
\fancyhead[R]{\rightmark } % section title on the left right
\titleformat{\chapter}
  {\Large\bfseries} % format
  {}                % label
  {0pt}             % sep
  {\huge}   

\setlength{\parskip}{\baselineskip}%
\setlength{\parindent}{20pt}%

\author{\color{white}\LARGE\sffamily My name}
\title{\color{white}\Huge\sffamily Book name}

\date{}
\usepackage{eso-pic}
\newcommand\BackgroundPic{%
\put(0,0){%
\parbox[b][\paperheight]{\paperwidth}{%
\vfill
\centering
\includegraphics[width=\paperwidth,height=\paperheight,keepaspectratio]{earth.jpg}%
\vfill
}}}

答案1

罪魁祸首是指令

\renewcommand{\headrulewidth}{50pt}

如果您不想在页眉材料下方有一条线 - 特别是 50pt 粗的线! - 将此指令更改为

\renewcommand{\headrulewidth}{0pt}

相关内容