![使用 LyX 和 Koma Script 时页面大小错误](https://linux22.com/image/274578/%E4%BD%BF%E7%94%A8%20LyX%20%E5%92%8C%20Koma%20Script%20%E6%97%B6%E9%A1%B5%E9%9D%A2%E5%A4%A7%E5%B0%8F%E9%94%99%E8%AF%AF.png)
首先,我是 Tex 的新手,所以请原谅我在此问题中未包括任何显而易见的内容。但重点是:
我正在使用 LyX 2.0.6(与 Miktex 2.9 一起使用)。我正在用波兰语写一篇论文。我使用 Koma Script 书籍类。我的论文以 Lyx 附带的示例论文为基础。每个章节都在不同的分支上,放在不同的文件中,然后将其包含在主文件中。
问题是:当我从“章节文件”创建 PDF 时,一切正常,但当我从主文件创建 PDF 时,页面大小明显变小(文本和页面边框之间的空间更大)。我的目标是 A4 纸张大小。
据我所知,单个章节的序言和整篇论文没有区别。
我尝试在文档类中指定纸张尺寸并使用几何包。但毫无效果。
我知道以上信息可能不足以提供帮助,因此如果缺少任何内容,请写下来,我会添加。
单章序言示例此处的纸张大小合适:
%% LyX 2.0.6 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[12pt,czech,greek,italian,polish,intoc,bibliography=totoc,index=totoc,BCOR10mm,captions=tableheading,titlepage,fleqn,pagesize,a4paper]{scrbook}
\usepackage{lmodern}
\renewcommand{\sfdefault}{lmss}
\renewcommand{\ttdefault}{lmtt}
\usepackage[LGR,T1]{fontenc}
\usepackage[iso-8859-7,latin9,latin2]{inputenc}
\usepackage{listings}
\lstset{captionpos=b,
frame=single}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setcounter{secnumdepth}{3}
\usepackage{amssymb}\usepackage{babel}
\usepackage{array}
\usepackage{float}
\usepackage{calc}
\usepackage{textcomp}
\usepackage{ifsym}
\usepackage{marvosym}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{setspace}
\onehalfspacing
\usepackage[unicode=true,
bookmarks=true,bookmarksnumbered=true,bookmarksopen=true,bookmarksopenlevel=1,
breaklinks=false,pdfborder={0 0 0},backref=false,colorlinks=false]
{hyperref}
\hypersetup{pdftitle={Your title},
pdfauthor={Your name},
pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false}
\usepackage{breakurl}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\DeclareRobustCommand{\greektext}{%
\fontencoding{LGR}\selectfont\def\encodingdefault{LGR}}
\DeclareRobustCommand{\textgreek}[1]{\leavevmode{\greektext #1}}
\DeclareFontEncoding{LGR}{}{}
\DeclareTextSymbol{\~}{LGR}{126}
%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
% in case somebody want to have the label "Equation"
%\renewcommand{\eqref}[1]{Equation~(\negthinspace\autoref{#1})}
% that links to image floats jumps to the beginning
% of the float and not to its caption
\usepackage[figure]{hypcap}
\usepackage[paper=A4,pagesize]{typearea}
% the pages of the TOC is numbered roman
% and a pdf-bookmark for the TOC is added
\let\myTOC\tableofcontents
\renewcommand\tableofcontents{%
\frontmatter
\pdfbookmark[1]{\contentsname}{}
\myTOC
\mainmatter }
%------------caption handling---------------------
\usepackage[font={it}]{caption}
\renewcommand{\fnum@lstlisting}{Przykład kodu~\thefigure}
\renewcommand{\fnum@figure}{Ilustracja~\thefigure}
% makes caption labels bold
% for more info about these settings, see
% http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguien.pdf
\setkomafont{captionlabel}{\bfseries}
\setcapindent{1em}
%--------------------------------------------------
% enables calculations
\usepackage{calc}
%indent for the first paragraph after a title
\usepackage{indentfirst}
%enables dingbat symbols
\usepackage{pifont}
%centruje zawarto¶ć tabeli w przypadku laczonych wierszy
%\renewcommand{\multirowsetup}{\centering}
% fancy page header/footer settings
% for more information see section 9 of
% ftp://www.ctan.org/pub/tex-archive/macros/latex2e/contrib/fancyhdr/fancyhdr.pdf
\renewcommand{\chaptermark}[1]{\markboth{#1}{#1}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
% increases the bottom float placement fraction
\renewcommand{\bottomfraction}{0.5}
% avoids that floats are placed above its sections
\let\mySection\section\renewcommand{\section}{\suppressfloats[t]\mySection}
\makeatother
\begin{document}
...
\end{document}
主文档,此处的纸张尺寸不合适:
%% LyX 2.0.6 created this file. For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[11pt,a4paper,czech,english,greek,italian,polish,intoc,bibliography=totoc,index=totoc,BCOR10mm,captions=tableheading,titlepage,fleqn,pagesize,a4paper]{scrbook}
\usepackage{lmodern}
\renewcommand{\sfdefault}{lmss}
\renewcommand{\ttdefault}{lmtt}
\usepackage[LGR,T1]{fontenc}
\usepackage[iso-8859-7,latin9,latin2]{inputenc}
\usepackage{listings}
\lstset{captionpos=b,
frame=single}
\usepackage{fancyhdr}
\pagestyle{fancy}
\setcounter{secnumdepth}{3}
\usepackage{amssymb}\usepackage{babel}
\usepackage{array}
\usepackage{float}
\usepackage{calc}
\usepackage{textcomp}
\usepackage{ifsym}
\usepackage{marvosym}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{setspace}
\usepackage{nomencl}
% the following is useful when we have the old nomencl.sty package
\providecommand{\printnomenclature}{\printglossary}
\providecommand{\makenomenclature}{\makeglossary}
\makenomenclature
\onehalfspacing
\usepackage[unicode=true,pdfusetitle,
bookmarks=true,bookmarksnumbered=true,bookmarksopen=true,bookmarksopenlevel=1,
breaklinks=false,pdfborder={0 0 0},backref=false,colorlinks=false]
{hyperref}
\hypersetup{
pdfpagelayout=OneColumn, pdfnewwindow=true, pdfstartview=XYZ, plainpages=false}
\usepackage{breakurl}
\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% LyX specific LaTeX commands.
\special{papersize=\the\paperwidth,\the\paperheight}
\DeclareRobustCommand{\greektext}{%
\fontencoding{LGR}\selectfont\def\encodingdefault{LGR}}
\DeclareRobustCommand{\textgreek}[1]{\leavevmode{\greektext #1}}
\DeclareFontEncoding{LGR}{}{}
\DeclareTextSymbol{\~}{LGR}{126}
%% Because html converters don't know tabularnewline
\providecommand{\tabularnewline}{\\}
\@ifundefined{date}{}{\date{}}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
% in case somebody want to have the label "Equation"
%\renewcommand{\eqref}[1]{Equation~(\negthinspace\autoref{#1})}
% that links to image floats jumps to the beginning
% of the float and not to its caption
\usepackage[figure]{hypcap}
\usepackage[pass]{geometry}
% the pages of the TOC is numbered roman
% and a pdf-bookmark for the TOC is added
\let\myTOC\tableofcontents
\renewcommand\tableofcontents{%
\frontmatter
\pdfbookmark[1]{\contentsname}{}
\myTOC
\mainmatter }
%------------caption handling---------------------
\usepackage[font={it}]{caption}
\renewcommand{\fnum@lstlisting}{Przykład kodu~\thefigure}
\renewcommand{\fnum@figure}{Ilustracja~\thefigure}
% makes caption labels bold
% for more info about these settings, see
% http://mirrors.ctan.org/macros/latex/contrib/koma-script/doc/scrguien.pdf
\setkomafont{captionlabel}{\bfseries}
\setcapindent{1em}
%--------------------------------------------------
% enables calculations
\usepackage{calc}
%indent for the first paragraph after a title
\usepackage{indentfirst}
%enables dingbat symbols
\usepackage{pifont}
%centruje zawarto¶ć tabeli w przypadku laczonych wierszy
%\renewcommand{\multirowsetup}{\centering}
% fancy page header/footer settings
% for more information see section 9 of
% ftp://www.ctan.org/pub/tex-archive/macros/latex2e/contrib/fancyhdr/fancyhdr.pdf
\renewcommand{\chaptermark}[1]{\markboth{#1}{#1}}
\renewcommand{\sectionmark}[1]{\markright{\thesection\ #1}}
% increases the bottom float placement fraction
\renewcommand{\bottomfraction}{0.5}
% avoids that floats are placed above its sections
\let\mySection\section\renewcommand{\section}{\suppressfloats[t]\mySection}
\makeatother
\begin{document}
\publishers{\noindent ...\\
...\\
...\\
\inputencoding{latin9}\foreignlanguage{english}{\vspace{-3cm}
}}
\author{...}
\title{...}
\begin{onehalfspace}
\lowertitleback{\noindent ...\\
...\\
...}
\end{onehalfspace}
\date{...}
\maketitle
\cleardoublepage{}
\lhead{\rightmark}
\rhead[\leftmark]{}
\lfoot[\thepage]{}
\cfoot{}
\rfoot[]{\thepage}
\tableofcontents{}
\cleardoublepage{}
\pagestyle{plain}
\include{Summary}
\cleardoublepage{}
\pagestyle{fancy}
\lhead[\chaptername~\thechapter]{\rightmark}
\include{chapter-1}
\include{chapter-2}
\include{chapter-3}
\include{chapter-4}
\cleardoublepage{}
\lhead[]{Acknowledgments}
\rhead[Acknowledgments]{}
\cleardoublepage{}
\lhead[]{\rightmark}
\rhead[\leftmark]{}
\bibliographystyle{alpha}
\bibliography{bibliography}
\cleardoublepage{}
\lhead[]{Nomenclature}
\rhead[Nomenclature]{}
\printnomenclature[2.5cm]{}
\end{document}
新增:将此内容添加到章节序言后:
\documentclass[11pt,a4paper,czech,english,greek,italian,polish,intoc,bibliography=totoc,index=totoc,BCOR10mm,captions=tableheading,titlepage,fleqn,pagesize,a4paper]{scrbook}
\usepackage{geometry}
\usepackage{hyperref}
\setlength{\pdfpagewidth}{\paperwidth}
\setlength{\pdfpageheight}{\paperheight}
这个单章现在看起来像主文档。所以现在我不知道哪个是正确的 A4 格式。我更喜欢旧的章节大小。
纸张尺寸为 210mm x 297mm,主文档(现在是单章)的文本区域为:~136mm x 227mm,旧单章文本区域为:~152mm x ~253mm
答案1
看来我刚刚解决了自己的问题。区别在于字体大小。Koma Script 根据纸张大小和字体大小自动计算文本区域大小。根文档的字体大小为 11pl,单个章节的字体大小为 12pt。将根文档的字体大小调大后,文本区域大小增加到更接近我希望的大小。我对排版完全是菜鸟,也没有任何审美意识,但似乎如果我想要更小的字体,我只需要手动设置边距并希望获得最佳效果。