# -*- coding: utf-8 -*- # Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # import os import sys sys.path.insert(0, os.path.abspath('.')) # --- add extra -- from sphinx.highlighting import PygmentsBridge from pygments.formatters.latex import LatexFormatter class CustomLatexFormatter(LatexFormatter): def __init__(self, **options): super(CustomLatexFormatter, self).__init__(**options) self.verboptions = r"formatcom=\scriptsize" PygmentsBridge.latex_formatter = CustomLatexFormatter # for jupyter-notebook from recommonmark.parser import CommonMarkParser source_parsers = { '.md': CommonMarkParser, } from recommonmark.transform import AutoStructify github_doc_root = 'https://github.com/rtfd/recommonmark/tree/master/doc/' def setup(app): app.add_config_value('recommonmark_config', { 'url_resolver': lambda url: github_doc_root + url, 'auto_toc_tree_section': 'Contents', }, True) app.add_transform(AutoStructify) # -- Project information ----------------------------------------------------- project = u'テスト' copyright = u'2018, 藤澤' author = u'藤澤' # The full version, including alpha/beta/rc tags release = '0.1' # -- General configuration --------------------------------------------------- # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ 'sphinx.ext.mathjax', # 'sphinxcontrib.blockdiag', # 'sphinxcontrib.actdiag', 'sphinx.ext.graphviz', 'nbsphinx', ] # The master toctree document. master_doc = 'index' # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. language = 'ja' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. # This pattern also affects html_static_path and html_extra_path. exclude_patterns = [] # The suffix(es) of source filenames. # You can specify multiple suffix as a list of string: source_suffix = ['.rst', '.md'] # source_suffix = '.rst' # -- Options for HTML output ------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # html_theme = 'traditional' # To activate 'sphinx_rtd_theme' 'conda install sphinx_rtd_theme' #html_theme = 'sphinx_rtd_theme' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # Language to be used for generating the HTML full-text search index. # Sphinx supports the following languages: # 'da', 'de', 'en', 'es', 'fi', 'fr', 'hu', 'it', 'ja' # 'nl', 'no', 'pt', 'ro', 'ru', 'sv', 'tr' html_search_language = 'ja' # -- Options for LaTeX output --------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). 'papersize': 'a4paper', # The font size ('10pt', '11pt' or '12pt'). 'pointsize': '12pt', # geometry 'geometry': '\\usepackage[vmargin=2cm, hmargin=2cm]{geometry}', #babel 'babel': '\\usepackage[japanese]{babel}', # Additional stuff for the LaTeX preamble. #\usepackage[top=20truemm,bottom=20truemm,left=20truemm,right=20truemm]{geometry} 'preamble': r''' \setlength\parindent{1zw} \renewcommand{\baselinestretch}{0.8} \usepackage[version=4]{mhchem} \usepackage{siunitx} \usepackage{chemfig} \makeatletter \renewcommand{\sphinxmaketitle}{ \begin{center} {\Large \@title} \par \end{center} \begin{flushright} \@date \hspace{3zw} \@author \par \end{flushright} } \makeatother \pagestyle{plain} \thispagestyle{plain} ''' } latex_elements['tableofcontents'] = r''' \pagenumbering{arabic} % page numbering as arabic \pagestyle{normal} % page set to normal ''' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ (master_doc, 'output.tex', u'テスト', u'藤澤', 'howto'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # Numbering tables and figures numfig=True # LaTeX の docclass 設定 #'howto': 'jsarticle' latex_docclass = { 'howto': 'ujarticle', 'manual': 'ujreport', # 'howto': 'article', # 'manual': 'report', } # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ (master_doc, 'output', u'テスト', author, 'output', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' # If true, do not generate a @detailmenu in the "Top" node's menu. #texinfo_no_detailmenu = False