LoginSignup
0
0

More than 1 year has passed since last update.

Re:VIEW でレイアウトを調整してみよう

Posted at

環境

  • ReView 5.3
  • Ubuntu20.04

B5電子版のデフォルトフォーマットからの変更を行っています。

余白の調整

config.yml での B5 電子版の設定

10t 40文字x35行、上余白を30mmの設定

texdocumentclass: ["review-jsbook", "media=ebook,paper=b5,serial_pagination=true,openany,fontsize=10pt,baselineskip=15.4pt,line_length=40zw,number_of_lines=35,head_space=30mm,headsep=10mm,headheight=5mm,footskip=10mm"]

から、上下余白を調整します。

10pt 40文字x38行、上余白を27.5mm に設定

texdocumentclass: ["review-jsbook", "media=ebook,paper=b5,serial_pagination=true,openany,fontsize=10pt,baselineskip=15.4pt,line_length=40zw,number_of_lines=38,head_space=27.5mm,headsep=10mm,headheight=5mm,footskip=10mm"]

コードブロックの整形

こちらにまとめています。
「Re:VIEW でコードブロックを調整」
https://qiita.com/nanbuwks/items/dc52302adfa4a1ab0fbd

ヘッダを右左に

章タイトルと、節タイトルが長いと表示が重なってしまうので、
image.png
このように偶数・奇数ページに割り振りをし直します。

image.png

「Re:VIEW 3.0でレイアウトをカスタマイズしたい! - Taste of Tech Topics」
https://acro-engineer.hatenablog.com/entry/2018/12/18/120000

に沿って、

sty/review-custom.sty

を以下のように設定しました。

\lhead[\gtfamily\sffamily\bfseries\upshape \leftmark]{}
\rhead[]{\gtfamily\sffamily\bfseries\upshape \rightmark}

章見出しの調整

デフォルトのスタイル

image.png

  • タイトルフォントサイズを小さくしたい
  • スペースを切り詰めたい
  • 「第1章」にデコレーションをしたい

「Re:VIEW 覚え書き」
https://qiita.com/kauplan/items/01dee0249802711d30a6
を参考にして、以下のようにしてみました。

まず、どこで章見出しの設定が入っているのかな? と調べてみるとsty/jsbook.clsに入っていた。


\def\@makechapterhead#1{%
  \vspace*{2\Cvs}% 欧文は50pt
  {\parindent \z@ \raggedright \normalfont
    \ifnum \c@secnumdepth >\m@ne
      \if@mainmatter
        \huge\headfont \@chapapp\thechapter\@chappos
        \par\nobreak
        \vskip \Cvs % 欧文は20pt
      \fi
    \fi
    \interlinepenalty\@M
    \Huge \headfont #1\par\nobreak
    \vskip 3\Cvs}} % 欧文は40pt

これをオーバーライドするために、

sty/review-custom.sty に以下を追加する

  \def\@makechapterhead#1{%
  \vspace*{-2.5\Cvs}% 欧文は50pt
  {\parindent \z@ \raggedright \normalfont
    \ifnum \c@secnumdepth >\m@ne
      \if@mainmatter
        \Huge \colorbox[rgb]{0.5,0.8,0.6}{\textcolor{white}{\@chapapp\thechapter\@chappos}}
        \par\nobreak
        \vskip \Cvs % 欧文は20pt
      \fi
    \fi
    \interlinepenalty\@M
    \Large \headfont #1\par\nobreak
    \vskip 3\Cvs}} % 欧文は40pt

以下のようになりました

image.png

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0