如何拉伸左侧标题栏的水平线(如右侧一样)?

如何拉伸左侧标题栏的水平线(如右侧一样)?
\documentclass[10pt,times,a4paper]{letter}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{booktabs, tabularx, colortbl, xcolor} 
\usepackage[left=0.8in,right=0.8in,top=0.8in,bottom=0.7in,headsep=0.1in]{geometry}
\usepackage{lipsum}
\fancypagestyle{empty}{
\fancyhf{}
\fancyhead{}
\renewcommand{\headrulewidth}{0pt} % <-----To change the thickness of header
\vspace*{-40pt} %<----To adjust the vertical position of Header  0.47\paperwidth
\begin{tabularx}{0.87\paperwidth}{X}
    \arrayrulecolor{lightgray}  % choose color
    \midrule[0.045in] \par
    \midrule[0.045in]\par   
    \midrule[0.045in]\par   
    \midrule[0.045in]\par
    \midrule[0.045in]
\end{tabularx}
}       
\makeatletter
\address{
}
\begin{document}
\begin{letter}{}
    \pagenumbering{gobble}
\opening{}   
\vspace{20pt}
\lipsum[1-1]
\vspace{10pt}
I will be thankful for your kind consideration.
\vspace{80pt}
Sincerely and Kind Regards,\newline
\raisebox{0pt}[200pt][0pt]

\end{letter}%
\end{document}%

在此处输入图片描述

答案1

这是你想要的吗?

\documentclass[10pt,times,a4paper]{letter}
\usepackage{graphicx}
\usepackage{booktabs, tabularx}
\usepackage[table]{xcolor}
\usepackage[hmargin=0.8in, top=0.8in, bottom=0.7in, headsep=0.1in, showframe]{geometry}
\usepackage{lipsum}
\usepackage{fancyhdr}
\fancypagestyle{empty}{%
\fancyhf{}%
\renewcommand{\headrulewidth}{0pt}%
 \chead{\renewcommand{\arraystretch}{0.02}%
\raisebox{7pt}[0pt][0pt]{\makebox[\textwidth]{%
 \begin{tabularx}{0.87\paperwidth}{X}
 \arrayrulecolor{lightgray} % choose color
 \midrule[0.045in] \\
 \midrule[0.045in]\\
 \midrule[0.045in]\\
 \midrule[0.045in]
 \end{tabularx}}}%
 }}%

\address{
}

\begin{document}

\begin{letter}{}
    \pagenumbering{gobble}
\opening{}
\vspace{20pt}

\lipsum[1-1]
\vspace{10pt}
I will be thankful for your kind consideration.
\vspace{80pt}
Sincerely and Kind Regards,\newline
\raisebox{0pt}[200pt][0pt]

\end{letter}%

\end{document}% 

在此处输入图片描述

答案2

我使用以下代码找到了解决方案。

\documentclass[10pt,times,a4paper]{letter}
\usepackage{graphicx}
\usepackage{fancyhdr}
\usepackage{booktabs, tabularx, colortbl, xcolor} 
\usepackage[left=0.8in,right=0.8in,top=0.8in,bottom=0.7in,headsep=0.1in]{geometry}
\usepackage{lipsum}
\usepackage{chngpage}
\fancypagestyle{empty}{
\fancyhf{}
\fancyhead{}
\renewcommand{\headrulewidth}{0pt} % <-----To change the thickness of header
\vspace*{-40pt} %<----To adjust the vertical position of Header  0.47\paperwidth
\begin{adjustwidth}{-0.9in}{-0.1in}% adjust the L and R margins by 1 inch
\begin{tabularx}{1.3\paperwidth}{X}
    \arrayrulecolor{lightgray}  % choose color
    \midrule[0.045in] \par
    \midrule[0.045in]\par   
    \midrule[0.045in]\par   
    \midrule[0.045in]\par
    \midrule[0.045in]
\end{tabularx}
\end{adjustwidth}
}       
\makeatletter
\address{
}
\begin{document}
\begin{letter}{}
    \pagenumbering{gobble}
\opening{}   
\vspace{20pt}
\lipsum[1-1]
\vspace{10pt}
I will be thankful for your kind consideration.
\vspace{80pt}
Sincerely and Kind Regards,\newline
\raisebox{0pt}[200pt][0pt]

\end{letter}%
\end{document}%

相关内容