Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[latex] 9ptや8ptの指定が効くように、geometry.styの読み込みを止める #912

Closed
kauplan opened this issue Jan 2, 2018 · 4 comments

Comments

@kauplan
Copy link

kauplan commented Jan 2, 2018

【問題点】

  • フォントサイズを変更するために、texdocumentclassの指定に9pt8ptを指定しても、効かない。
  • 用紙サイズを変更するためにa5jを指定すると、左右の余白が広すぎて、デフォルトでは文字が全角で25文字分しか入らない。(参考: https://imgur.com/yr1m42E

【提案】

  • geometry.styの読み込みをしないよう変更する。これで9pt8ptでのフォントサイズ指定が効くようになる。
  • またgeometry.styでの指定をしないことで、テキストの幅と高さをjsbook.styに任せるようにする。これでB5やA5のときでもB5やA5にあった幅や高さになる。
  • jsbook.clsはデフォルトで1行あたり40文字までという制限が入っているので、\textwidthを再設定することでその制限をなくす。

【パッチ】

diff --git a/templates/latex/layout.tex.erb b/templates/latex/layout.tex.erb
index b28a9a6..26e6918 100644
--- a/templates/latex/layout.tex.erb
+++ b/templates/latex/layout.tex.erb
@@ -3,6 +3,10 @@
 % \usepackage{fix-cm}[2006/09/13 v1.1m]
 % \usepackage{fixltx2e}[2006/09/13 v1.1m]
 
+%% widen text width
+\setlength{\textwidth}{\fullwidth}
+\setlength{\evensidemargin}{\oddsidemargin}
+
 <%- if @texcompiler == "uplatex" -%>
 \usepackage[deluxe,uplatex]{otf}
 <%- else -%>
@@ -39,7 +43,7 @@
  {\endMakeFramed}
 
 <%- unless ["utbook", "tbook"].include?(@documentclass)  -%>
-\usepackage[top=10zw,bottom=12zw,left=10zw,right=10zw]{geometry}
+%\usepackage[top=10zw,bottom=12zw,left=10zw,right=10zw]{geometry}
 %\usepackage[top=5zw,bottom=5zw,left=1zw,right=1zw]{geometry}
 <%- end -%>
 

【補足】

議論のたたき台としてどうぞ。

@kauplan
Copy link
Author

kauplan commented Jan 2, 2018

%% widen text width
+\setlength{\textwidth}{\fullwidth}
+\setlength{\evensidemargin}{\oddsidemargin}

この部分を外部スタイルファイルに移動できれば、テキストの幅や高さの変更が自由にしやすくなります。
たとえば次のような指定を、別ファイルで指定できるとうれしいです。

%% B5 10pt: 全角42文字(左右余白約22mm)
\setlength{\textwidth}     {42zw}
\setlength{\oddsidemargin} {-3truemm}
\setlength{\evensidemargin}{\oddsidemargin}

%% B5 9pt: 全角42文字(左右余白約28mm)
\setlength{\textwidth}     {42zw}
\setlength{\oddsidemargin} {3truemm}
\setlength{\evensidemargin}{\oddsidemargin}

%% B5 9pt: 全角44文字(左右余白約25mm)
\setlength{\textwidth}     {44zw}
\setlength{\oddsidemargin} {0truemm}
\setlength{\evensidemargin}{\oddsidemargin}

%% B5 9pt: 全角45文字(左右余白約24mm)
\setlength{\textwidth}{45zw}
\setlength{\oddsidemargin}{-1.5truemm}
\setlength{\evensidemargin}{\oddsidemargin}

%% A5 9pt: 全角39文字(左右余白約16mm)
\setlength{\textwidth}     {39zw}
\setlength{\oddsidemargin} {-9truemm}
\setlength{\evensidemargin}{\oddsidemargin}

%% A5 8pt: 全角40文字(左右余白約20mm)
\setlength{\textwidth}     {40zw}
\setlength{\oddsidemargin} {-5.5truemm}
\setlength{\evensidemargin}{\oddsidemargin}

%% A5 8pt: 全角42文字(左右余白約17mm)
\setlength{\textwidth}     {42zw}
\setlength{\oddsidemargin} {-8truemm}
\setlength{\evensidemargin}{\oddsidemargin}

@kmuto kmuto mentioned this issue Feb 6, 2018
19 tasks
@takahashim
Copy link
Collaborator

こちらですが、geometryを使わないパターンだと、

\setlength{\paperheight}    {257 truemm}
\setlength{\paperwidth}     {182 truemm}
\setlength{\textheight}     {190 truemm}
\setlength{\textwidth}      {130 truemm}
\setlength{\marginparwidth} {15  truemm}
\setlength{\marginparsep}   {2   truemm}
\setlength{\oddsidemargin}  {26  truemm}
\setlength{\evensidemargin} {26  truemm}
\setlength{\topmargin}      {10  truemm}
\setlength{\headsep}        {15  truemm}
\setlength{\headheight}     {5   truemm}
\setlength{\hoffset}{-1in}
\setlength{\voffset}{-1in}

みたいな感じにするのもありますが、こういう方がいいですか?

@kmuto
Copy link
Owner

kmuto commented Sep 21, 2018

geometryは3から除去済み。
レイアウトはドキュメントクラスオプションで指定予定。

@kmuto kmuto mentioned this issue Oct 9, 2018
9 tasks
@kmuto
Copy link
Owner

kmuto commented Oct 15, 2018

#1117 にて対応

@kmuto kmuto closed this as completed Oct 15, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants