0

I'm trying to make a PDF book out of a Github tutorial at https://github.com/redguardtoo/mastering-emacs-in-one-year-guide/blob/master/guide-en.org (to read it comfortably on my iPad) To do that, I exported the Emacs org file into a tex file and converted it into a pdf by:

$ pandoc -s emacs-in-one-year.tex -o emacs-in-one-year.pdf

and it got converted but the resulting PDF looked out of proportions; the fonts were quite small and there were huge margins on four sides of the texts. For a screenshot see: https://i.hizliresim.com/kXdlp9.png

I've searched Stackoverflow for this problem and applied the suggested solutions but none of them ever worked, the margins are still huge and fonts are small. The modified tex file looks like below now. How can I make fonts larger and margins smaller? Thanks.

% Created 2017-12-04 Mon 18:08
\documentclass[13pt, a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{fixltx2e}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{marvosym}
\usepackage{wasysym}
\usepackage{amssymb}
\usepackage{hyperref}
\usepackage{fullpage}
\setlrmarginsandblock{1cm}{1cm}{*} % Left and right margin
\setulmarginsandblock{2cm}{2cm}{*}  % Upper and lower margin
\checkandfixthelayout
\usepackage{geometry}
\geometry{
  paper=a4paper,
  margin=10pt,
 includeheadfoot
}
\tolerance=1000
\setcounter{secnumdepth}{0}
\author{REPL & The Code Maker}
\date{\today}
\title{Emacs in one year}
\hypersetup{
  pdfkeywords={},
  pdfsubject={},
  pdfcreator={Emacs 25.2.1 (Org mode 8.2.10)}}
\begin{document}

\maketitle
\section*{Master Emacs in one year \hfill{}\textsc{emacs:en}}
\label{sec-1}
Author: Chen Bin (redguardtoo)

Version: 20150424

Updated: \textit{<2015-04-24 Fri>}

Created: \textit{[2012-01-31 Tue 15:08]}

Copyright: This work is licensed under the         
 \href{http://creativecommons.org/licenses/by-nc-nd/3.0/}{Creative Commons     Attribution-NonCommercial-NoDerivs 3.0 Unported License}.

\subsection*{Introduction}
\label{sec-1-1}
I was a Microsoft fan because I was born in China. There was no Unix     culture when I was young.

When I convert

2
  • it is hard to comment on the layout of your example as it produces multiple errors starting with ! Undefined control sequence. <recently read> \setlrmarginsandblock so doesn't really make any usable output at all. Commented Dec 4, 2017 at 19:10
  • the setlrmargins commands come from memoir but you are not loading that class, but you are setting the page size via those commands, by fullpage and by geometry just do one of those (and if you use memoir load that class) article class does not have a 13pt option Commented Dec 4, 2017 at 19:14

1 Answer 1

2

I have edited your example to run without error and have I think the margins that you intended (but these margins are much too small).

% Created 2017-12-04 Mon 18:08
\documentclass[
% there is no 13pt option so 13pt wouldgive 10pt 
12pt,
a4paper]{article}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
% do not use\usepackage{fixltx2e}
\usepackage{graphicx}
\usepackage{longtable}
\usepackage{float}
\usepackage{wrapfig}
\usepackage{rotating}
\usepackage[normalem]{ulem}
\usepackage{amsmath}
\usepackage{textcomp}
\usepackage{marvosym}
\usepackage{wasysym}
\usepackage{amssymb}
\usepackage{hyperref}
% use geometry instead \usepackage{fullpage}

% memoir only \setlrmarginsandblock{1cm}{1cm}{*} % Left and right margin
% memoir only \setulmarginsandblock{2cm}{2cm}{*}  % Upper and lower margin
% memoir only  \checkandfixthelayout
\usepackage{geometry}
\geometry{
  paper=a4paper,
  margin=10pt, % are you sure you want margins that small?????
               % that will not print on may home printers and will make a text block
               % too wide to read with comfort
 includeheadfoot
}
\tolerance=1000
\setcounter{secnumdepth}{0}
%\author{REPL & The Code Maker}
% \and not &
\author{REPL \and The Code Maker}

\date{\today}
\title{Emacs in one year}
\hypersetup{
  pdfkeywords={},
  pdfsubject={},
  pdfcreator={Emacs 25.2.1 (Org mode 8.2.10)}}
\begin{document}

\maketitle
\section*{Master Emacs in one year \hfill{}\textsc{emacs:en}}
\label{sec-1}
Author: Chen Bin (redguardtoo)

Version: 20150424

Updated: \textit{<2015-04-24 Fri>}

Created: \textit{[2012-01-31 Tue 15:08]}

Copyright: This work is licensed under the         
 \href{http://creativecommons.org/licenses/by-nc-nd/3.0/}
      {Creative Commons     Attribution-NonCommercial-NoDerivs 3.0 Unported License}.

\subsection*{Introduction}
\label{sec-1-1}
I was a Microsoft fan because I was born in China. There was no Unix culture when I was young.

\end{document}

enter image description here

8
  • 1
    The OP might want such small margins, if the document will be viewed on a hand-held device.
    – user139954
    Commented Dec 4, 2017 at 19:39
  • 1
    @RobtAll well perhaps, but then it shouldn't say a4paper (unless you have big hands:-) Commented Dec 4, 2017 at 19:50
  • Hello and thank you very much for the interest. I haven't included the whole tex file as it was bit long. I have remade it from scratch (includes no modifications of mine) dropbox.com/s/pz47m7ua4rvihpp/emacs-in-one-year.tex?dl=0 I've tried converting the file you've edited but the result's almost the same, i.e. the margins are huge and fonts are small : ( Maybe it would be better to try with the unmodified tex file.
    – Terry
    Commented Dec 4, 2017 at 23:12
  • Yep, I read the books on an iPad, so the smaller the margins the better. Tex seems to have the margins quite large by default.
    – Terry
    Commented Dec 4, 2017 at 23:21
  • @Romario it isn't that the margins are large by design it's that A4 (and US letter) are too wide for single column text at normal font sizes so a single column text format on A4 ends up with wide margins. on a digital medium it's more or less equivalent leave the font size at 10pt but specify a small page size (and small margins) using geometry. Commented Dec 4, 2017 at 23:54

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .