Page Layout ⇒ A5 paper size needed in PDF
A5 paper size needed in PDF
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
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
A5 paper size needed in PDF
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.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.
The last few versions of XeLaTeX can also handle .eps.
Re: A5 paper size needed in PDF
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
- localghost
- Site Moderator
- Posts: 9202
- Joined: Fri Feb 02, 2007 12:06 pm
A5 paper size needed in PDF
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}
Best regards and welcome to the board
Thorsten
Board Rules
Avoidable Mistakes
¹ System: TeX Live 2025 (vanilla), TeXworks 0.6.10
A5 paper size needed in PDF
Did you enable the --shell-escape flag for pdflatex when Kile calls it?kostas wrote:Hello and thanks for your prompt reply.
I already tried the epstopdf package but I get the 'unknown graphics extension' error.
(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
Voilà, now all your files are available as PDFs for pdflatex too.
A5 paper size needed in PDF
Yes, I just did that and it successfully converted all the .eps files to .pdffrabjous 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.
Then I compiled a slightly amended version of the above MWE on Kile.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}
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 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}
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 502 times
A5 paper size needed in 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.Either way (pdflatex or dvps) I get the error:
testing.tex:18:Unknown graphics extension: .1.pdf. \includegraphics{Figure2.1.pdf}
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.
A5 paper size needed in PDF
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.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.
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}
A5 paper size needed in PDF
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?)
A5 paper size needed in PDF
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: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.
And you are absolutely right, because when I disabled the vmargin package everything worked perfectly!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.
Many thanks for all your input. I will now mark the thread accordingly.