4

I am using Sphinx to generate multi-output documents (Epub, HTML, LaTeX). How can I change the use documentclass?

The following snippet should (in my opinion) override the used class but results in

% Generated by Sphinx.
\def\sphinxdocclass{scrbook}
\documentclass[,]{sphinxmanual}

Here's the code from my conf.py:

latex_elements = {
     'papersize': '',
     'fontpkg': '',
     'fncychap': '',
     'maketitle': '',
     'pointsize': '',
     'preamble': '',
     'releasename': "",
     'babel': '',
     'printindex': '',
     'fontenc': '',
     'docclass':'scrbook',
     'inputenc': '',
     'classoptions': '',
     'utf8extra': '',
 }

The manual says, it should not be overridden, since other macros are responsible to set it. Is there a workaround?

2

Looking at https://github.com/basespace/basespace-python-sdk/blob/master/doc/latex/sphinxmanual.cls it seems that class just loads the class specified by \sphinxdocclass so your generated code looks OK.

| improve this answer | |
6

This comes very late, but maybe it helps...

I am running sphinx 1.8.2

Do not put the docclass into the latex_elements variable dictionary, but put it into the latex_docclass dictionary, with key 'howto' and 'manual'. Example code:

latex_docclass = {
   'howto': 'yourclass1',
   'manual': 'yourclass2',
}

see: https://www.sphinx-doc.org/en/1.8/usage/configuration.html#confval-latex_docclass

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.