Emacs has a buit-in library to generate a landscape calendar with the function cal-tex-cursor-month-landscape
. I am using TexLive 2012 on a OSX. The calendar image gets truncated on portrait orientation paper -- i.e., TexLive 2012 does not know to print the image in landscape. How can I use cal-tex-cursor-month-landscape
to properly generate a landscape calendar using TexLive 2012?
% This buffer was produced by cal-tex.el.
% To print a calendar, type
% M-x tex-buffer RET
% M-x tex-print RET
\documentclass[12pt]{article}
\hbadness 20000
\hfuzz=1000pt
\vbadness 20000
\lineskip 0pt
\marginparwidth 0pt
\oddsidemargin -2cm
\evensidemargin -2cm
\marginparsep 0pt
\topmargin 0pt
\textwidth 7.5in
\textheight 9.5in
\newlength{\cellwidth}
\newlength{\cellheight}
\newlength{\boxwidth}
\newlength{\boxheight}
\newlength{\cellsize}
\newcommand{\myday}[1]{}
\newcommand{\caldate}[6]{}
\newcommand{\nocaldate}[6]{}
\newcommand{\calsmall}[6]{}
%
\special{landscape}%
\textwidth 9.5in{}%
\textheight 7in{}%
%
\def\holidaymult{.08}%
\fboxsep=0pt
\long\def\caldate#1#2#3#4#5#6{%
\fbox{\hbox to\cellwidth{%
\vbox to\cellheight{%
\hbox to\cellwidth{%
{\hspace*{1mm}\Large \bf \strut #2}\hspace{.05\cellwidth}%
\raisebox{\holidaymult\cellheight}%
{\parbox[t]{.75\cellwidth}{\tiny \raggedright #4}}}
\hbox to\cellwidth{%
\hspace*{1mm}\parbox{.95\cellwidth}{\tiny \raggedright #3}}
\hspace*{1mm}%
\hbox to\cellwidth{#6}%
\vfill%
\hbox to\cellwidth{\hfill \tiny #5 \hfill}%
\vskip 1.4pt}%
\hskip -0.4pt}}}
{}%
\renewcommand{\myday}[1]%
{\makebox[\cellwidth]{\hfill\large\bf#1\hfill}}
%
{}%
\begin{document}%
\pagestyle{empty}%
\setlength{\cellwidth}{24cm}%
\setlength{\cellwidth}{0.157143\cellwidth}
\setlength{\cellheight}{18cm}%
\setlength{\cellheight}{0.166667\cellheight}
\ \par{}%
\vspace*{-3cm}%
\def\calmonth#1#2%
{\begin{center}%
\Huge\bf\uppercase{#1} #2 \\[1cm]%
\end{center}}%
\vspace*{-1.5cm}%
%
{}%
\def\lastmonth{\hbox to\cellwidth{%
\vbox to\cellheight{%
\vfil \hbox to\cellwidth{%
\hfil\scriptsize\begin{tabular}{@{\hspace{0mm}}r@{\hspace{1mm}}r@{\hspace{1mm}}r@{\hspace{1mm}}r@{\hspace{1mm}}r@{\hspace{1mm}}r@{\hspace{1mm}}r@{\hspace{0mm}}}%
\multicolumn{7}{c}{March 2017}\\[1mm]
Su & Mo & Tu & We & Th & Fr & Sa\\[0.7mm]
& & & 1 & 2 & 3 & 4\\[0.5mm]
5 & 6 & 7 & 8 & 9 & 10 & 11\\[0.5mm]
12 & 13 & 14 & 15 & 16 & 17 & 18\\[0.5mm]
19 & 20 & 21 & 22 & 23 & 24 & 25\\[0.5mm]
26 & 27 & 28 & 29 & 30 & 31 &
\end{tabular}\hfil}\vfil}}}%
\def\nextmonth{\hbox to\cellwidth{%
\vbox to\cellheight{%
\vfil \hbox to\cellwidth{%
\hfil\scriptsize\begin{tabular}{@{\hspace{0mm}}r@{\hspace{1mm}}r@{\hspace{1mm}}r@{\hspace{1mm}}r@{\hspace{1mm}}r@{\hspace{1mm}}r@{\hspace{1mm}}r@{\hspace{0mm}}}%
\multicolumn{7}{c}{May 2017}\\[1mm]
Su & Mo & Tu & We & Th & Fr & Sa\\[0.7mm]
& 1 & 2 & 3 & 4 & 5 & 6\\[0.5mm]
7 & 8 & 9 & 10 & 11 & 12 & 13\\[0.5mm]
14 & 15 & 16 & 17 & 18 & 19 & 20\\[0.5mm]
21 & 22 & 23 & 24 & 25 & 26 & 27\\[0.5mm]
28 & 29 & 30 & 31 &
\end{tabular}\hfil}\vfil}}}%
\calmonth{April}{2017}
\vspace*{-0.5cm}%
\myday{Sunday}%%
\myday{Monday}%%
\myday{Tuesday}%%
\myday{Wednesday}%%
\myday{Thursday}%%
\myday{Friday}%%
\myday{Saturday}%%
\\[.2cm]%
\lastmonth\nextmonth\hspace*{-2\cellwidth}\caldate{ }{ }{}{}{}{}%
\caldate{ }{ }{}{}{}{}%
\caldate{ }{ }{}{}{}{}%
\caldate{ }{ }{}{}{}{}%
\caldate{ }{ }{}{}{}{}%
\caldate{ }{ }{}{}{}{}%
\caldate{April}{1}{}{}{91/274}{}%
\hfill\\%
\caldate{April}{2}{}{}{92/273}{}%
\caldate{April}{3}{}{}{93/272}{}%
\caldate{April}{4}{}{}{94/271}{}%
\caldate{April}{5}{}{}{95/270}{}%
\caldate{April}{6}{}{}{96/269}{}%
\caldate{April}{7}{}{}{97/268}{}%
\caldate{April}{8}{}{}{98/267}{}%
\hfill\\%
\caldate{April}{9}{}{}{99/266}{}%
\caldate{April}{10}{}{}{100/265}{}%
\caldate{April}{11}{}{}{101/264}{}%
\caldate{April}{12}{}{}{102/263}{}%
\caldate{April}{13}{}{}{103/262}{}%
\caldate{April}{14}{}{}{104/261}{}%
\caldate{April}{15}{}{}{105/260}{}%
\hfill\\%
\caldate{April}{16}{}{}{106/259}{}%
\caldate{April}{17}{}{}{107/258}{}%
\caldate{April}{18}{}{}{108/257}{}%
\caldate{April}{19}{}{}{109/256}{}%
\caldate{April}{20}{}{}{110/255}{}%
\caldate{April}{21}{}{}{111/254}{}%
\caldate{April}{22}{}{}{112/253}{}%
\hfill\\%
\caldate{April}{23}{}{}{113/252}{}%
\caldate{April}{24}{}{}{114/251}{}%
\caldate{April}{25}{}{}{115/250}{}%
\caldate{April}{26}{}{}{116/249}{}%
\caldate{April}{27}{}{}{117/248}{}%
\caldate{April}{28}{}{}{118/247}{}%
\caldate{April}{29}{}{}{119/246}{}%
\hfill\\%
\caldate{April}{30}{}{}{120/245}{}%
\caldate{}{}{}{}{}{}%
\caldate{}{}{}{}{}{}%
\caldate{}{}{}{}{}{}%
\caldate{}{}{}{}{}{}%
\caldate{}{}{}{}{}{}%
\caldate{}{}{}{}{}{}%
\end{document}%
latex
anddvips
in order to get the desired result (I've just tried it and it works for me with TL2016). Runningpdflatex
on it saysNon-PDF special ignored!
which is the relevant\special{landscape}
line. Are you usingpdflatex
? – Arash Esbati Mar 24 '17 at 9:55landscape
to the document class options should also help. – Jan Mar 24 '17 at 16:05pdflatex
, so that appears to be the problem. @Jan -- I will try addinglandscape
to the document class later today and report back with the results (usingpdflatex
) -- thank you. – lawlist Mar 24 '17 at 16:41article
withlandscape
, but that prevents the PDF from being generated bypdflatex
. The following setting works:\usepackage[left=.2in,top=0.15in,papersize={8.5in,11.0in},landscape,twoside=false]{geometry}
. I'll need to find the internal function responsible for generating the LaTeX code within Emacs and add that line, or take it one step further and put in a condition (if that is possible) for whetherlatex
orpdflatex
is used to compile (disregarding\special{landscape}
if the latter condition exists. – lawlist Mar 24 '17 at 21:51