LoginSignup
2
3

More than 5 years have passed since last update.

sphinxでlatexpdfjaのときスタイルにjsarticleを使用する

Last updated at Posted at 2017-03-24

自分のための覚え書き

conf.py で次のように設定する。

ページ番号はシンプルに下部中央に表示する。
目次部分のページ番号をローマ数字にする。
JT1/gt/bx/itJY1/gt/bx/it について、フォントの未定義の警告が出るのも対処。

# -- Options for LaTeX output ---------------------------------------------

latex_elements = {
     # The paper size ('letterpaper' or 'a4paper').
     #
     'papersize': 'a4paper',

     # The font size ('10pt', '11pt' or '12pt').
     #
     'pointsize': '11pt',

     # Additional stuff for the LaTeX preamble.
     #
     'preamble': '''
%\\pagestyle{plain}
%\\thispagestyle{plain}
\\pagestyle{fancy}
\\thispagestyle{fancy}
\\lhead{}
\\chead{}
\\rhead{}
\\DeclareFontShape{JY1}{gt}{bx}{it}{<->ssub*gt/m/n}{}
\\DeclareFontShape{JT1}{gt}{bx}{it}{<->ssub*gt/m/n}{}
\\DeclareFontShape{JY1}{gt}{m}{it}{<->ssub*gt/m/n}{}
\\DeclareFontShape{JT1}{gt}{m}{it}{<->ssub*gt/m/n}{}
\\DeclareFontShape{JY1}{mc}{bx}{it}{<->ssub*mc/m/n}{}
\\DeclareFontShape{JT1}{mc}{bx}{it}{<->ssub*mc/m/n}{}
\\DeclareFontShape{JY1}{mc}{m}{it}{<->ssub*mc/m/n}{}
\\DeclareFontShape{JT1}{mc}{m}{it}{<->ssub*mc/m/n}{}
\\pagenumbering{roman}
'''

     # Latex figure (float) alignment
     #
     # 'figure_align': 'htbp',
}

latex_docclass = {
    'howto': 'jsarticle',
    #'howto': 'jarticle',
    #'howto': 'jreport',
    'manual': 'jsarticle',
    #'manual': 'jsbook',
}

numfig = True
numfig_format = {'section': '%s',
                  'figure': '図 %s',
                  'table': '表 %s',
                  'code-block': 'リスト %s'}

本文のページ番号はアラビア数字にするため、index.rst の先頭に、下記を追加。

.. raw:: latex

    \clearpage
    \pagenumbering{arabic}

2
3
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
2
3