KOMA-Script Letter (v2) は指定された余白を無視しているようです

KOMA-Script Letter (v2) は指定された余白を無視しているようです

私が書いた手紙は 1 ページ (US Letter) にちょうど収まりますが、結びの部分 ("Respectfully yours") は 2 ページ目にずれてしまいます。

「デフォルトの余白」を明示的な設定に置き換えてみました:

#LyX 2.3 created this file. For more info see http://www.lyx.org/
\lyxformat 544
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass scrlttr2
\begin_preamble
\listfiles
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Here you can modify the layout of your letter
%% Have a look at the KOMA script documentation
%% for details. Most commands are commented out
%% here (i.e. we use default settings)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Load an *.lco style file (see KOMA documentation)
%\LoadLetterOption{DIN}%                          

%% THE CLASS OPTIONS
%% Remove preceeding '%' to uncomment an item
\KOMAoptions{%
firstfoot=false,
%,headsepline=true%            separate the header with a line on page >1
%,footsepline=true%             separate the footer with a line on page >1
%pagenumber=botcenter%   position of the page number (see docu)
%,parskip=false%          Use indent instead of skip (more options cf. docu)
fromalign=center%        alignment of the address
,fromrule=true%    separate the address with a line?
,fromphone=false%         print sender phone number
,fromfax=false%          print sender fax number
,fromemail=true%           print sender e-mail address
,fromurl=false%               print sender URL
%,fromlogo=true%         print a logo (position depends on fromalign)
%,addrfield=false%        print an address field?
,backaddress=false%  print the back address?
%,subject=afteropening,titled% alternative subject layout and position
%,locfield=narrow%      width of the (extra) location field
,foldmarks=true%      print foldmarks?
,twoside=false
%,numericaldate=true%  date layout
%,refline=wide%             layout of the refline
}

%% Customize Separators
%\setkomavar{placeseparator}{ -- }
\setkomavar{backaddressseparator}{ $\cdot$ }
%\setkomavar{emailseparator}{ --> }
%\setkomavar{enclseparator}{ > }
%\setkomavar{faxseparator}{ --> }
%\setkomavar{phoneseparator}{ --> }
%\setkomavar{subjectseparator}{ >>> }

%% Customize fonts
%% Use LaTeX's standard font commands
%% Modify with \setkomafont or \addtokomafont
%% (see KOMA documentation)
%% \setkomafont{backaddress}{\rmfamily}
%\setkomafont{descriptionlabel}{}
%% \setkomafont{fromaddress}{\large}
%% \setkomafont{fromname}{\scshape}
%\setkomafont{pagefoot}{}
%\setkomafont{pagehead}{}
%\setkomafont{pagenumber}{}
%\setkomafont{subject}{}
%\setkomafont{title}{}
\end_preamble
\use_default_options true
\maintain_unincluded_children false
\language ukrainian
\language_package default
\inputencoding auto
\fontencoding global
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\use_microtype false
\use_dash_ligatures true
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\papersize letterpaper
\use_geometry true
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 1
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 1
\use_minted 0
\index Index
\shortcut idx
\color #008000
\end_index
\leftmargin 1cm
\topmargin 1cm
\rightmargin 1cm
\bottommargin 1mm
\headheight 3cm
\headsep 1cm
\footskip 1cm
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\is_math_indent 0
\math_numbering_side default
\quotes_style russian
\dynamic_quotes 0
\papercolumns 1
\papersides 1
\paperpagestyle fancy
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header

\begin_body

\begin_layout Name
Wombat the Magnificent
\end_layout

\begin_layout SenderAddress

\lang english
0 Privacy Drive
\begin_inset Newline newline
\end_inset

Newton, MA 02462
\end_layout

\begin_layout E-Mail

\lang english
[email protected]
\end_layout

\begin_layout Address
Random Chairman
\begin_inset Newline newline
\end_inset


\end_layout

\begin_layout Subject
Healing toothache by turning into a bird
\end_layout

\begin_layout Opening
Honorable Mister Chairman!
\end_layout

\begin_layout Standard
It has come to our attention, that birds are by their nature toothless and
 cannot have a toothache.
\end_layout

\begin_layout Standard
Please, investigate the possibility of alleviating the acute instances of
 such illness by turning the patient into a bird of his choice.
 Care should be taken, that the bird is flightless, lest there might be
 accidents of another sort.
\end_layout

\begin_layout EndLetter
Respectfully,
\end_layout

\begin_layout Signature
The Wombat
\end_layout

\end_body
\end_document

しかし、何も変わりませんでした。手紙は依然として非常に広い余白(2インチ以上)で表示され、特に下の余白が大きく、テキストは下の折り目より上で終了し、1ページ目の残りの部分は空白で、2ページ目には結びの言葉以外は何も書かれていません。

LyXやTeXを使ってすべてを1ページに収めるにはどうすればいいでしょうか?前置き

答え1

は文字Respectfullyの後に、つまり文字の後ろに設定され\end{letter}、常に新しいページに表示されます。 を使用して設定し\closing{…}signature変数も先頭に設定する必要があります。これは、常に次の文字 (通常は次の で使用\closing{…}) に設定されるためです。

#LyX 2.4 created this file. For more info see https://www.lyx.org/
\lyxformat 620
\begin_document
\begin_header
\save_transient_properties true
\origin unavailable
\textclass scrlttr2
\begin_preamble
\listfiles
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%% Here you can modify the layout of your letter
%% Have a look at the KOMA script documentation
%% for details. Most commands are commented out
%% here (i.e. we use default settings)
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

%% Load an *.lco style file (see KOMA documentation)
%\LoadLetterOption{DIN}%                          

%% THE CLASS OPTIONS
%% Remove preceeding '%' to uncomment an item
\KOMAoptions{%
firstfoot=false,
%,headsepline=true%            separate the header with a line on page >1
%,footsepline=true%             separate the footer with a line on page >1
%pagenumber=botcenter%   position of the page number (see docu)
%,parskip=false%          Use indent instead of skip (more options cf. docu)
fromalign=center%        alignment of the address
,fromrule=true%    separate the address with a line?
,fromphone=false%         print sender phone number
,fromfax=false%          print sender fax number
,fromemail=true%           print sender e-mail address
,fromurl=false%               print sender URL
%,fromlogo=true%         print a logo (position depends on fromalign)
%,addrfield=false%        print an address field?
,backaddress=false%  print the back address?
%,subject=afteropening,titled% alternative subject layout and position
%,locfield=narrow%      width of the (extra) location field
,foldmarks=true%      print foldmarks?
,twoside=false
%,numericaldate=true%  date layout
%,refline=wide%             layout of the refline
%,enlargefirstpage
}

%% Customize Separators
%\setkomavar{placeseparator}{ -- }
\setkomavar{backaddressseparator}{ $\cdot$ }
%\setkomavar{emailseparator}{ --> }
%\setkomavar{enclseparator}{ > }
%\setkomavar{faxseparator}{ --> }
%\setkomavar{phoneseparator}{ --> }
%\setkomavar{subjectseparator}{ >>> }

%% Customize fonts
%% Use LaTeX's standard font commands
%% Modify with \setkomafont or \addtokomafont
%% (see KOMA documentation)
%% \setkomafont{backaddress}{\rmfamily}
%\setkomafont{descriptionlabel}{}
%% \setkomafont{fromaddress}{\large}
%% \setkomafont{fromname}{\scshape}
%\setkomafont{pagefoot}{}
%\setkomafont{pagehead}{}
%\setkomafont{pagenumber}{}
%\setkomafont{subject}{}
%\setkomafont{title}{}
\end_preamble
\use_default_options true
\maintain_unincluded_children no
\language ukrainian
\language_package default
\inputencoding auto-legacy
\fontencoding auto
\font_roman "default" "default"
\font_sans "default" "default"
\font_typewriter "default" "default"
\font_math "auto" "auto"
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_roman_osf false
\font_sans_osf false
\font_typewriter_osf false
\font_sf_scale 100 100
\font_tt_scale 100 100
\use_microtype false
\use_dash_ligatures true
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\float_placement class
\float_alignment class
\paperfontsize default
\spacing single
\use_hyperref false
\papersize letter
\use_geometry true
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 1
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine basic
\cite_engine_type default
\biblio_style plain
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\justification true
\use_refstyle 1
\use_formatted_ref 0
\use_minted 0
\use_lineno 0
\index Index
\shortcut idx
\color #008000
\end_index
\leftmargin 1cm
\topmargin 1cm
\rightmargin 1cm
\bottommargin 1mm
\headheight 3cm
\headsep 1cm
\footskip 1cm
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\is_math_indent 0
\math_numbering_side default
\quotes_style russian
\dynamic_quotes 0
\papercolumns 1
\papersides 1
\paperpagestyle default
\tablestyle default
\tracking_changes false
\output_changes false
\change_bars false
\postpone_fragile_content false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\docbook_table_output 0
\docbook_mathml_prefix 1
\end_header

\begin_body

\begin_layout Name
Wombat the Magnificent
\end_layout

\begin_layout SenderAddress

\lang english
0 Privacy Drive
\begin_inset Newline newline
\end_inset

Newton,
 MA 02462
\end_layout

\begin_layout E-Mail

\lang english
[email protected]
\end_layout

\begin_layout Signature

\lang english
The Wombat
\end_layout

\begin_layout Address
Random Chairman
\begin_inset Newline newline
\end_inset


\end_layout

\begin_layout Subject
Healing toothache by turning into a bird
\end_layout

\begin_layout Opening
Honorable Mister Chairman!
\end_layout

\begin_layout Standard
It has come to our attention,
 that birds are by their nature toothless and cannot have a toothache.
\end_layout

\begin_layout Standard
Please,
 investigate the possibility of alleviating the acute instances of such illness by turning the patient into a bird of his choice.
 Care should be taken,
 that the bird is flightless,
 lest there might be accidents of another sort.
\end_layout

\begin_layout Closing
Respectfully
\end_layout

\end_body
\end_document

LyX WYSIWYW プレビュー

PDF出力

また、 を非アクティブ化しましたfancyhdr。これは、KOMA-Script クラスでパッケージを使用することは推奨されておらず、scrlttr2ページ ヘッダーとフッターを設定する独自のメカニズムも備えているためです。詳細については、マニュアルを参照してください。

オプション を追加すると便利な場合がありますenlargefirstpage(オプション を使用する場合など) firstfoot=false。そのため、これをプリアンブルに追加しました (ただしコメントを付けました)。

ところで、デフォルトの文字レイアウトはDIN.lco用に作成されていませんletterpaper。そのため、DIN.lcoを で使用するとletterpaper警告メッセージが表示されます。代替案については、KOMA スクリプトのマニュアルも参照してください。

注意: KOMAスクリプトのオプションの中には、設定twoside=falseに応じて余白を再計算するものもありますtypearea。そのため、これらを使用する場合は \geometry、再び設定が変更されます\geometry。これを避けるには、これらのオプションを使用しないか、 \geometryまたは、geometryそれらのオプションを設定した後に設定を復元します。ただし、あなたの場合は、twoside=falseがすでにデフォルトになっているため、 を使用しない方が簡単ですscrlttr2。オプションを使用しないと、次のようになります。

オプションなし twoside=false

(しかし、私見では、この醜い結果は、なぜこのような小さな余白を使用すべきではないのかを示す非常に良い例です。)

このようなオプションを使用する場合、私見では、 を使ってドキュメントのプリアンブルで設定するのではなく、クラス オプションとして使用するのが最善の解決策です。や など\KOMAoptionsの一部のオプションについては、これも作成者によって推奨されています。 LyX では、 → →でクラス オプションを設定できます。fontsizeparskipDocumentSettingsDocument Class

オプションの詳細については、KOMA-Script のマニュアルを参照してください。

関連情報