TYPO3-Documentation / latex.typo3

TYPO3 package for LaTeX (render PDF with sphinx-doc)
0 stars 1 forks source link

BUG: Doesn't work with newer Sphinx versions #1

Open marble opened 6 years ago

marble commented 6 years ago

Problem

LaTeX generation of TYPO3 manuals currently doesn't work due to changes in the Sphinx latex writer. The generator complains about "macro 'maketitle' not being defined".

How to reproduce

The attached example files here in the ZIP archive: latex-TYPO3-Security-Guide.zip contain everything needed to reproduce the problem.

  1. unpack
  2. cd ./latex-TYPO3-Security-Guide
  3. make # if LaTeX is installed on your host machine

It is line 55 that causes the problem: grafik Once you remove that line \usepackage{typo3} and run make again the PDF build succeeds.

Wanted

A fix of this repository 'latex.typo3' that works with current versions of Sphinx.

If LaTeX is not installed on your host machine

Detailed and complete how-to for developers

Host:

  1. docker pull t3docs/render-documentation:develop
  2. source <(docker run --rm t3docs/render-documentation:develop show-shell-commands)
  3. e.g.: cd ~/Repository/TYPO3-Documentation/TYPO3CMS-Guide-Security
  4. rm -rf ./Documentation-GENERATED-temp
  5. dockrun_t3rdf makeall
  6. ls ./Documentation-GENERATED-temp/Cache/latex
  7. dockrun_t3rdf /bin/bash # change INTO the container

Inside the container:

  1. cp -rp /PROJECT/Documentation-GENERATED-temp/Cache /CACHE
  2. cp -rp /ALL/Downloads/latex.typo3/font /CACHE/latex # add TYPO3 specials
  3. cp -rp /ALL/Downloads/latex.typo3/typo3* /CACHE/latex # add TYPO3 specials

Since the container contains everything needed you can now run the PDF build:

  1. cd /CACHE/latex
  2. make # should show the error.

Remove the problematic line:

  1. cat PROJECT.tex | grep -v "\usepackage{typo3}" >PROJECT-fixed.tex
  2. cp PROJECT.tex PROJEXT-buggy.tex # create backup
  3. cp PROJECT-fixed.tex PROJECT.tex
  4. make # now the build should succeed. But the PDF doesn'lt look like TYPO3.
xperseguers commented 6 years ago

When unarchiving the TYPO3 security guide locally and running:

make

I get this error:

! Undefined control sequence.
\maketitle ...\textwidth }{1pt}\ifsphinxpdfoutput 
                                                  \begingroup \def \\{, } \d...
l.67 \maketitle

?

Commenting out the inclusion of the typo3 package indeeds fixes the problem.

The problem comes from the definition of \maketitle which changed in latest versions of sphinxmanual.cls. Indeed, problem stems back to https://github.com/sphinx-doc/sphinx/issues/3914