# Difficulty printing fancyhdr and margin specification

I'm trying to print a calendar, hedge to hedge, bottom to top. So I used the fancyhdr packages and put all the specified margins and it look great, but when I get the PDF and use the printing dialogue, things get messy.

I have the choice -> fit to page or not

But since I want the calendar to use the most space possible on the page (once printed) if I un-check the "fit to page" option things go off the page.

How do I print as big as possible.

\documentclass[landscape,a4paper]{article}
%
\usepackage[utf8]{inputenc} %
%
\usepackage[T1]{fontenc}    %   Load a font with all the characters
%
\usepackage{lmodern}        %
%

\usepackage{fancyhdr}
\pagestyle{fancy}
\fancypagestyle{nofooter}{%
\fancyfoot{}%
}

\usepackage{color}
\usepackage{calendar} % Use the calendar.sty style

\usepackage[landscape,margin=0.6in,top=0.1in,bmargin=0.01in]{geometry}

\begin{document}

\pagestyle{empty} % Removes the page number from the bottom of the page

\noindent

\StartingDayNumber=1 % Calendar starting day, default of 1 means Sunday, 2 for Monday, etc

\newpage

\begin{center}
\textsc{\Huge Octobre}\\ % Month
\end{center}

%----------------------------------------------------------------------------------------
\noindent
\begin{flushleft}
\begin{calendar}{\hsize}

\setcounter{calendardate}{28} % Start the date counter at 1

% 1 - Example of content
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\setcounter{calendardate}{1}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}
\day{}{\vspace{3.1cm}}

\setcounter{calendardate}{1}
\day{}{\vspace{2.9cm}}

\finishCalendar
\end{calendar}
\end{flushleft}


for calendar.sty

\NeedsTeXFormat{LaTeX2e}

\def\CalendarVersion{3.1}
\def\CalendarVersionDate{2009/04/24}

\ProvidesClass{calendar}[\CalendarVersionDate
LaTeX2e class file calendar' v\CalendarVersion]

\typeout{'calendar' style \CalendarVersion \CalendarVersionDate.}
\typeout{Created by Evan Sultanik}
\typeout{****** Bugs/comments/suggestions/technicalities to Evan Sultanik -- evan@sultanik.com ******}

\RequirePackage{tabularx}

\def\@CALtrue{1}
\newcount\@currentdaynum
\newcounter{calendardate}
\newcount\StartingDayNumber

\noindent
\begin{minipage}[t]{0.87\hsize}
\noindent
\raggedright
\textit{#1}
\end{minipage}
\begin{minipage}[t]{0.1\hsize}
\noindent
\raggedleft
\textit{#2}
\end{minipage}
}
\def\activities#1{
\parbox{\hsize}{\vspace*{5pt}\raggedright\scriptsize #1}\smallskip
}

\let\@colbreak=&

\def\printdayname#1{\hfil\textsc{#1}\hfil}

\newcommand{\dayname}[1]{
\ifnum#1=1 Sunday\else
\ifnum#1=2 Monday\else
\ifnum#1=3 Tuesday\else
\ifnum#1=4 Wednesday\else
\ifnum#1=5 Thursday\else
\ifnum#1=6 Friday\else
\ifnum#1=7 Saturday\else
\PackageError{calendar}{Unrecognized day number: #1!}
\fi\fi\fi\fi\fi\fi\fi
}

\StartingDayNumber=1
\newenvironment{calendar}[1]{
\newdimen\@calendarwidth
\@calendarwidth=#1
\begingroup
\def\@calendarmode{\@CALtrue}
\def\day##1##2{
\if\@calendarmode\@CALtrue\else\PackageWarning{calendar}{The '\day' macro is expected to be used in the 'calendar' environment!}\fi
\ifnum\@currentdaynum>7\global\@currentdaynum=1\fi
\activities{##2}
\ifnum\@currentdaynum>7\@arraycr\hline\else&\fi
}
\def\finishCalendar{
\ifnum\@currentdaynum=6 &\\\hline\else
\ifnum\@currentdaynum=5 &&\\\hline\else
\ifnum\@currentdaynum=4 &&&\\\hline\else
\ifnum\@currentdaynum=3 &&&&\\\hline\else
\ifnum\@currentdaynum=2 &&&&&\\\hline\else
\ifnum\@currentdaynum=1 &&&&&&\\\hline
\fi\fi\fi\fi\fi\fi
}
\def\BlankDay{
\if\@calendarmode\@CALtrue\else\PackageWarning{calendar}{The     '\calendarday' macro is expected to be used in the 'calendar' environment!}\fi
\ifnum\@currentdaynum>7\global\@currentdaynum=1\fi
\ifnum\@currentdaynum>7\@arraycr\hline\else&\fi
}

\setcounter{calendardate}{1}
\newcount\@currday
\@currday=\StartingDayNumber
\newcount\@numdays
\@numdays=7
\let\@cbreak=&
\tabularx{\@calendarwidth}{|X|X|X|X|X|X|X|} \hline

\ifnum\@currday>\@numdays\@currday=1\fi\printdayname{\dayname{\@currday}}     \global\advance\@currday by 1 \\ \hline \hline
\@currentdaynum=1
\let\@firstline=\@CALtrue
}{
\endtabularx
\endgroup
}


This is what I want, and see for that matter when looking at my preview in Overleaf.com

This is what I get when trying to print without the "fit to page" option.

Thank you

• This doesn't compile (in texlive and on overleaf) LaTeX Error: File calendar.sty not found. – Ulrike Fischer Sep 30 '16 at 20:04
• @UlrikeFischer, sorry for this, just added the code in the question – Sebastien Comtois Sep 30 '16 at 20:17
• Are you sure that you use a4-paper in your pdf printer dialog? – Ulrike Fischer Sep 30 '16 at 20:56
• What do you see when you export from OverLeaf to PDF? This is not the same as what you see in the preview. You have lots and lots and lots of spurious spaces. Maybe many of them don't matter; maybe not. – cfr Sep 30 '16 at 22:02
• Please check code compiles before uploading. You at least need to end the document` environment. – cfr Sep 30 '16 at 22:04