如何將小型頁面設為文件的頁腳

如何將小型頁面設為文件的頁腳

我有一個文檔,它產生如下輸出:

在此輸入影像描述

綠色部分可以更改其大小,具體取決於清單中的項目數量。

我希望「運送至:」和「附加資訊」部分始終位於頁面底部,無論綠色部分有多大。

我假設我需要使用頁腳來做到這一點?我一直在閱讀有關頁腳的內容,但我不確定如何讓頁腳成為這樣的迷你頁面:

\begin{minipage}[t]{.3\textwidth}
        {\bf SHIP TO:}\\

        \textit{[email protected]}
\end{minipage}
\hfill
\begin{minipage}[t]{0.4\textwidth}
        {\bf ADDITIONAL INFORMATION:}\\

        \textit{We accept payment by cash or cheque. Payment Is due upon receipt, and must be paid in full within {\bf 30 days}.}
\end{minipage}

整個 TEX 檔:

\documentclass[letterpaper,currency=pound]{dapper-purchase_order}
\defaultfontfeatures{ Path = ./Fonts/ }
%\usepackage{fontawesome}                                                                                                                
\definecolor{Mblue}{RGB}{231,255,229}
%                                                                                                                                        
%%%%%%%%%%%%%%%%%% HEADING SECTION %%%%%%%%%%%%%%%%%%                                                                                    
\newcommand{\purchaseOrderNo}{31401} % Invoice Number                                                                                    
\newcommand{\Date}{01/01/2018} % Date                                                                                                    
\newcommand{\clientName}{CUSTOMER NAME LTD} % Client Name                                                                                
%----------------------------------------------------                                                                                    
%                                                                                                                                        
\begin{document}

\newfontface\mainLightItalic{OpenSans-LightItalic}
\makeheader{\purchaseOrderNo}

\addvspace{8ex}

{\Large DATE: \textit{\Date}}

\addvspace{2ex}

{\Large FOR: \textit{\clientName}}

\addvspace{4ex}

\hspace{-.9\marginparwidth}%                                                                                                             
\colorbox{Mblue}{\begin{minipage}{\paperwidth}%                                                                                          

\vspace{.3in}

\begin{hoursItemization}
%                                                                                                                                        
%%%%%%%%%%%%%%%%%% TABLE OF EXPENSES %%%%%%%%%%%%%%%%%%                                                                                  
%                                                                                                                                        
% Put your expenses here in this order: \lineitem{QTY}{PRICE}{ITEM}                                                                      
%                                                                                                                                        
    \lineitem{1}{3075}{550 Litre indirect Storage Vessel with Unvented Kit}
%                                                                                                                                        
    \lineitem{2}{214}{3 kW Aquarius Towel Rail Heating Element with Chrome Finish}
%                                                                                                                                        
    \lineitem{1}{225}{9 kW Stainless Steel Immersion Heater}
%------------------------------------------------------                                                                                  
%                                                                                                                                        
%%%%%%%%%%%%%%%%%%% SUMMARY SECTION %%%%%%%%%%%%%%%%%%%                                                                                  
%                                                                                                                                        
    \beginsummary
%                                                                                                                                        
    \summaryline{SUBTOTAL}{\InvoiceTotal}
%                                                                                                                                        
    \summaryline{V.A.T. @ 20\%}{\vat}
%                                                                                                                                        
    \summaryline{TOTAL}{\total}
%------------------------------------------------------                                                                                  
%                                                                                                                                        
\end{hoursItemization}

\vspace{.3in}

\end{minipage}}

\addvspace{10ex}

\begin{minipage}[t]{.3\textwidth}
        {\bf SHIP TO:}\\

        \textit{[email protected]}
\end{minipage}
\hfill
\begin{minipage}[t]{0.4\textwidth}
        {\bf ADDITIONAL INFORMATION:}\\

        \textit{We accept payment by cash or cheque. Payment Is due upon receipt, and must be paid in full within {\bf 30 days}.}
\end{minipage}

\end{document}

(類文件很長 - 所以我不會發布,因為我認為沒有必要解決這個問題)。

答案1

有很多選擇,可能是最簡單的\vfill,它將把東西推到底部。由於我沒有您的文件類,因此我在通用範例中說明了兩個選項。進一步的選項包括tikzpagenode封裝,這使得 Ti 附帶的絕對定位kZ 更容易。

\documentclass{article}
\usepackage{eso-pic} % only needed for the second option
\pagestyle{empty}
\begin{document}
First option: \verb|\vfill|
\vfill
Bottom--line: \verb|\vfill| works
\clearpage
Another option: use \texttt{eso-pic}
\AddToShipoutPicture{%
     \AtTextUpperLeft{%
         \put(0,-500){\begin{minipage}{\textwidth}
         Bottom--line: also works. you may want to adjust the
         $y$ value \texttt{500} to your needs. This option is particularly useful if
         you want to write many pages with the same bottom--line.
         \end{minipage}}%
     }%
}
\end{document}

答案2

無需使用頁腳即可實現您想要的行為的簡單方法是新增 vspace 和 strecth 因子。

\vspace*{\stretch{2}}在你的兩個小頁面之前添加運送到附加資訊。,將它們推到頁面底部。該命令將根據上面添加的內容調整垂直空間。

答案3

我在頁腳中看到的唯一問題是它不接受段落。就您而言,這很容易解決,\\[<length>]因為您在那裡有固定的內容。我fancyhdr在我的 MWE 中使用了該軟體包,但是我必須刪除您的私人內容,因為我們無法存取它。見下文:

\documentclass[a4paper, 10pt]{article}

%% geometry package was used to build a page that was similar to yours
\usepackage[left=15mm,right=15mm]{geometry}

%% lipsum to create filler text 
\usepackage{lipsum} 

\usepackage{fancyhdr}
\pagestyle{fancy}

%% set the footer
\cfoot{
  % \begin{tabular}{p{\linewidth}}
  \begin{minipage}[t]{.3\textwidth}
    {\bf SHIP TO:}\\[1mm] %% <- changed here
    \textit{[email protected]}
  \end{minipage}
  \hfill
  \begin{minipage}[t]{0.4\textwidth}
    {\bf ADDITIONAL INFORMATION:}\\[1mm] %% <- changed here    
    \textit{We accept payment by cash or cheque. Payment Is due upon receipt, and must be paid in full within {\bf 30 days}.}
  \end{minipage}
}

%% remove the top line, which is default in fancyhdr
\renewcommand{\headrulewidth}{0pt}

\begin{document}
\lipsum[1-20]
\end{document}

在此輸入影像描述

答案4

姆韋

這也使用fancyhdr,但允許下面的中心頁數。 (只是為了好玩,沒有 tikz、表格或迷你頁)。

注意:\bf是一個已棄用的命令。使用 {\bfseries ...}\textbf{...}

\documentclass[a4paper]{article}
\usepackage{lipsum,parskip}
\usepackage[margin=2cm,bmargin=6cm,footskip=4cm]{geometry}
\usepackage{fancyhdr}
\renewcommand{\headrulewidth}{0pt}%
\lfoot{\leavevmode
\vbox to 20ex{\hsize.6\linewidth{\bfseries SHIP TO:}\\[1ex]\itshape
[email protected]}%
\vbox to 20ex{\hsize.4\linewidth {\bfseries 
ADDITIONAL INFORMATION:}\\[1ex]\normalfont\itshape
We accept payment by cash or cheque. Payment is due upon receipt, 
and must be paid in full within {\bfseries 30 days}.}}

\pagestyle{fancy}

\begin{document}
\lipsum[1-50]
\end{document}

相關內容