1

I am trying to landscape a specific page of my document and used pdflscape package and landscape environment to do so. The page does turn into landscape mode, however, the texts are not (as shown in the figure). enter image description here What does make the page to be like that?

Here I add the main.tex file and try.sty file of my document.

\documentclass[oneside,12pt,a4paper,fleqn]{book}
\usepackage{try}

\begin{document} \frontmatter \mainmatter \input{CompleteGraph.tex} \backmatter \end{document}

This is the try.sty file.

% LaTeX cod for chapter header
%--------------------------------------------------------
\makeatletter
\def\@makechapterhead#1{
  %\vspace*{20\p@}   %  \vspace*{15\p@}
  {\parindent \z@ 
      \centering  
    \normalfont
    \ifnum \c@secnumdepth >\m@ne
      \if@mainmatter
      \normalsize 
           \bfseries \@chapapp\space \thechapter 
       \par\nobreak
              \vskip 1.4\baselineskip 
      \fi
    \fi
    \interlinepenalty\@M
    \normalsize     
         \bfseries #1\par\nobreak 
       \vskip 1.4\baselineskip %
  }}
\def\@schapter#1{\if@twocolumn
                   \@topnewpage[\@makeschapterhead{#1}]%
                 \else
                   \@makeschapterhead{#1}
                   \@afterheading
                 \fi}
\def\@makeschapterhead#1{
  %\vspace*{20\p@} % \vspace*{20\p@} %
  {\parindent \z@  
    \centering  
    \normalfont 
    \interlinepenalty\@M
    \normalsize 
    \bfseries  #1\par\nobreak
         \vskip 1.4\baselineskip  
  }}
\makeatother
\renewcommand{\chaptername}{CHAPTER}
%------------------------------------------------------------
% Commands for layout
   %\setlength{\topmargin}{-1.2cm}
   %\setlength{\oddsidemargin}{1.7cm}   %\setlength{\oddsidemargin}{1.46cm} 
\setlength{\textwidth}{14.5cm}
   \setlength{\textheight}{24.5cm} %  \setlength{\textheight}{24.5cm}
   %\setlength{\headheight}{2mm}
    %\setlength{\headsep}{10.175mm}
%-------------------------------------------------------------
% Command for 1.5 spacing
   %\renewcommand{\baselinestretch}{1.5}
\usepackage{doublespace}
\setstretch{1.5}
%-------------------------------------------------------------
% Command for  indentation
   \setlength\parindent{.5in}
   \usepackage{indentfirst} %1st line indented after section...
%-------------------------------------------------------------
% Command for space between paragraph
  \makeatletter
    %\setlength{\parskip}{1.5\baselineskip \@plus 3ex
                %  \@minus 2.0ex}
    \setlength{\parskip}{2\baselineskip \@plus .01ex
                  \@minus .01ex}
   \makeatother
%-------------------------------------------------------------
% Commands for no hyphenation and right justified
    \hyphenpenalty=10000 \sloppy
    \raggedbottom
%-------------------------------------------------------------
% Command to get rid of default running head
   \pagestyle{myheadings}
%-------------------------------------------------------------
% Command for  page number 
%  \makeatletter
%    \renewcommand{\ps@plain}{%
%    \renewcommand{\@oddhead}{\hfill\textrm{\thepage}}
%    \renewcommand{\@evenhead}{\@oddhead}
%    \renewcommand{\@evenfoot}{}
%    \renewcommand{\@oddfoot}{}  }
%   \makeatother
%-----------------------------------------------------------------

%For section font % \usepackage{sectsty} % \chapterfont{\centering\normalsize\uppercase} % \sectionfont{\normalsize\uppercase} % \subsectionfont{\normalsize} % \subsubsectionfont{\itshape\normalsize} %--------------------------------------------------------- %-------------------------------------------------------------- % Commands for REFERENCES name \renewcommand{\bibname}{REFERENCES} %-------------------------------------------------------------- % Commands to change vertical space in section and subsection \makeatletter \renewcommand{\section}{@startsection {section}% % the name {1} % the level {0cm} % the indent {1.0cm} % the beforeskip {0.01cm} %{0.5cm} % the afterskip {\normalfont\normalsize\bfseries} } % the style \renewcommand{\subsection}{@startsection {subsection}% % the name {2} % the leve2 {0cm} % the indent {1.0cm} % the beforeskip {0.01cm} %{0.5cm} % the afterskip {\normalfont\normalsize\bfseries} } % the style \makeatother %-------------------------------------------------------------- % Commands to change horizontal space in section and subsection % for times romans \renewcommand{\thesection} % space between sect. etc. {\thechapter.\arabic{section}\hspace{.12in}} \renewcommand{\thesubsection} {\thesection\hspace{-.3cm}.\arabic{subsection} \hspace{-.135cm}} %-------------------------------------------------------------- % Commands for TocLoFT \usepackage{tocloft} %\cftsetrmarg{2.75cm} %
\cftsetrmarg{1.5cm} %
\cftsetpnumwidth{1.25cm} %\cftsetpnumwidth{1.25cm} \renewcommand{\cftdot}{} % get rid of dots %Table of Contents \renewcommand{\contentsname}{} % off tocname
\renewcommand{\cftchapfont}{\bfseries} \renewcommand{\cftchappagefont}{\normalfont\bfseries} \renewcommand{\cftchappresnum}{\hspace{0.3cm}CHAPTER } %\setlength{\cftchapindent}{.8cm} % chapter indent \setlength{\cftsecindent}{2.3cm} % section indent \setlength{\cftsubsecindent}{3.25cm} % subsection indent \setlength{\cftchapnumwidth}{3.25cm} % chp number width %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \renewcommand{\cftchapafterpnum}{\rule{1.75ex}{0ex}} % \renewcommand{\cftsecafterpnum}{\rule{1.75ex}{0ex}} % \renewcommand{\cftsubsecafterpnum}{\rule{1.75ex}{0ex}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% \renewcommand{\cftchapafterpnum}{\rule{0.75ex}{0ex}} \renewcommand{\cftsecafterpnum}{\rule{0.75ex}{0ex}} \renewcommand{\cftsubsecafterpnum}{\rule{0.75ex}{0ex}} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % \renewcommand{\cftchappagefont}{\normalfont} %-------------------------------------------------------------
%List of Table \setlength{\cfttabnumwidth}{2.5cm} %\setlength{\cfttabnumwidth}{2.5cm}
\renewcommand{\listtablename}{} % off lotname %\setlength{\cfttabindent}{-.015cm} % table indent %%%%%%%%%%%%%%%%%% \setlength{\cfttabindent}{-.1cm} % table indent %%%%%%%%%%%%%%%%%% \renewcommand{\cfttabpresnum}{Table } \renewcommand{\cfttabafterpnum}{\rule{2ex}{0ex}} \cftsetrmarg{3cm} %------------------------------------------------------------ %List of Figure \setlength{\cftfignumwidth}{2.5cm} \renewcommand{\listfigurename}{} % off lofname \setlength{\cftfigindent}{-.1cm} % figure indent %%%%%%%%%%%%%%%%%% \renewcommand{\cftfigpresnum}{Figure } \renewcommand{\cftfigafterpnum}{\rule{2ex}{0ex}} %------------------------------------------------------------- %------------------------------------------------------------- % Command for bold caption \makeatletter \long\def@makecaption#1#2{\vskip 10\p@ % caption parameter \setbox@tempboxa\hbox{{ #1,,,,,} #2} %%%%% \ifdim \wd@tempboxa >\hsize % caption parameter {#1,,,,,} #2\par % caption parameter \else % caption parameter \hbox to\hsize{\hfil\box@tempboxa\hfil} % caption parameter \fi} % caption parameter \makeatother
\renewcommand{\thefigure}{\arabic{chapter}.\arabic{figure}} \renewcommand{\thetable}{\arabic{chapter}.\arabic{table}} %-------------------------------------------------------------- \usepackage{paralist} %refine list item %-------------------------------------------------------------- \usepackage{latexsym,amsmath,amssymb} % math symbols %-------------------------------------------------------------- \usepackage{graphicx} % .eps graphic %-------------------------------------------------------------- \usepackage{pdflscape} % for landscape %-------------------------------------------------------------- \usepackage{times} %-------------------------------------------------------------- % Theorem-Like-Environment \usepackage{theorem} {\theorembodyfont{\upshape} \newtheorem{lemma}{Lemma}[chapter] \newtheorem{theorem}{\rule{0ex}{5ex}Theorem}[chapter] \newtheorem{corollary}{Corollary}[chapter] \newtheorem{proposition}{Proposition}[chapter] \newtheorem{definition}{\rule{0ex}{5ex}Definition}[chapter] \newtheorem{example}{Example}[chapter] } %-------------------------------------------------------- \newenvironment{proof}{\begin{paragraph} {Proof}\vspace{-1cm}}{\end{paragraph}} \newenvironment{solution}{\begin{paragraph} {Solution}\vspace{-1cm}}{\end{paragraph}}

and the CompleteGraph.tex file is just simple as follows.

\begin{landscape}
$COM\rightarrow$ a set of combinations of $\textrm{C}^{n}_{m}$\\

$(x_0\textrm{ }x_1\textrm{ }\cdots\textrm{ }x_m)\in COM$ such $x_i=0,1,2,...,n-1$ for $i=0,1,2,...,m$\

$\delta_j\rightarrow$ difference between two consecutive $x_i$\

$\Delta(\delta_1\textrm{ }\delta_2\textrm{ }\cdots\textrm{ }\delta_{m-1})\rightarrow$ collection/sequence of differences $\delta_j$ for $j=1,2,...,m-1$ \end{landscape}

MNSAR
  • 25
  • 1
    Hello, and welcome to TeX.SE --- could you share an MWE (Minimal Working Example) that we can use to reproduce and investigate your problem? – chsk Apr 11 '21 at 08:04
  • Hi @chsk, I added the working example but I cannot make it simple since I am worried that there is any other part that effecting the landscape mode. I hope that you can help to to find the best solution for this problem. – MNSAR Apr 11 '21 at 08:21
  • 1
    Please preapare a compilable minimal working example (MWE) that allows other to preproduce the output you get. The text (part of an equation?) that we can see in the screenshot of the output you show is nowhere to be found in your example code. It would also be really helpful if you could shorten your code by removing everything that is not related to the issue. – leandriis Apr 11 '21 at 10:03
  • Since you use the doublespace package inside of your try.sty package, please be aware that doublespace is considered obsolete and should be replaced with setspace. (See also: https://ctan.org/pkg/doublespace) – leandriis Apr 11 '21 at 10:05
  • Dear all, I have edited the (MWE) for the main.tex file. However, I cannot edit the try.sty file since it is my institution's template for thesis writing. I just rename it here. To @leandriis, thank you so much for the information. Does it give any effect on the spacing if I change it to setspace package? – MNSAR Apr 11 '21 at 11:04
  • 1
    Thanks for significantly shortening your code. However, I still can't reproduce the output you get. (Neither with the original version, nor with the shortened version of your code). I always get the expected output. – leandriis Apr 11 '21 at 11:18
  • I think there something wrong with the current file. I have tried to copy and paste the work into a new .tex file and saved it into a new directory, then the landscape mode works properly. I don't know what is happening with the previous version (maybe the other previous generated files do affect the works after that), if you guys know and can give an explanation about that, it will be very helpful. – MNSAR Apr 11 '21 at 11:38

0 Answers0