对于我的页眉页面布局,我使用fancyhdr
。我tabular
在页眉中使用 s。以下是我的代码。
\documentclass[titlepage,a4paper,12pt]{article}
%***************************** preamble region **************************
\parindent=0pt %leading space for paragraphs
\usepackage{fancyhdr} %Extensive control of page headers and footers in LaTeX2e
\usepackage[english]{babel} %use for the below package `datetime'
\usepackage{datetime} %Change format of `\today' with commands for current time
\renewcommand{\dateseparator}{-}
\newcommand{\headertoday}{\the\year \dateseparator \twodigit\month \dateseparator \twodigit\day}
\usepackage[lmargin=2.500000cm,rmargin=2.500000cm,tmargin=2.500000cm,bmargin=2.500000cm]{geometry} %Flexible and complete interface to document dimensions
%************************************************************************
\begin{document}
\pagestyle{fancy}
\renewcommand{\arraystretch}{0.600000} %coefficent to adjust table line spacing
\lhead{\begin{tabular}[b]{ll}\footnotesize{Statical Calculation}&\footnotesize{}\\\footnotesize{Project: xxxxxx}&\footnotesize{}\end{tabular}}
\rhead{\begin{tabular}[b]{rr}\footnotesize{Date:}&\footnotesize{\headertoday}\\\footnotesize{Page:}&\footnotesize{\thepage}\end{tabular}}
\chead{\begin{tabular}[b]{cc}\footnotesize{}&\footnotesize{}\\\footnotesize{}&\footnotesize{}\end{tabular}}
\renewcommand{\headrulewidth}{1.000000pt}
\headsep=6.000000mm %the distance of main text to the decorative line
hello\\
\end{document}
但是的内容tabular
没有与两端的装饰线对齐。我的意思是,例如,最左边的文本应该与装饰线的最左端对齐。如何修复?非常感谢。
答案1
您忘记了表格中的列间距。
\lhead{\begin{tabular}{@{}ll}} ...}
\rhead{\begin{tabular}{rr@{}} ... }
(而且您拼错了‘统计’。)