调整书籍文档类的边距

调整书籍文档类的边距

我以前用过这个

\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}

调整我的论文的边距,不幸的是,我得到的边距如下图所示

在此处输入图片描述

如何像上面的代码一样调整文档的边距?顺便说一句,我也尝试过使用这个\usepackage[hmargin=3.5cm,vmargin=2.5cm]{geometry}

答案1

太期待评论了...

我无法测试您的文档示例,因为它包含一些错误,但是,如果我使用您的页面布局设置,并添加showframe我可以看到您的页面布局的包,我会得到预期的正确结果:

在此处输入图片描述

产生上述图像的 MWE 是:

\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}

您如何测量显示边框数据?显示的数据显然是错误的(如果它们来自 Shoed 页面布局设置)。

尝试将文档的某些部分扩展到 MWE 宽度以上,此时只使用必要的包。

当您从文档示例中删除代码中的错误时,可能会提供更多帮助。

附录:
关于您的评论和主张,页面边框与包中的设置无关,geometry始终相同......

请对以下 MWE 进行一些基本的/粗略的检查,了解 A$ 页面上的文本块的大小:

\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}

结果是:

在此处输入图片描述

因此,geometry包装中的设置与宣传的一样。在上述文件中,左右边框等于 35 毫米,顶部和底部等于 25 毫米。

抱歉,不清楚您如何测量文本边框大小以及您的问题到底是什么。您对我的 MWE 的主张不成立。

我无法说出您的文档中发生了什么,因为提供的示例不可编译,因此无法测试。乍一看似乎没有在其中更改页面布局,但我对此不太确定。

相关内容