0

I used to use this

\documentclass[a4paper, 12pt, oneside, openany]{book}
\usepackage{setspace}
\onehalfspacing
\usepackage{geometry}
\geometry{
   paperwidth=210mm, paperheight=297mm,
   left=35mm, right=35mm, top=25mm, bottom=25mm
}
\parskip=12pt
\parindent=0pt
\usepackage{float}
\usepackage{datetime}
\newdateformat{monthyeardate}{%
  \monthname[\THEMONTH], \THEYEAR}
\usepackage{appendix}
%\usepackage{tabularx}
\usepackage{tabularray}
\UseTblrLibrary{booktabs, siunitx}
\usepackage{ makecell}

%LONG TABLE FEATURES
\DefTblrTemplate{contfoot-text}{normal}{} \SetTblrTemplate{contfoot-text}{normal} 
%%%%%%%%%%%% CAPTION %%%%%%%%%%%%%%%%%
\usepackage{caption}
\captionsetup{labelfont=bf}
\RequirePackage[labelfont=bf, labelsep=space]{caption}

\usepackage[justification=centering]{caption}
\NewTblrTheme{captionof}%   % <---
{\DefTblrTemplate{caption}{default}%
    {\addtocounter{table}{-1}%
     \captionof{table}{\InsertTblrText{caption}}%
    }
 \DefTblrTemplate{capcont}{default}%
    {\addtocounter{table}{-1}%
     \captionof{table}{\InsertTblrText{caption} "continue..."}
    }%
}
%%%%%%%%%%%%%%%
\usepackage{adjustbox}
\usepackage{longtable}
\usepackage[utf8]{inputenc}
\usepackage[T1]{fontenc}
\usepackage{amsmath}
\usepackage{mathptmx}
\usepackage{mathtools}
\usepackage{subcaption}
\usepackage{graphicx}

\usepackage{hyperref}

%\geometry{margin=2cm}
\usepackage{fancyhdr}
\fancyhf{}
\cfoot{\thepage}
\renewcommand{\headrulewidth}{0pt}
\setcounter{secnumdepth}{4}
\pagestyle{plain}
\usepackage{emptypage}

\renewcommand{\chaptername}{}
\usepackage{titlesec} 
\titleformat{\chapter}[display]
  {\bfseries\Large}
  {\chaptername~\filleft\bfseries\fontsize{30}{00}\selectfont\thechapter}
  {14pt}
  {\vspace{-2em}\filleft\Large}
  [\vspace{0.5em}\titlerule]

\titleformat{\section}
  {\bfseries\large}
  {\thesection}{1em}{}[\vspace{-1.5em}]

\titleformat{\subsection}
  {\bfseries\normalsize}
  {\thesubsection}{1em}{}[\vspace{-1.5em}]

\titleformat{\subsubsection}
  {\bfseries\normalsize}
  {\thesubsubsection}{1em}{}[\vspace{-1.5em}]

\graphicspath{figure/}
\usepackage{array}
\renewcommand*{\arraystretch}{0.6}
\usepackage[nottoc]{tocbibind}
\usepackage{glossaries}
\usepackage{enumitem}
\usepackage{multirow}
\usepackage{ragged2e}
\usepackage{blindtext}
\renewcommand{\bibname}{REFERENCES}
\usepackage{setspace}
\usepackage{titlesec}
\newcommand*{\justifyheading}{\raggedleft}


\include{dedication}
\pagenumbering{roman}
\usepackage{marginnote}
\renewcommand*\contentsname{\null\hfill {TABLE OF CONTENTS}} 
\usepackage{tocbibind}

%\renewcommand\thechapter{\arabic{chapter}}
\let\oldaddcontentsline\addcontentsline
\newcommand{\ADDCONTENTSLINE}[3]{%
  \oldaddcontentsline{#1}{#2}{\MakeUppercase{#3}}%
}
\newcommand{\CAPinToC}{\let\addcontentsline\ADDCONTENTSLINE}
\newcommand{\noCAPinToC}{\let\addcontentsline\oldaddcontentsline}
\let\cleardoublepage=\clearpage %remove blank page

\usepackage{nomencl}%%%% LIST OF SYMBOLS
\makenomenclature
\begin{document}

\maketitle

\chapter{INTRODUCTION}
\section{section one} the text starts from here. 
\section{section tow} the text starts from here.
\section{section three} the text starts from here.
\chapter{OVERVIEW}
\section{section one} the text starts from here. 
\section{section tow} the text starts from here.
\section{section three} the text starts from here.
\end{document}

to adjust the margins of my thesis, unfortunately, the margins I got are as shown

enter image description here

How can I adjust the margins of my document as shown in the code above? By the way, I tried to use this one too \usepackage[hmargin=3.5cm,vmargin=2.5cm]{geometry}

15
  • 1
    Please make your code compilable (if possible), or at least complete it with \documentclass{...}, the required \usepackage's, \begin{document}, and \end{document}. That may seem tedious to you, but think of the extra work it represents for the users willing to give you a hand. Help them help you: remove that one hurdle between you and a solution to your problem. Nov 27, 2023 at 17:06
  • Actually, it is not tedious but it is long code this is what can I share with you I edited the above code
    – b.als
    Nov 27, 2023 at 17:14
  • I get 35 mm horizontal margins with your code. How do you measure the margins? Nov 27, 2023 at 17:24
  • 1
    Maybe what you mean are the printer's settings which, however, have nothing to do with the margins of the text as set by (La)TeX. Nov 27, 2023 at 18:56
  • 1
    Tell them to take a ruler and measure! Nov 27, 2023 at 19:04

1 Answer 1

0

To long for the comment ...

I can't test your document example since it contain some errors, but, if I use your page layout settings, and add showframe package that I can see your page layout, I get expected correct result:

enter image description here

MWE which produce above image is:

\documentclass[a4paper, 12pt, oneside, openany]{book}
\usepackage[hmargin=35mm, vmargin=25mm]{geometry}
%--------------- show page layout. don't use in a real document!
\usepackage{showframe}
\renewcommand\ShowFrameLinethickness{0.15pt}
\renewcommand*\ShowFrameColor{\color{red}}
%
\usepackage{lipsum}                              % for dummy text
%---------------------------------------------------------------%

\begin{document}
\lipsum[1-3]
\end{document}

How do you measure showed borders data? Showed data apparently are wrong (if they are from Shoed page layout settings).

Try extend above MWE width some part of your document and at this use only necessary packages.

More help is possible to give when from your document example will be removed errors in code.

Addendum:
Regarding your comments and claims, that page borders are independent to settings in geometry package always the same ...

Please check the following MWE with a bit elementary/rude check about size of text block on A$ page:

\documentclass[a4paper, 12pt, oneside, openany]{book}
\usepackage[hmargin=35mm, vmargin=25mm]{geometry}
\usepackage{xurl}
\setlength\parindent{0pt}

\begin{document}
From
\url{https://latexref.xyz/Units-of-length.html#:~:text=The%20(approximate)%20conversion%20to%20metric,035146cm.}
follows 

\medskip
1 Point, 1/72.27 inch. The (approximate) conversion to metric units is 1point = .35146mm = .035146cm.


\bigskip 
\textbf{width and height of text area on A4 page are:}

\medskip
\verb+\textwidth+ = \the\textwidth (points) is approx. 140mm (210mm - 2*35mm)

\verb+\textheight+ = \the\textheight (points) is approx. 247mm (297mm - 2*25mm)
\end{document}

Result is:

enter image description here

So, settings in geometry package works as is advertised. In the above document are left and right borders equal to 35mm, top and bottom are equal to 25mm.

Sorry, it is unclear, how you measure text border sizes and what is actually your problem. Your claims for my MWE doesn't holds.

What is going on in your document I can't say, since provided example is not compilable and hence can't be tested. On the first sight is not seems, that in it you change page layout, but I'm not sure about this.

10
  • I will try yours and let you know
    – b.als
    Nov 27, 2023 at 17:40
  • It's the same, there are no differences.
    – b.als
    Nov 27, 2023 at 18:11
  • 1
    No, it is not. See image in my answer! left/right borders are 35mm wide, and top/bottom 25mm. It is not clear how you measures their length. Show us a proof for your claims!
    – Zarko
    Nov 27, 2023 at 18:15
  • When I downloaded my PDF file, I looked at the page setup properties. The borders as shown in the figure I posted in my question. Was what I did wrong?
    – b.als
    Nov 27, 2023 at 18:21
  • 1
    I doubt about your method, Just print the page generated by my MWE and than measure borders by rule.
    – Zarko
    Nov 27, 2023 at 19:31

You must log in to answer this question.

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