Page LayoutA5 paper size needed in PDF

Information and discussion about page layout specific issues (e.g. header and footer lines, page formats, page numbers).
kostas
Posts: 7
Joined: Wed Nov 03, 2010 9:02 pm

A5 paper size needed in PDF

Post by kostas »

Hi all,

I am experiencing the same problem in another thread [1]. However, none of the solutions suggested so far produces the desired output (a book in a5 paper size).

When I try

\documentclass[12pt,a5paper]]{book}
\usepackage[dvips,a5paper]{geometry}

I get the a dvi, ps and pdf in a4 size. I have not tried through pdflatex because I need to go through the dvi/ps routine as my document has .eps figures which pdflatex cannot handle. Adding the dvips in the geometry (as it has been suggested elsewhere) does not change anything.

When I try

\documentclass[12pt,a5paper]{book}
\special{papersize=5.85in,8.26in}

I do get the final pdf in a5, however the text is botched. Only the upper left quarter of the text is shown on each page. The rest is cut.

I have been trying to find a solution to this for several days to no avail. I have been using LaTeX for seven years and it usually handles everything. I cannot imagine that it is impossible to do such a simple thing as have your document in a5 paper size.

Any help will be appreciated!

[1] View topic: Need PDF page size to be A5


Kostas
Last edited by kostas on Fri Nov 05, 2010 8:43 pm, edited 1 time in total.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

A5 paper size needed in PDF

Post by frabjous »

kostas wrote: I get the a dvi, ps and pdf in a4 size. I have not tried through pdflatex because I need to go through the dvi/ps routine as my document has .eps figures which pdflatex cannot handle.
As of TeXlive 2010 and MikTeX 2.9, pdflatex handles .eps figures. Older versions can handle .eps figures with the epstopdf package; you could also use the epstopdf command line tool to convert the .eps figures to .pdf figures.

The last few versions of XeLaTeX can also handle .eps.
kostas
Posts: 7
Joined: Wed Nov 03, 2010 9:02 pm

Re: A5 paper size needed in PDF

Post by kostas »

Hello and thanks for your prompt reply.

I already tried the epstopdf package but I get the 'unknown graphics extension' error.

I am using Kile on Ubuntu and was looking for a solution which would not require installation and migration to new software.

Kostas
User avatar
localghost
Site Moderator
Posts: 9202
Joined: Fri Feb 02, 2007 12:06 pm

A5 paper size needed in PDF

Post by localghost »

I have no problem in compiling the sample below to an A5 sized PDF document with both compiling routes on both a MiKTeX 2.8 system with TeXnicCenter and TeX Live 2009 on openSUSE with Kile.

Code: Select all

\documentclass[10pt,a5paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{geometry}
\usepackage{blindtext}

\title{A5 paper size}
\author{kostas}

\begin{document}
  \maketitle
  \blinddocument
\end{document}
As frabjous already mentioned, on TeX Live 2010 EPS files will be converted automatically. Otherwise use the epstopdf package for conversion "on the fly".


Best regards and welcome to the board
Thorsten
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

A5 paper size needed in PDF

Post by frabjous »

kostas wrote:Hello and thanks for your prompt reply.

I already tried the epstopdf package but I get the 'unknown graphics extension' error.
Did you enable the --shell-escape flag for pdflatex when Kile calls it?

(I don't have Kile installed at the moment, and can't remember the exact steps, but it shouldn't be too hard to do this.)

Anyway, even if that doesn't work, you almost definitely have the epstopdf command line tool already installed.

Open a terminal. Type in:

Code: Select all

cd "path/to/where/eps/figures/are"
for file in *.eps ; do epstopdf "$file" ; done
(Obviously, for the first line, insert the actual path to where the files are.)

Voilà, now all your files are available as PDFs for pdflatex too.
kostas
Posts: 7
Joined: Wed Nov 03, 2010 9:02 pm

A5 paper size needed in PDF

Post by kostas »

frabjous wrote: Anyway, even if that doesn't work, you almost definitely have the epstopdf command line tool already installed.

Voilà, now all your files are available as PDFs for pdflatex too.
Yes, I just did that and it successfully converted all the .eps files to .pdf
localghost wrote:I have no problem in compiling the sample below to an A5 sized PDF document with both compiling routes on both a MiKTeX 2.8 system with TeXnicCenter and TeX Live 2009 on openSUSE with Kile.

Code: Select all

\documentclass[10pt,a5paper,english]{article}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{geometry}
\usepackage{blindtext}

\title{A5 paper size}
\author{kostas}

\begin{document}
  \maketitle
  \blinddocument
\end{document}
Then I compiled a slightly amended version of the above MWE on Kile.

Code: Select all

\documentclass[10pt,a5paper,english]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{geometry}
\usepackage{blindtext}

\usepackage{graphicx}

\title{A5 paper size}
\author{kostas}

\begin{document}
\maketitle
\blinddocument
\end{document}
The pdflatex worked fine. The dvips routine, however, produced an a4 page with the a5 document on the top left. I am attaching the output of the latter (testing.pdf).

The I tried inserting one of the converted to .pdf figures (Figure2.1.pdf attached) as follows:

Code: Select all

\documentclass[10pt,a5paper,english]{book}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{babel}
\usepackage{geometry}
\usepackage{blindtext}

\usepackage[pdftex]{graphicx}

\title{A5 paper size}
\author{kostas}

\begin{document}
\maketitle
\blinddocument

\begin{figure}[!htb]
\includegraphics{Figure2.1.pdf}
\end{figure}

\end{document}
Either way (pdflatex or dvps) I get the error:
testing.tex:18:Unknown graphics extension: .1.pdf. \includegraphics{Figure2.1.pdf}

So there are two issues here. One, I still cannot get proper a5 output through the dvips. Two, when I try to avoid the dvips for pdflatex, I cannot get the figures to work.
Attachments
Figure2.1.pdf
(3.54 KiB) Downloaded 425 times
testing.pdf
(75.44 KiB) Downloaded 503 times
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

A5 paper size needed in PDF

Post by frabjous »

Either way (pdflatex or dvps) I get the error:
testing.tex:18:Unknown graphics extension: .1.pdf. \includegraphics{Figure2.1.pdf}
This says it all. Because of the extra dot in the file name, it thinks the extension is ".1.pdf" rather than ".pdf" and it doesn't know what to do with ".1.pdf" files. Rename your files (e.g., Figure2-1.pdf) and all will be well.

If you really need to use dots in your file names, I suppose you could use the \DeclareGraphicsExtensions command of the graphicx package (see the graphicx manual, page 10), but I think it would be better to rename your files.
kostas
Posts: 7
Joined: Wed Nov 03, 2010 9:02 pm

A5 paper size needed in PDF

Post by kostas »

frabjous wrote:
This says it all. Because of the extra dot in the file name, it thinks the extension is ".1.pdf" rather than ".pdf" and it doesn't know what to do with ".1.pdf" files. Rename your files (e.g., Figure2-1.pdf) and all will be well.
Yes thanks! I was wondering about the dots but with the .eps files I did not use any extension and they worked fine. I changed the file names to Figure2-1.pdf and so on and so forth and was able to get the a5 output in the mwe.

However, when I tried the same thing (pdflatex) on my actual .tex file (reproduced below) I still got the output in a4.

Code: Select all

\documentclass[12pt,a5paper]{book}
\usepackage[a5paper]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage[pdftex]{graphicx}
\usepackage{lscape}
\usepackage{vmargin}
\usepackage{textcomp}
\usepackage{setspace}
\usepackage{marvosym}
\usepackage{gensymb} %%%for \micro tag
\usepackage{upgreek} %%% \upmu
\usepackage{tipa}
\usepackage{phonetic}
\usepackage[greek,english]{babel}
\usepackage{threeparttable}
\usepackage{multirow}
\usepackage{harvard}
\usepackage{longtable}
\renewcommand{\sectionmark}[1]{\markright{#1}}
\renewcommand{\chaptermark}[1]{\markboth{#1}{}}
\addto\captionsenglish{\renewcommand{\bibname}{References}}
\begin{document} 

% TITLE PAGE -------------------------------------------------------------
\begin{titlepage}
\begin{center}
\end{center}
\vspace{2cm}
\footnotesize Submitted for the fulfilment of the requirements of the degree of Doctor of Philosophy
\end{titlepage}

%--------------ABSTRACT----------------------------------------
\newpage
\include{abstract}

% ACKNOWLEDGEMENTS----------------------------------------------------------
\newpage
\include{acknowledgements}

% TOC LOF LOT------------------------------------------------------------------------
%\pagestyle{plain}
\tableofcontents

\listoffigures
\listoftables

% ABBREVIATIONS----------------------------------------------------------
\newpage
\include{abbreviations}

% ARCHIVAL SOURCES CITED----------------------------------------------------------
\newpage
\include{archival}

% ------------------------------------------------------------------------
\newpage
%\setlength{\parskip}{3ex}

% INCLUDE CHAPTER FILES---------------------------------------------------
\pagenumbering{arabic}
\include{Chapter1}
\include{Chapter2}
\include{Chapter3}
\include{Chapter4}
\include{Chapter5}
\include{Chapter6}
\include{Chapter7}
\include{Appendix}

\addcontentsline{toc}{chapter}{References}
\bibliographystyle{apsr.bst}
\bibliography{thesisbiblio2}

\end{document}
User avatar
frabjous
Posts: 2064
Joined: Fri Mar 06, 2009 12:20 am

A5 paper size needed in PDF

Post by frabjous »

I don't know what you expect us to do with that sample. Obviously we cannot test it without the included documents. Please read up on how to create a proper minimal working example, and why it is important to do so.

However, I suspect the problem is with the vmargin package: it is also used to set paper and margin sizes, and it is probably undoing the effect of the geometry package. Is there a reason you're loading that package? Doesn't the geometry package offer everything it does (plus more?)
kostas
Posts: 7
Joined: Wed Nov 03, 2010 9:02 pm

A5 paper size needed in PDF

Post by kostas »

frabjous wrote:I don't know what you expect us to do with that sample. Obviously we cannot test it without the included documents. Please read up on how to create a proper minimal working example, and why it is important to do so.
I was expecting that you might notice something in the actual code that might be causing the problem. Posting a mwe (as I previously did) is often helpful but sometimes we need to check the actual code used in order to point out any inconsistencies.
frabjous wrote:However, I suspect the problem is with the vmargin package: it is also used to set paper and margin sizes, and it is probably undoing the effect of the geometry package.
And you are absolutely right, because when I disabled the vmargin package everything worked perfectly!

Many thanks for all your input. I will now mark the thread accordingly.
Post Reply