I'm a LaTeX newbie. I want to create a page layout like in the picture below on every page.
Can someone help please? Thanks.
I'm a LaTeX newbie. I want to create a page layout like in the picture below on every page.
Can someone help please? Thanks.
Since you want to have the layout for every page you could define a header containing a table instead of making the whole page a table, i.e. \chead{\begin{tabular} ... \end{tabular}} (with help of the standard package fancyhdr). In the final solution I used tabularx to build the actual table:
\documentclass{article}
\usepackage[top=125pt,headheight=75pt,headsep=10pt]{geometry}
\usepackage{fancyhdr}
\pagestyle{fancy}
\fancyhf{}
\chead{%
\renewcommand{\arraystretch}{1.75}%
\begin{tabularx}{\textwidth}{|c|>{\centering\arraybackslash}X|c|}
\hline
Text here & Text here & Text here \\[5pt]
\hline
Text here & \multicolumn{2}{c|}{%
\vtop{%
\hbox{\strut Text here}
\hbox{\strut Text here}
}
} \\[15pt]
\hline
\end{tabularx}%
}
\cfoot{\thepage}
\renewcommand{\headrulewidth}{0pt}
\usepackage{tabularx}
\makeatletter
\newdimen\@ht
\@ht\dimexpr\textheight+\headheight+\headsep+2em\relax
\AtBeginDocument{%
\leftskip1em
\rightskip1em
\AtBeginDvi{%
\moveright\@themargin%
\vbox to\z@{\baselineskip\z@skip\lineskip\z@skip\lineskiplimit\z@%
\hbox to\textwidth{%
\llap{\vrule height\@ht}\hfil%
\vrule height\@ht
}%
\vbox to\z@{\vss\hrule width\textwidth}%
\vss
}
}
}
\makeatother
\begin{document}
\vspace*{0.3\textwidth}
{\LARGE\centering Text here\par}
\end{document}
According to comments, the first page has a different formatting. The code now uses a conditional to produce the desired results.
Here's one way to do it using the background and tikzpagenodes packages; the code needs two or three runs for the elements to reach their final locations:
The code:
\documentclass{article}
\usepackage[scale=1,angle=0,opacity=1,color=black]{background}
\usepackage{tikzpagenodes}
\usepackage{lipsum}
\newlength\FrameHShift
\newlength\FrameVShiftT
\newlength\FrameVShiftB
\setlength\FrameHShift{20pt}
\setlength\FrameVShiftT{15pt}
\setlength\FrameVShiftB{75pt}
\backgroundsetup{
contents={%
\begin{tikzpicture}[overlay]
\coordinate (nw) at ([shift={(-\FrameHShift,\FrameVShiftT)}]current page text area.north west);
\coordinate (ne) at ([shift={(\FrameHShift,\FrameVShiftT)}]current page text area.north east);
\coordinate (sw) at ([shift={(-\FrameHShift,-\FrameVShiftB)}]current page text area.south west);
\coordinate (se) at ([shift={(\FrameHShift,-\FrameVShiftB)}]current page text area.south east);
\draw
(nw) --
(ne) --
(se) --
(sw)-- cycle;
\ifnum\value{page}=1
\node[
draw,
anchor=south west,
text width=0.25\textwidth,
minimum height=10ex,
align=center,
yshift=-\pgflinewidth
]
at (nw)
(text4)
{text d \\ text d};
\node[
draw,
anchor=south west,
text width=0.25\textwidth,
minimum height=5ex,
align=center,
yshift=-\pgflinewidth
]
at (text4.north west)
(text1)
{text a};
\node[
draw,
anchor=south west,
text width=0.5\textwidth,
minimum height=5ex,
align=center,
xshift=-\pgflinewidth
]
at (text1.south east)
(text2)
{text b};
\node[
draw,
anchor=south west,
text width=\dimexpr0.25\textwidth+2\FrameHShift-\pgflinewidth\relax,
minimum height=5ex,
align=center,
xshift=-\pgflinewidth
]
at (text2.south east)
(text3)
{text c};
\node[
draw,
anchor=south west,
text width=\dimexpr0.75\textwidth+2\FrameHShift-\pgflinewidth\relax,
minimum height=10ex,
align=center,
xshift=-\pgflinewidth
]
at (text4.south east)
(text5)
{text e \\ text e};
\node[anchor=north]
at ([yshift=-50pt]current page text area.south)
{Page~\thepage};
\else
\node[
draw,
anchor=south west,
text width=0.25\textwidth,
minimum height=5ex,
align=center,
xshift=-0.5\pgflinewidth,
yshift=-\pgflinewidth
]
at (nw)
(text1)
{text a};
\node[
draw,
anchor=south west,
text width=0.5\textwidth,
minimum height=5ex,
align=center,
xshift=-\pgflinewidth
]
at (text1.south east)
(text2)
{text b};
\node[
draw,
anchor=south west,
text width=\dimexpr0.25\textwidth+2\FrameHShift\relax,
minimum height=5ex,
align=center,
xshift=-\pgflinewidth
]
at (text2.south east)
(text3)
{text c};
\fi
\end{tikzpicture}%
}
}
\pagestyle{empty}
\begin{document}
\lipsum[1-30]
\end{document}
Three auxiliary length allow easily customization:
\FrameHShift, horizontal separation between the text and the frame.\FrameVShiftT, vertical separation between text and the lower part of the header.\FrameVShiftB, vertical separation between text and lower part of the frame.Another one, could you please more clear about these commands at (text4.north west) (text1) {text a}; Thanks.
– kmmm Sep 04 '15 at 01:59fancyhdr might be preferable.
– Gonzalo Medina
Sep 09 '15 at 17:48