1

I am currently writing an edited book chapter by using my institution template. The following is what I am currently working on.

\documentclass[12pt,letterpaper]{book}
\usepackage{bookchapters}
     \usepackage{cite}          
     \begin{document}
         \frontmatter
         \mainmatter
             \input{MNSAR.tex}   
         \backmatter
             \cleardoublepage %index odd numbered page
             \printindex %
\end{document}

where \MNSAR.tex contains normal chapters and sections. Meanwhile, the bookchapters package is as follows.

% For layout
  \setlength{\headheight}{5.5pc}         
  \setlength{\footskip}{1cm}            
  \setlength{\hoffset}{1cm}               
  \setlength{\oddsidemargin}{.75in}      
  \setlength{\evensidemargin}{.75in}    
  \setlength{\voffset}{-.3in}           
  \setlength{\topmargin}{-.15in}         
  \setlength{\headsep}{.55cm}            
  \setlength{\paperwidth}{6in}         
  \setlength{\paperheight}{9in}          
  \setlength{\textwidth}{4.5in}         
  \setlength{\textheight}{7in}           
  \setlength{\marginparwidth}{-.3cm}
%--------------------------------------------------------------     
% To get rid of default running head
  \pagestyle{myheadings}
%---------------------------------------------------------
% For no page number for first page of a chapter 
  \makeatletter
    \renewcommand{\ps@plain}{                         
    \renewcommand{\@oddhead}{} 
    \renewcommand{\@evenhead}{}          
    \renewcommand{\@evenfoot}{}                
    \renewcommand{\@oddfoot}{}  }               
  \makeatother
%---------------------------------------------------------
% For section font
  \usepackage{sectsty} 
    \sectionfont{\normalsize\uppercase}
    \subsectionfont{\normalsize}
    \subsubsectionfont{\itshape\normalsize}
%---------------------------------------------------------
% For no hyphentaion and right justified
   \hyphenpenalty=10000 \sloppy  
   \raggedbottom 
%---------------------------------------------------------
% For caption font size to be 11pt
  \makeatletter
   \long\def\@makecaption#1#2{\vskip 10\p@   
    \setbox\@tempboxa\hbox{{\bf\small #1\,\,\,} \small #2} 
       \ifdim \wd\@tempboxa >\hsize       
           {\bf\small #1\,\,\,} \small  #2\par   
       \else                                   
           \hbox to\hsize{\hfil\box\@tempboxa\hfil}  
       \fi}                                             
   \makeatother                               
%-------------------------------------------------------------
% To change 1. to (i) etc. in enumerate environment
  \renewcommand{\theenumi}{\textup{(\roman{enumi})}}
  \renewcommand{\labelenumi}{\theenumi}
%--------------------------------------------------------------    
% Coding for BookChapterHeader
\makeatletter
\def\@makechapterhead#1{%
 \vspace*{-27\p@} 
  {\parindent \z@ 
      \centering  
    \normalfont
    \ifnum \c@secnumdepth >\m@ne
      \if@mainmatter
      \huge 
         \bfseries 
          \@chapapp\space \thechapter 
       \par\nobreak
           \vskip .25\baselineskip 
      \fi
    \fi
    \interlinepenalty\@M
           \LARGE      
              \bfseries
 #1\par\nobreak 
\vskip 165\p@ 
  }}
\def\@schapter#1{\if@twocolumn
                   \@topnewpage[\@makeschapterhead{#1}]%
                 \else
                   \@makeschapterhead{#1}%
                   \@afterheading
                 \fi}
\def\@makeschapterhead#1{%
  {\parindent \z@
    \centering 
    \normalfont
    \interlinepenalty\@M
    \LARGE 
       \bfseries
 #1\par\nobreak  \vskip .25\baselineskip
    \vskip 217\p@        
  }}
\makeatother
\renewcommand{\chaptername}{}
%--------------------------------------------------------------   
  \usepackage{graphicx}   %for .eps file
%-------------------------------------------------------------
  \usepackage{latexsym,amsmath,amssymb} % math symbols
  \usepackage{makeidx}\makeindex  %for index 
%--------------------------------------------------------------
% BookChaptersTheoremEnvironment
  \usepackage{theorem}
  \newtheorem{theorem}{Theorem}[chapter]
  \newtheorem{lemma}{Lemma}[chapter]
  \newtheorem{corollary}{Corollary}[chapter]
  \newtheorem{proposition}{Proposition}[chapter]
   {\theorembodyfont{\upshape}
   \newtheorem{definition}{Definition}[chapter]
   \newtheorem{example}{Example}[chapter]}
  \newenvironment{proof}{\begin{paragraph}
          {Proof}}{\end{paragraph}}
%--------------------------------------------------------------
\usepackage[sectionbib]{chapterbib} % list of ref. end of chapter
%--------------------------------------------------------------
\renewcommand{\bibname}{REFERENCES}
%------------------------------------------------------------
\usepackage{times}        %text times roman
%----------------------------------------------------
 \usepackage[noframe]{crop} 
%----------------------------------------------------

However, when I try to typeset the above coding, I get the results as in the following figure.

enter image description here

I am aware that it is related to what type of output did I set. I am using Texstudio as my editor and it has an internal PDF viewer. Also, if I typeset them in PCTex, as DVI output, the results are shown properly. How can I typeset them in Texstudio and let the results be as PDF not DVI? I don't want to use PCTex since they do not update their software since years ago.

Added: Dear @Simon Dispa, here I attached two figures as your reference for my request. The first figure is the output by using your coding and the second figure is the output that I would like to achieve. Thank you.

enter image description here

and

enter image description here

4
  • I believe that the problem is in setting \hoffset and \voffset to nonzero values.
    – egreg
    Apr 7, 2021 at 7:47
  • (1) Run the two files I posted: MAIN.tex with bookchapters.sty (not bookchapters.tex) in the same (but new) directory. If you get errors: (2) Add \listfiles before \documentclass[12pt, oneside]{book} (3) Check at the end of the log file. You should find crop.sty 2017/11/19 1.10 crop marks (mf). If not, update your system. Before you were using \usepackage[noframe]{crop} which is not a valid option for crop! Not even in a old 2003 version. Apr 7, 2021 at 15:15
  • Please the updated answer Apr 8, 2021 at 21:20
  • Unrelated to your problem, you might want to use a clone of Times with math support. This could be \usepackage{newtxtext, newtxmath} in PDFLaTeX, and \usepackage{unicode-math} \setmainfont{TeX Gyre Termes} \setmathfont{TeX Gyre Termes Math} in LuaLaTeX or XeLaTeX.
    – Davislor
    Apr 8, 2021 at 22:27

1 Answer 1

0

Assuming that you wanted to print a 6x9in book using a letter paper size I added the package geometry with this setup (and with the option showframe) and also modified the settings of the package crop.

a

This is the code of File-Name.tex

\documentclass[12pt, oneside]{book}
\usepackage{bookchapters}
\usepackage{cite}  

\usepackage{kantlipsum}    % added <<< 
   
\begin{document}
    \frontmatter
    \mainmatter
\chapter[Numerical Solution]{Numerical Solution of the Acoustic Wave Equation}

\section{INTRODUCTION}
1. \kant[1-9]

    \backmatter
    \cleardoublepage %index odd numbered page
%   \printindex %
\end{document}

And this is the modified bookchapters.sty (lines maked as % changed or % added)

%%----------------------------------------------------bookchapters starts
%% For layout
\usepackage[papersize={6in,9in},left=0.75in,top=0.2in,margin=0.75in, includehead,includefoot,showframe]{geometry} % added <<<

\setlength{\headheight}{1cm}      % changed   
\setlength{\footskip}{1cm}   % changed
\setlength{\textwidth}{4.5in}         
\setlength{\textheight}{7in}           
\setlength{\marginparwidth}{0cm} % changed
\setlength{\marginparsep}{0cm}% changed

\usepackage[cam,letter,center]{crop} % changed
%%--------------------------------------------------------------     
% To get rid of default running head
\pagestyle{myheadings}
%---------------------------------------------------------
% For no page number for first page of a chapter 
\makeatletter
\renewcommand{\ps@plain}{                         
    \renewcommand{\@oddhead}{} 
    \renewcommand{\@evenhead}{}          
    \renewcommand{\@evenfoot}{}                
    \renewcommand{\@oddfoot}{}  }               
\makeatother
%---------------------------------------------------------
% For section font
\usepackage{sectsty} 
\sectionfont{\normalsize\uppercase}
\subsectionfont{\normalsize}
\subsubsectionfont{\itshape\normalsize}
%---------------------------------------------------------
% For no hyphentaion and right justified
\hyphenpenalty=10000 \sloppy  
\raggedbottom 
%---------------------------------------------------------
% For caption font size to be 11pt
\makeatletter
\long\def\@makecaption#1#2{\vskip 10\p@   
    \setbox\@tempboxa\hbox{{\bf\small #1\,\,\,} \small #2} 
    \ifdim \wd\@tempboxa >\hsize       
    {\bf\small #1\,\,\,} \small  #2\par   
    \else                                   
    \hbox to\hsize{\hfil\box\@tempboxa\hfil}  
    \fi}                                             
\makeatother                               
%-------------------------------------------------------------
% To change 1. to (i) etc. in enumerate environment
\renewcommand{\theenumi}{\textup{(\roman{enumi})}}
\renewcommand{\labelenumi}{\theenumi}
%--------------------------------------------------------------    
% Coding for BookChapterHeader
\makeatletter
\def\@makechapterhead#1{%
    \vspace*{-27\p@} 
    {\parindent \z@ 
        \centering  
        \normalfont
        \ifnum \c@secnumdepth >\m@ne
        \if@mainmatter
        \huge 
        \bfseries 
        \@chapapp\space \thechapter 
        \par\nobreak
        \vskip .25\baselineskip 
        \fi
        \fi
        \interlinepenalty\@M
        \LARGE      
        \bfseries
        #1\par\nobreak 
        \vskip 165\p@ 
}}
\def\@schapter#1{\if@twocolumn
    \@topnewpage[\@makeschapterhead{#1}]%
    \else
    \@makeschapterhead{#1}%
    \@afterheading
    \fi}
\def\@makeschapterhead#1{%
    {\parindent \z@
        \centering 
        \normalfont
        \interlinepenalty\@M
        \LARGE 
        \bfseries
        #1\par\nobreak  \vskip .25\baselineskip
        \vskip 217\p@        
}}
\makeatother
\renewcommand{\chaptername}{}
%--------------------------------------------------------------   
\usepackage{graphicx}   %for .eps file
%-------------------------------------------------------------
\usepackage{latexsym,amsmath,amssymb} % math symbols
\usepackage{makeidx}\makeindex  %for index 
%--------------------------------------------------------------
% BookChaptersTheoremEnvironment
\usepackage{theorem}
\newtheorem{theorem}{Theorem}[chapter]
\newtheorem{lemma}{Lemma}[chapter]
\newtheorem{corollary}{Corollary}[chapter]
\newtheorem{proposition}{Proposition}[chapter]
{\theorembodyfont{\upshape}
    \newtheorem{definition}{Definition}[chapter]
    \newtheorem{example}{Example}[chapter]}
\newenvironment{proof}{\begin{paragraph}
        {Proof}}{\end{paragraph}}
%--------------------------------------------------------------
\usepackage[sectionbib]{chapterbib} % list of ref. end of chapter
%--------------------------------------------------------------
\renewcommand{\bibname}{REFERENCES}
%------------------------------------------------------------
\usepackage{times}        %text times roman
%%----------------------------------------------------bookchapters ends

If you want to have the section titles in bold face, comment the section %Coding for BookChapterHeader and \usepackage{times} in bookchapters.sty, then add \chapterfont{\centering \bfseries} at the end.

b

UPDATE crop output closer to the institution template c

Add the file crop.cfg to the working directory.

%% file crop.cfg (to be placed in the working directory)

\renewcommand*\CROP@@ulc{%
    \begin{picture}(0,0)
        \unitlength\p@\thinlines
        \put(-35,0){\line(1,0){30}}
        \put(0,35){\line(0,-1){30}}
    \end{picture}%
}
\renewcommand*\CROP@@urc{%
    \begin{picture}(0,0)
        \unitlength\p@\thinlines
        \put(35,0){\line(-1,0){30}}
        \put(0,35){\line(0,-1){30}}
    \end{picture}%
}
\renewcommand*\CROP@@llc{%
    \begin{picture}(0,0)
        \unitlength\p@\thinlines
        \put(-35,0){\line(1,0){30}}
        \put(80,-20){\itshape Paper width:\,\the\paperwidth}  % adjust h-v position
        \put(240,-20){\itshape Paper height:\,\the\paperheight} % adjust h-v position
        \put(0,-35){\line(0,1){30}}
    \end{picture}%
}
\renewcommand*\CROP@@lrc{%
    \begin{picture}(0,0)
        \unitlength\p@\thinlines
        \put(35,0){\line(-1,0){30}}
        \put(0,-35){\line(0,1){30}}
    \end{picture}%
}

\renewcommand*\CROP@@info{{%
        \global\advance\CROP@index\@ne
        \def\x{\discretionary{}{}{\hbox{\kern.5em---\kern.5em}}}%
        \advance\paperwidth-20\p@
        \dimen@4pt
        \ifx\CROP@pagecolor\@empty
        \else
        \advance\dimen@\CROP@overlap
        \fi
        \hb@xt@\z@{%
            \hss
            \vbox to\z@{%
                \centering
                \hsize\paperwidth
                \vss
                \itshape
                \normalsize
                \expandafter\csname\CROP@font\endcsname{%
                    Job:\kern.4em \jobname\kern10em
                    Sheet:\kern.3em\the\CROP@index\kern1em
                    Page:\kern.3em\thepage      
                    \strut
                }%          
                \vskip\dimen@       
            }%  
            \hss        
        }%
}}

\endinput
5
  • I am adding your changes and it seems that I have a problem with the crop package. It says that - Unknown option 'cam' for package 'crop'. It also the same for the 'letter' and 'center' for the crop package. What should I do? And what is the problem with the crop package?
    – MNSAR
    Apr 7, 2021 at 14:50
  • @Syiham Razak (1) Run the two files I posted: MAIN.tex with bookchapters.sty (not bookchapters.tex) in the same (but new) directory. If you get errors: (2) Add \listfiles before \documentclass[12pt, oneside]{book} (3) Check at the end of the log file. You should find crop.sty 2017/11/19 1.10 crop marks (mf). If not, update your system. Before you were using \usepackage[noframe]{crop} which is not a valid option for crop! Not even in a old 2003 version. Apr 7, 2021 at 15:23
  • Dear @Simon Dispa, thank you so much as it works perfectly. However, is it possible if I ask for your help one more time? I want that the output be the same as my institution template, where there is no circled plus symbol (I don't know what to call them) at the corner of the page. Also, I want the info for the top part shown as "Job: File Name Sheet: No of Page Page: No of Page" and the info for the bottom part shown as "Paper width: 433.62pt Paper height: 650.43pt". I have added two figures in my original post for reference. I am looking forward to your help. Thank you.
    – MNSAR
    Apr 8, 2021 at 18:19
  • @Syiham Razak I updated the answer. Glad that the former answer finally worked. Thank you for your feedback!! Apr 8, 2021 at 21:31
  • Dear @Simon Dispa, the added .cfg file also does work properly. Thank you again for your help.
    – MNSAR
    Apr 9, 2021 at 12:01

You must log in to answer this question.

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