Latex 页面大小不起作用(几何、vmargin)

Latex 页面大小不起作用(几何、vmargin)

我使用的是 latex 模板,出于某种原因,它是 A4 而不是 letter。我尝试将 documentclass[] 设置为 letter、letterpaper \special{papersize=215.9mm,279.4mm}

\usepackage{geometry}
\geometry{letterpaper, landscape}

,但都没有任何帮助。

问题可能出在哪里?

这是我的hole .tex 文件。我怎样才能将其转换为信纸,因为目前它是A4。我正在用背面

编辑:如果我\geometry{letterpaper}在文档开始前添加,我会得到字母大小,但一切都会扭曲。所以我想包中的一个使用 a4...

% \documentclass[letterpaper,12pt,TexShade,oneside]{book} 
\documentclass[letterpaper,pagesize,12pt,TexShade,oneside]{book} 
\special{papersize=215.9mm,279.4mm}
\RequirePackage{fix-cm}
\usepackage{etex}
\usepackage{epsfig}
\usepackage{amsmath}
\usepackage{etex}
\usepackage{epsfig}
\usepackage{amsmath}
%\usepackage{subfigure}
\usepackage[landscape]{geometry}
\usepackage{lscape}
\usepackage[pdfa,colorlinks=true,urlcolor=black]{hyperref}
\usepackage{tabularx}
\usepackage{mathabx}
\usepackage{multirow}
\usepackage{moreverb}
\usepackage{multicol}
\usepackage{alltt}
\usepackage{setspace}
\usepackage{multirow}
\usepackage{lscape}
\usepackage[all]{xy}
\usepackage{color}
\usepackage{makeidx}
\usepackage{fancyvrb}
\usepackage{inputenc}
\usepackage{dsfont}
\usepackage{moreverb}
\usepackage{array}
\usepackage{supertabular}
\usepackage{hhline}
\usepackage{rotating}
\hypersetup{colorlinks=true, linkcolor=Brown, citecolor=Brown, filecolor=Brown, urlcolor=Brown}
\usepackage{epsfig}
\usepackage{calc}
\usepackage{listings}
\usepackage[T1]{fontenc}
\usepackage{bm}
% \usepackage{amsthm}
\usepackage{theorem}
\usepackage{times,epsfig}
\usepackage{calc}
\usepackage{moresize}
%\usepackage[ruled]{algorithm2e}
\usepackage[caption=false]{subfig}
\usepackage{url}
\usepackage{multirow}
\usepackage[bf,rm,medium,compact]{titlesec}
\usepackage{times}  
\usepackage{pifont}     % to include symbols from different fonts (e.g.  \rtm)
\usepackage{eurosym}    % for the euro symbol, package by Henrik Theiling
\usepackage{amstext}    % AMS for e.g. \text{}
\usepackage{graphicx}
\usepackage{booktabs}   % tables as required by journals
\usepackage{fancyhdr}                % fancy page headers/footers
\usepackage{vmargin}    % for \setmarginsrb                                      
\usepackage{xspace}
\usepackage{xcolor}
\usepackage{algorithm2e}
\usepackage{latex-pkg/postscript} % HV's elaboration of epsf
\usepackage[nolineno]{latex-pkg/lgrind}     % for typesetting MSL, Gentle, C, C++, ... code
\usepackage[grey]{latex-pkg/quotchap}
\usepackage{latex-pkg/TexShade}
%\usepackage[ruled]{algorithm2e}
\usepackage[caption=false]{subfig}
\usepackage{url}
\usepackage{multirow}
\usepackage[bf,rm,medium,compact]{titlesec} % nice section titles
\usepackage{pifont}     % to include symbols from different fonts (e.g.  \rtm)
\usepackage{eurosym}    % for the euro symbol, package by Henrik Theiling
\usepackage{amstext}    % AMS for e.g. \text{}
\usepackage{booktabs}   % tables as required by journals
\usepackage{fancyhdr}                % fancy page headers/footers
\usepackage{vmargin}    % for \setmarginsrb                                      
\usepackage{latex-pkg/postscript} % HV's elaboration of epsf
\usepackage[nolineno]{latex-pkg/lgrind}     % for typesetting MSL, Gentle, C, C++, ... code
\usepackage[grey]{latex-pkg/quotchap}
\usepackage{latex-pkg/TexShade}
\usepackage{longtable}
\usepackage{ltcaption}

\usepackage[toc,page]{appendix}
\usepackage[pagewise]{lineno} % line numbering per page

\usepackage{textcomp} % registered and copyright symbol

% The ltcaption package supports \CaptionLabelFont & \CaptionTextFont
% introduced by the NTG document classes
\renewcommand\CaptionLabelFont{\normalsize}
\renewcommand\CaptionTextFont{\normalsize}

%
%  Brown  Maroon  NavyBlue  MidnightBlue  
%

% INCLUDE HVs CUSTOMIZATIONS
\input{latex-pkg/defaultcustom.tex}
% INCLUDE LATEX PACKAGES

\makeatletter
\newcommand\arraybslash{\let\\\@arraycr}
%\@addtoreset{chapter}{part}
\makeatother



\lstset{basicstyle=\normalsize\ttfamily,breaklines=true}
\lstset{framextopmargin=5pt,frame=bottomline}


%[latin1]
% INCLUDE LATEX PREAMBLE
% SETTINGS FOR listings PACKAGE
\lstset{
    numberstyle=\tiny,
    numbers=left,
    stepnumber=1,
    numbersep=5pt,
    tabsize=2,
    showstringspaces=false,
    aboveskip=\smallskipamount,
    belowskip=\smallskipamount,
    lineskip=-2pt
}

% PAGE COLOR and SETTINGSx
\pagecolor{white}

% \setlength{\headheight}{2cm}
% \setlength{\marginparwidth}{1.9cm}
% MAKE INDEX
\makeindex

% CUSTOM COMMANDS
\newcommand{\linka}[1]{{\tt\htmladdnormallink{#1}{#1}}}
\newcommand{\linkb}[2]{{\tt\htmladdnormallink{#1}{#2}}}
\newcommand{\parcomment}[1]{\marginpar{\scriptsize{\textcolor{blue}{#1}}}}
\newcommand{\defn}[2]{{\begin{minipage}{\textwidth}\vspace{2pt}\emph{\textbf{#1}}:\vspace{1pt}\begin{center}\fbox{\begin{minipage}{5.5in}#2\end{minipage}}\end{center}\vspace{2pt}\end{minipage}}}

% lgrind FONTS
\def\BGfont{\small\tt}
\def\CMfont{\small\tt}
\def\NOfont{\small\tt}
\def\KWfont{\small\tt}
\def\STfont{\small\tt}
\def\TTfont{\small\tt}
\def\VRfont{\small\tt}

% KZ definitions
\input{content/thesisparams.tex}

% DOCUMENT BEGINS
\begin{document}


\pagestyle{empty} %defines the general contents of the headers and footers (e.g. where the page number will be printed)

%%%%%%%%%%%%%%%%%%%
%
% TITLE PAGE
%
%%%%%%%%%%%%%%%%%%%
\begin{onehalfspacing}
\input{content/FirstPage.tex}
\cleardoublepage
\end{onehalfspacing}


%%%%%%%%%%%%%%%%%%%
%
% SPACING
%
%%%%%%%%%%%%%%%%%%%
%
% \singlespacing
% \doublespacing
% \onehalfspacing 
%
% \setstretch{1.8}
%

\onehalfspacing 

% \doublespacing

% ROMAN PAGE NUMBERING
\pagenumbering{roman}
\pagestyle{plain}

\begin{Large}
\end{Large}

%%%%%%%%%%%%%%%%%%%
%
% ABSTRACT
%
%%%%%%%%%%%%%%%%%%%

\input{content/en_Absract.tex}
\clearpage

%\bigskip \bigskip

\input{content/fr_Absract.tex}
\cleardoublepage

%%%%%%%%%%%%%%%%%%%
%
% ACKNOWLEDGEMENT
%
%%%%%%%%%%%%%%%%%%%
\input{content/contributions.tex}

\input{content/Acknowledgements.tex}
\cleardoublepage

%%%%%%%%%%%%%%%%%%%
%
%  Table Of Content
%  List Of Figures
%  List Of Tables
%
%%%%%%%%%%%%%%%%%%%

%\setstretch{0.0}
% \begin{singlespacing}
% \begin{spacing}{0.5}
% KZ WORKING BEFORE AUG 11 \setstretch{0.5}

\setstretch{0.7}

\tableofcontents
% \end{spacing}
\listoffigures
% \end{singlespacing}

\begin{onehalfspacing}

\listoftables

%\listofalgorithms

\end{onehalfspacing}

\cleardoublepage

%%%%%%%%%%%%%%%%%%%%
%
%  ABBREVIATIONS
%
%%%%%%%%%%%%%%%%%%%%
% \nomenclature{RC}{Read Committed}
% \nomenclature{SI}{Snapshot Isolation}
% \nomenclature{JOCC}{JPA Optimistic Concurrency Control}
% \nomenclature{\textsc{colAgent}}{Collector Agent}

% ARABIC PAGE NUMBERING
\pagenumbering{arabic}
\pagestyle{fancyplain}

% INCLUDE HVs DEFAULT FORMATTING
\input{latex-pkg/latexformat.tex}

\interfootnotelinepenalty=10000 %priority, to make sure the footnote is not dvided between pages.

\doublespacing


% ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%
% BEGIN_Chapters
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%


%%%%%%%%%%%%%%%%%%%%
% MTT
%%%%%%%%%%%%%%%%%%%%

\graphicspath{{img/}}


\begin{linenumbers}
    \chapter{\rm\bfseries Introduction}
    \label{ch:introduction}
    \input{base/intro/intro.tex}
    \chapter{Literature Review}
    \label{ch:chapterLitReview}
    \input{base/chapter/literatureReview.tex}
    \chapter{Background}
    \label{ch:background}
    \input{base/chapter/background.tex}
    \chapter{Body 1}
    \label{ch:body}
    \input{base/chapter/body.tex}
    \chapter{Body 2}
    \label{ch:system_architecture}
    \input{base/chapter/body2.tex}
    \chapter{Findings}
    \label{part:findings}
    \input{base/chapter/findings.tex}
    \chapter{Conclusion}
    \label{part:conclusion}
    \input{base/chapter/summary.tex}
\end{linenumbers}


\newpage

%%%%%%%%%%%%%%%%%%%
%
% BIBLIOGRAPHY
%
%%%%%%%%%%%%%%%%%%%


%\chapter*{\rm\bfseries Bibliography}
\chaptermark{{\rm\bfseries Bibliography}}
\addcontentsline{toc}{chapter}{Bibliography}

\bibliographystyle{IEEEtran}
%\bibliographystyle{alpha}
\bibliography{Thesis}

%\addcontentsline{toc}{chapter}{\numberline{}\rm\bfseries{Bibliography}}

\normalsize
\printindex

%%%%%%%%%%%%%%%%%%%
%
% APPENDICES
%
%%%%%%%%%%%%%%%%%%%

%\begin{appendix}
%\chapter{Tutorial, manual, and help}
%\label{part:tutorials}
%\input{base/chapter/appendix_tutorials.tex}
%\end{appendix}

% \input{content/ConsADExamples.tex}

\end{document}

答案1

您的模板很乱,包含许多很可能无用的包。

然而,问题在于同时加载geometryvmargin,它们在尝试设置分页参数时互相冲突。

后者,即vmargin,是有缺陷的,不应使用。

相关内容