28 December 2008 by Stefan Kottwitz
On December 26th Zdenêk Wagner has released the zwpagelayout package, dealing with page layout in general, like the well known geometry package.
It may not provide as many features as geometry but it brings additional tools, for instance it’s supporting cropmarks.
The package can be loaded by:
\usepackage[options]{zwpagelayout}
All options have to be set in the preamble, either by this line or given to the document class.
Options may be paper sizes (by name or by lengths), orientation (portrait, landscape), margins, text dimensions (also concerning head and foot), cropmark related options and options concerning the design of book covers like spine and flap.
There are even options to reflect pages horizontally or vertically, that are intended for printing but shouldn’t be used for documents providing hyperlinks.
Further the package is capable of calculating missing page layout dimensions if enough dimensions are already given.
zwpages comes well documented on 16 pages. For more information and download visit:
Category: Layout |
No Comments »
11 October 2008 by Stefan Kottwitz
A question on LaTeX-Community.org inspired me to try pgf/TikZ together with titlesec to produce fancy chapter headings. The result is this small compilable demonstration example:
\documentclass[svgnames]{report}
\usepackage{tikz}
\usepackage{kpfonts}
\usepackage[explicit]{titlesec}
\newcommand*\chapterlabel{}
\titleformat{\chapter}
{\gdef\chapterlabel{}
\normalfont\sffamily\Huge\bfseries\scshape}
{\gdef\chapterlabel{\thechapter\ }}{0pt}
{\begin{tikzpicture}[remember picture,overlay]
\node[yshift=-3cm] at (current page.north west)
{\begin{tikzpicture}[remember picture, overlay]
\draw[fill=LightSkyBlue] (0,0) rectangle
(\paperwidth,3cm);
\node[anchor=east,xshift=.9\paperwidth,rectangle,
rounded corners=20pt,inner sep=11pt,
fill=MidnightBlue]
{\color{white}\chapterlabel#1};
\end{tikzpicture}
};
\end{tikzpicture}
}
\titlespacing*{\chapter}{0pt}{50pt}{-60pt}
\begin{document}
\tableofcontents
\chapter{Introduction}
Text
\chapter{Main}
\section{Section}
Text
\begin{thebibliography}{99}
\bibitem{Test} test reference
\end{thebibliography}
\end{document}
Screenshot:
See also pdf output of this test & demo file.
Category: Sectioning, Graphics, Layout |
11 Comments »
17 September 2008 by Stefan Kottwitz
When you want to include an image or a table that’s wider than the text width, you will notice that even when \centering or the center-environment is used this wide object will not be centered in relation to the surrounding text. It will be placed at the left margin but go into the right margin. Its frequently requested that wide figures or tables should overlap at both sides in equal measure.
It can easily achieved by putting the table or picture inside a box, giving the box the width of the text, by the \makebox command. Here is a compilable example, where I’m centering a table having 1.5 times the width of the text:
\documentclass[a4paper,10pt]{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{tabularx}
\begin{document}
\blindtext
\bigskip
\noindent\makebox[\textwidth]{%
\begin{tabularx}{1.5\textwidth}{XX}
\blindtext & \blindtext
\end{tabularx}}
\bigskip
\blindtext
\end{document}
I’ve used \noindent to suppress the paragraph indentation, otherwise I would get an overfull \hbox. As you may notice there’s no \centering necessary because the width of the box equals \textwidth.
This topic was discussed in the LaTeX Community Forum, on CQF.info and on mrunix.de.
.
Category: Figures and Tables, Layout |
3 Comments »
12 September 2008 by Stefan Kottwitz
I’m frequently noticing questions regarding problems with paper size and pdfLaTeX, for instance Bug 215561 and Bug 244043 on Launchpad, yesterday on mrunix.de and also yesterday on matheplanet.com.
If you manually change \paperwidth or \paperheight or use the landscape option of LaTeX classes like for instance article it could happen that the paper size of the resulting pdf differs.
A solution is to adjust the \pdfpagewidth and \pdfpageheight values:
\setlength{\pdfpagewidth}{\paperwidth}
\setlength{\pdfpageheight}{\paperheight}
To use the geometry package could correct it too. But if you use it together with gmeometric, it may still be necessary to adjust the pdf page size like written above, see for instance goLaTeX.de.
Category: Layout |
No Comments »
23 June 2008 by Stefan Kottwitz
Today CTAN Announcements informed that the package blowup has been released. It can be used to upscale or downscale all pages of a document. For a first test I created this short a5paper document:
\documentclass[pdftex,a5paper,10pt]{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{hyperref}
\begin{document}
\tableofcontents
\section{One}
\blindtext[3]
\section{Two}
\blindtext[4]
\end{document}
It’s pdf output can be opened here. The pdfinfo tool printed:
Page size: 419.528 x 595.276 pts
Now I used the \blowUp macro to upscale the document pages to fit a4 paper size:
\documentclass[a5paper,10pt]{article}
\usepackage[english]{babel}
\usepackage{blindtext}
\usepackage{hyperref}
\usepackage{blowup}
\blowUp{paper=a4}
\begin{document}
\tableofcontents
\section{One}
\blindtext[3]
\section{Two}
\blindtext[4]
\end{document}
The new pdf output can be opened here. pdfinfo output:
Page size: 595.276 x 841.89 pts (A4)
Of couse you could inspect the paper sizes by using the Adobe Reader.
The blowup package includes several source code examples. During the test I’ve noticed one small mistake in the documentation, the user-level macro \blowUp is described as \blowup, that will cause an error. But I’m sure this will be corrected soon, at least I will report it to the package author.
Category: Tools for LaTeX, Layout |
1 Comment »
21 June 2008 by Stefan Kottwitz
In documents using the book or report class the first page of a chapter will have the page style plain, the page number will appear at the bottom of the page. If you want to remove the number you could write \thispagestyle{empty} on each of those pages, or you could force the plain page style to be empty:
\makeatletter
\let\ps@plain\ps@empty
\makeatother
If you use the headings or fancy pagestyle and you want that pagestyle for opening pages of chapters too, you can write similar for instance
and all plain pages will look like the fancy style.
This topic was discussed in the LaTeX Community Forum on mrunix.de and on CQF.info.
Category: Layout |
No Comments »