Skip to content

Instantly share code, notes, and snippets.

@kroger
Last active February 4, 2016 17:38
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kroger/272a4932325d7629831c to your computer and use it in GitHub Desktop.
Save kroger/272a4932325d7629831c to your computer and use it in GitHub Desktop.
.. autoimage:: notation3.png
:scale-html: 40
:scale-latex: 80
bodyfont = 'Palatino', serif
headfont = Tahoma, Geneva, sans-serif;
.. code-example:: note_name.py
@font-face {
font-family: AnonymousPro;
font-weight: normal;
font-style: normal;
src: url("fonts/Anonymous Pro.ttf");
}
latex_elements = {
'papersize': '',
'fontpkg': '',
'fncychap': '',
'maketitle': '\cover',
'pointsize': '',
'preamble': '',
'releasename': "",
'babel': '',
'printindex': '',
'fontenc': '',
'inputenc': '',
'classoptions': '',
'utf8extra': '',
}
latex_additional_files = ["mfgan-bw.sty", "mfgan.sty", "_static/cover.png"]
.. literalinclude:: pyknon/simplemusic.py
:pyobject: note_name
from pyknon.simplemusic import note_name
note_name(0)
note_name(1)
note_name(13)
note_name(3)
.. only:: not latex
.. image:: figs/notation3.png
:scale: 40
.. only:: latex
.. image:: figs/notation3.png
:scale: 80
PAPEROPTS= -D latex_elements.pointsize=11pt -D latex_elements.preamble=\usepackage{mfgan-bw} \
-D pygments_style=bw -D black_and_white=True -D code_example_wrap=67 \
-D latex_show_pagerefs=True
SCREENOPTS= -D latex_elements.pointsize=12pt -D latex_elements.classoptions=,openany,oneside \
-D latex_elements.preamble=\usepackage{mfgan} -D pygments_style=my_pygment_style.BookStyle \
-D code_example_wrap=67
def setup(app):
from sphinx.util.texescape import tex_replacements
tex_replacements += [(u'♮', u'$\natural$'),
(u'ē', u'=e'),
(u'♩', u'quarternote'),
(u'↑', u'$\uparrow$')]
pdf:
$(SPHINXBUILD) -b latex $(SCREENOPTS) $(ALLSPHINXOPTS) $(BUILDDIR)/latex
sed -i .bak -f process-latex $(BUILDDIR)/latex/$(LATEX-NAME).tex
rsync -a latex/ $(BUILDDIR)/latex/
$(MAKE) -C $(BUILDDIR)/latex pdf
pdf-bw:
$(SPHINXBUILD) -b latex -t black_and_white $(PAPEROPTS) $(ALLSPHINXOPTS) $(LATEX-BW)
sed -i .bak -f process-latex $(LATEX-BW)/$(LATEX-NAME).tex
sed -i .bak '/\setcounter{page}{1}/d' $(LATEX-BW)/sphinxmanual.cls
rsync -a latex/ $(LATEX-BW)/
$(MAKE) -C $(LATEX-BW)/ pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment