Skip to content

doc(nyz): support latex in rst #156

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions source/12_policies/ddpg.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ Pseudocode
----------

.. math::

:nowrap:

\begin{algorithm}[H]
Expand Down Expand Up @@ -88,12 +87,6 @@ Pseudocode
\end{algorithmic}
\end{algorithm}


.. image::
images/DDPG.jpg
:scale: 75%
:align: center

Extensions
-----------
DDPG can be combined with:
Expand Down
46 changes: 35 additions & 11 deletions source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,14 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc', 'sphinx.ext.doctest', 'sphinx.ext.mathjax',
'sphinx.ext.ifconfig', 'sphinx.ext.viewcode', 'sphinx.ext.githubpages',
'enum_tools.autoenum'
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.ifconfig',
'sphinx.ext.viewcode',
'sphinx.ext.githubpages',
'sphinx.ext.imgmath',
# 'sphinx.ext.mathjax', # can only use one of imgmath and mathjax
'enum_tools.autoenum',
]

# Add any paths that contain templates here, relative to this directory.
Expand Down Expand Up @@ -107,32 +112,51 @@
# Output file base name for HTML help builder.
htmlhelp_basename = 'DI-enginedoc'

# -- Options for LaTeX output ------------------------------------------------
# -- Options for LaTeX output + image type math ------------------------------------------------

# imgmath settings
imgmath_image_format = 'svg'
imgmath_font_size = 14

imgmath_latex_preamble = r'''
\usepackage{algorithm}
\usepackage{algorithmic}
\usepackage{amsmath}
\usepackage{cancel}
\usepackage[verbose=true,letterpaper]{geometry}
\geometry{
textheight=12in,
textwidth=6.5in,
top=1in,
headheight=12pt,
headsep=25pt,
footskip=30pt
}
\newcommand{\E}{{\mathrm E}}
\newcommand{\underE}[2]{\underset{\begin{subarray}{c}#1 \end{subarray}}{\E}\left[ #2 \right]}
\newcommand{\Epi}[1]{\underset{\begin{subarray}{c}\tau \sim \pi \end{subarray}}{\E}\left[ #1 \right]}
'''

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

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

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

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

# 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, 'DI-engine.tex', 'DI-engine Documentation', 'bao', 'manual'),
]
# latex_documents = [
# (master_doc, 'DI-engine.tex', 'DI-engine Documentation', 'bao', 'manual'),
# ]

# -- Options for manual page output ------------------------------------------

Expand Down