Help with page dimensions in latex

In summary, the conversation revolved around troubleshooting an issue with a template used for presentations. The output was not ideal after updating the machine and software, and attempts to adjust the dimensions in the code did not solve the problem. The conversation also mentioned the various packages and configurations used in the template.
  • #1
member 428835
Hi PF! I am using a template I've used a long time for presentations but after I updated my machine (and consequently latex) the output I now get is tall and thin, acceptable for papers but not for presentations.

I tried messing with the dimensions on line 9 right under \documentclass, where it says paper=xxmm:xxmm but nothing works. The code is here

Code:
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%----------------------------------------------------------------------------------------
%    PACKAGES AND OTHER DOCUMENT CONFIGURATIONS
%----------------------------------------------------------------------------------------

\documentclass[
paper=128mm:96mm, % The same paper size as used in the beamer class
fontsize=11pt, % Font size
pagesize, % Write page size to dvi or pdf
parskip=half-, % Paragraphs separated by half a line
]{scrartcl} % KOMA script (article)

\linespread{1.12} % Increase line spacing for readability

%------------------------------------------------
% Colors
\usepackage{xcolor}    % Required for custom colors
% Define a few colors for making text stand out within the presentation
\definecolor{mygreen}{RGB}{44,85,17}
\definecolor{myblue}{RGB}{34,31,217}
\definecolor{mybrown}{RGB}{194,164,113}
\definecolor{myred}{RGB}{255,66,56}
% Use these colors within the presentation by enclosing text in the commands below
\newcommand*{\mygreen}[1]{\textcolor{mygreen}{#1}}
\newcommand*{\myblue}[1]{\textcolor{myblue}{#1}}
\newcommand*{\mybrown}[1]{\textcolor{mybrown}{#1}}
\newcommand*{\myred}[1]{\textcolor{myred}{#1}}
%------------------------------------------------
% Margins
\usepackage[ % Page margins settings
includeheadfoot,
top=3.5mm,
bottom=3.5mm,
left=5.5mm,
right=5.5mm,
headsep=6.5mm,
footskip=8.5mm
]{geometry}
%------------------------------------------------
% lowercase match fonts
\DeclareFontFamily{OT1}{pzc}{}
\DeclareFontShape{OT1}{pzc}{m}{it}{<-> s * [1.10] pzcmi7t}{}
\DeclareMathAlphabet{\mathpzc}{OT1}{pzc}{m}{it}
%------------------------------------------------
% Fonts
\usepackage[T1]{fontenc}    % For correct hyphenation and T1 encoding
\usepackage{lmodern} % Default font: latin modern font
%\usepackage{fourier} % Alternative font: utopia
%\usepackage{charter} % Alternative font: low-resolution roman font
\renewcommand{\familydefault}{\sfdefault} % Sans serif - this may need to be commented to see the alternative fonts
%------------------------------------------------

%------------------------------------------------
% Various required packages
\usepackage{amsthm} % Required for theorem environments
\usepackage{bm} % Required for bold math symbols (used in the footer of the slides)
\usepackage{graphicx} % Required for including images in figures
\usepackage{tikz} % Required for colored boxes
\usepackage{booktabs} % Required for horizontal rules in tables
\usepackage{multicol} % Required for creating multiple columns in slides
\usepackage{lastpage} % For printing the total number of pages at the bottom of each slide
\usepackage[english]{babel} % Document language - required for customizing section titles
\usepackage{microtype} % Better typography
\usepackage{tocstyle} % Required for customizing the table of contents
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{mathtools}
\usepackage{amsfonts}
\usepackage{amssymb}
\usepackage{mathrsfs}
\usepackage{float}
\usetikzlibrary{patterns}% line shading
\usetikzlibrary{arrows,calc,intersections,through}
\usepackage[percent]{overpic}% use for plotting text on pictures

%------------------------------------------------

%------------------------------------------------
% Slide layout configuration
\usepackage{scrpage2} % Required for customization of the header and footer
\pagestyle{scrheadings} % Activates the pagestyle from scrpage2 for custom headers and footers
\clearscrheadfoot % Remove the default header and footer
\setkomafont{pageheadfoot}{\normalfont\color{black}\sffamily} % Font settings for the header and footer

% Sets vertical centering of slide contents with increased space between paragraphs/lists
\makeatletter
\renewcommand*{\@textbottom}{\vskip \z@ \@plus 1fil}
\newcommand*{\@texttop}{\vskip \z@ \@plus .5fil}
\addtolength{\parskip}{\z@\@plus .25fil}
\makeatother

% Remove page numbers and the dots leading to them from the outline slide
\makeatletter
\newtocstyle[noonewithdot]{nodotnopagenumber}{\settocfeature{pagenumberbox}{\@gobble}}
\makeatother
\usetocstyle{nodotnopagenumber}%------------------------------------------------

%------------------------------------------------
% Header configuration - if you don't want a header remove this block
\ihead{
\hspace{-2mm}
\begin{tikzpicture}[remember picture,overlay]
\node [xshift=\paperwidth/2,yshift=-\headheight] (mybar) at (current page.north west)[rectangle,fill,inner sep=0pt,minimum width=\paperwidth,minimum height=2\headheight,top color=mygreen!64,bottom color=mygreen]{}; % Colored bar
\node[below of=mybar,yshift=3.3mm,rectangle,shade,inner sep=0pt,minimum width=128mm,minimum height =1.5mm,top color=black!50,bottom color=white]{}; % Shadow under the colored bar
shadow
\end{tikzpicture}
\color{white}\runninghead} % Header text defined by the \runninghead command below and colored white for contrast
%------------------------------------------------

%------------------------------------------------
% Footer configuration
\setlength{\footheight}{8mm} % Height of the footer
\addtokomafont{pagefoot}{\footnotesize} % Small font size for the footnote

\ifoot{% Left side
\hspace{-2mm}
\begin{tikzpicture}[remember picture,overlay]
\node [xshift=\paperwidth/2,yshift=\footheight] at (current page.south west)[rectangle,fill,inner sep=0pt,minimum width=\paperwidth,minimum height=3pt,top color=mygreen,bottom color=mygreen]{}; % Green bar
\end{tikzpicture}
}

\ofoot[\pagemark/\pageref{LastPage}\hspace{-2mm}]{\pagemark/\pageref{LastPage}\hspace{-2mm}} % Right side
%------------------------------------------------

%------------------------------------------------
% Section spacing - deeper section titles are given less space due to lesser importance
\usepackage{titlesec} % Required for customizing section spacing
\titlespacing{\section}{0mm}{0mm}{0mm} % Lengths are: left, before, after
\titlespacing{\subsection}{0mm}{0mm}{-1mm} % Lengths are: left, before, after
\titlespacing{\subsubsection}{0mm}{0mm}{-2mm} % Lengths are: left, before, after
\setcounter{secnumdepth}{0} % How deep sections are numbered, set to no numbering by default - change to 1 for numbering sections, 2 for numbering sections and subsections, etc
%------------------------------------------------

%------------------------------------------------
% Theorem style
\newtheoremstyle{mythmstyle} % Defines a new theorem style used in this template
{0.5em} % Space above
{0.5em} % Space below
{} % Body font
{} % Indent amount
{\sffamily} % Head font
{} % Punctuation after head
{\newline} % Space after head
{\thmname{#1}\ \thmnote{(#3)}} % Head spec
   
\theoremstyle{mythmstyle} % Change the default style of the theorem to the one defined above
\newtheorem{theorem}{Theorem}[section] % Label for theorems
\newtheorem{remark}[theorem]{Remark} % Label for remarks
\newtheorem{algorithm}[theorem]{Algorithm} % Label for algorithms
\makeatletter % Correct qed adjustment
%------------------------------------------------

%------------------------------------------------
% The code for the box which can be used to highlight an element of a slide (such as a theorem)
\newcommand*{\mybox}[2]{ % The box takes two arguments: width and content
\par\noindent
\begin{tikzpicture}[mynodestyle/.style={rectangle,draw=mygreen,thick,inner sep=2mm,text justified,top color=white,bottom color=white,above}]\node[mynodestyle,at={(0.5*#1+2mm+0.4pt,0)}]{ % Box formatting
\begin{minipage}[t]{#1}
#2
\end{minipage}
};
\end{tikzpicture}
\par\vspace{-1.3em}}
%------------------------------------------------

%----------------------------------------------------------------------------------------
%    PRESENTATION INFORMATION
%----------------------------------------------------------------------------------------

\newcommand*{\mytitle}{Draining Capillary Liquids from Containers with Interior Corners} % Title
\newcommand*{\runninghead}{Capillary Drains} % Running head displayed on almost all slides
\newcommand*{\myauthor}{Josh McCraney\\Advisor: Paul Steen} % Presenters name(s)

%----------------------------------------------------------------------------------------
\newcommand{\putat}[3]{\begin{picture}(0,0)(0,0)\put(#1,#2){#3}\end{picture}}% put pdf wherever on page

\begin{document}

%----------------------------------------------------------------------------------------
%    TITLE SLIDE
%----------------------------------------------------------------------------------------

% Title slide
\thispagestyle{empty} % No slide header and footer
\begin{tikzpicture}[remember picture,overlay] % Background box
\node [xshift=\paperwidth/2,yshift=\paperheight/2.25] at (current page.south west)[rectangle,fill,inner sep=0pt,minimum width=\paperwidth,minimum height=\paperheight/3.5,top color=mygreen,bottom color=mygreen]{}; % Change the height of the box, its colors and position on the page here
\end{tikzpicture}
% Text within the box
\begin{flushright}
\vspace{.6cm}
\color{white}\sffamily
{\LARGE\mytitle\par} % Title
\vspace{0.5cm}
\normalsize
\myauthor\par % Author name
\end{flushright}
%----------------------------------------------------------------------------------------
%    Motivation
%----------------------------------------------------------------------------------------
\vspace{4cm}
\huge{Motivation}\\
\normalsize
blah

%----------------------------------------------------------------------------------------

\end{document}
 
Physics news on Phys.org
  • #2
I think the document class is beamer, I donth think you can muck with all the page settings in the class definition.
 
  • #3
Dr Transport said:
I think the document class is beamer, I donth think you can muck with all the page settings in the class definition.
So are you saying there's likely no easy way to return the page settings to what they were prior to the update?
 
  • #4
joshmccraney said:
So are you saying there's likely no easy way to return the page settings to what they were prior to the update?
I wouldn't think so. All the years I worked with LaTEX, the class is the class and you set things like the size of the text on the page was set someplace else in the file.
 
  • #5
Dr Transport said:
I wouldn't think so. All the years I worked with LaTEX, the class is the class and you set things like the size of the text on the page was set someplace else in the file.
So I found a fix! Looks like putting "papersize={128mm,96mm}" into the geometry package cleans this up nicely!
 

What are the default page dimensions in LaTeX?

The default page dimensions in LaTeX are 8.27 inches by 11.69 inches, also known as A4 size.

How do I change the page dimensions in LaTeX?

To change the page dimensions in LaTeX, you can use the "geometry" package. This package allows you to specify the desired page dimensions and margins.

What unit of measurement is used for page dimensions in LaTeX?

Page dimensions in LaTeX are typically measured in inches (in) or centimeters (cm). However, you can also use other units such as millimeters (mm) or points (pt).

Can I have different page dimensions for different pages in my LaTeX document?

Yes, you can have different page dimensions for different pages in your LaTeX document. To do this, you can use the "geometry" package and specify the desired dimensions for each page.

How do I center my content on the page in LaTeX?

To center your content on the page in LaTeX, you can use the "center" environment or the "\centering" command. Additionally, you can also use the "geometry" package to adjust the margins and center your content on the page.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
2
Views
2K
Back
Top