Le 25/07/2017 à 22:42, Christoph Buchner a écrit :
documentclass argument from 'manual' to 'beamer'.
...
    Package titlesec Warning: Non standard sectioning command detected
    (titlesec)                Using default spacing and no format.

    ! Undefined control sequence.
    <argument> \paragraph

    l.1289 \ttl@extract\paragraph


...
Is this a known problem?

Hi,

beamer is incompatible with titlesec as this shows:

\documentclass{beamer}
%\let\paragraph\section
%\let\subparagraph\section
\usepackage{titlesec}

\begin{document}
hello
\end{document}

but de-commenting the two "\let" lines at least allows latex
to work on this.

Thus you could try in conf.py

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

    'passoptionstopackages' : r'''
\let\paragraph\section
\let\subparagraph\section
''',
}

but then we get into another problem

! LaTeX Error: Command \definitions already defined.
               Or name \end... illegal, see p.192 of the manual.


Indeed, sphinx.sty has a

\newenvironment{definitions}{...}{...}

This is Python legacy and there are other usage of common words
in commands and environments, although Sphinx is moving more and
more to using systematically a prefix "sphinx".

Sadly many packages and classes in LaTeX pay no attention
to such problems and consider normal to define commands or
environments with such names as "definition", "strong", "total",
etc... and LaTeX has no mechanism whatsoever against such
clashes (no module name spaces in LaTeX)

From Beamer doc

The beamer class predefines several environments, like theorem or definition or 
proof, that you can use to typeset things like, well, theorems, definitions, or 
proofs. The complete list is the following: theorem, corollary, definition, 
definitions, fact, example, and examples. The following German block 
environments are also predefined: Problem, Loesung, Definition, Satz, Beweis, 
Folgerung, Lemma, Fakt, Beispiel, and Beispiele.

Thus we are led to

    'passoptionstopackages' : r'''
\let\paragraph\section
\let\subparagraph\section
\let\definitions\relax
\let\enddefinitions\relax
''',


with this make latexpdf completes on hello world document.

I am sure there will be many issues.

Already, in LaTeX there are many conflicts between packages.

But here we are talking about using Beamer class, which makes
drastic changes to all LaTeX document commands.

Thus it *might* work, and please report if it does ;-) !


Ultimate fixes can be obtained this way:

do once make latexpdf

copy over the sphinx.sty file from the build repertory and put
it at top level in your real project

then add in conf.py

latex_additional_files = [ 'sphinx.sty' ]

and customize as desired the sphinx.sty file, for example
removing all titlesec related things in this case, or removing
the "definitions" environment.

But the Sphinx LaTeX writer might want to use that environment
and Beamer has its own version so there will be clash.

To be complete you would need to examine the Sphinx LaTeX writer
latex.py file and modify all its LaTeX macros to use Beamer syntax
if needed...

Can creating slides from rst this way actually work?

perhaps someone will tell us...


Thank you for any pointers!

Best,
Christoph

p.s.: I have also investigated other options, but the other main contender for my use 
case, hieroglyph <https://github.com/nyergler/hieroglyph>, which is mentioned 
in the Sphinx FAQ, seems to be basically unmaintained.


Best,
Jean-Francois


--
You received this message because you are subscribed to the Google Groups 
"sphinx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sphinx-users+unsubscr...@googlegroups.com.
To post to this group, send email to sphinx-users@googlegroups.com.
Visit this group at https://groups.google.com/group/sphinx-users.
For more options, visit https://groups.google.com/d/optout.

Reply via email to