Skip to content
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

Exception occurred when make latex on getfem.git #6046

Closed
tkoyama010 opened this issue Feb 9, 2019 · 5 comments
Closed

Exception occurred when make latex on getfem.git #6046

tkoyama010 opened this issue Feb 9, 2019 · 5 comments

Comments

@tkoyama010
Copy link
Contributor

tkoyama010 commented Feb 9, 2019

Exception occurred
Exception occurred when compile latex document in project getfem.

To Reproduce

$ git clone https://git.savannah.nongnu.org/git/getfem.git
$ cd getfem
$ git checkout devel-tetsuo-VersionUp-sphinx
$ bash autogen.sh
$ ./configure
$ cd doc/sphinx/
$ make latex

Expected behavior
Exception occurred:
File "/usr/lib/python2.7/dist-packages/sphinx/writers/latex.py", line 706, in check_latex_elements
logger.warning(msg % key)
TypeError: not all arguments converted during string formatting
The full traceback has been saved in /tmp/sphinx-err-6HUGqT.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at https://github.com/sphinx-doc/sphinx/issues. Thanks!.

Your project
http://getfem.org/

Screenshots
None

Environment info

  • OS: [Ubuntu18.10]
  • Python version: [2.7.15]
  • Sphinx version: [1.7.9]
  • Sphinx extensions: ['sphinx.ext.imgmath', 'sphinx.ext.autodoc', 'sphinx.ext.coverage', 'sphinx.ext.doctest']
  • Extra tools: [docutils == 0.11 jinja2 == 2.3.1 pygments == 1.6]

Additional context
sphinx-err-6HUGqT.log

@tkoyama010
Copy link
Contributor Author

Same error occured also in v1.8.4.
sphinx-err-BwoVYi.log

@jfbu
Copy link
Contributor

jfbu commented Feb 9, 2019

I did not test (my g++ compiler is too old for ./configure to be happy; besides the Makefile hardcodes in ~/.local/bin location of sphinx-build if I am not wrong,).

I noticed

latex_elements = {
    'preamble': 'user_preamble',
}

in your conf.py, which will lead to other problems it should be

latex_elements = {
    'preamble':  user_preamble,
}

This should not be related to your problem and it will show only at time of executing pdflatex on the produced tex files. You also have

\\usepackage[draft]{minted}\\fvset{breaklines=true}

which seems unneeded. Package minted hacks fancyvrb to add this breaklines=true option, but Sphinx for a long time (I think 1.4.2, May 2016) wraps long code lines. You don't need this line.

@tk0miya
Copy link
Member

tk0miya commented Feb 10, 2019

It seems your project defines invalid latex_elements. And it is a cause of the TypeError.

latex_elements = [
    ('preamble',user_preamble),
]

http://git.savannah.nongnu.org/cgit/getfem.git/tree/doc/sphinx/source/conf.py#n298

So please update your configuration.

On the other hand, the TypeError is raised from LaTeX builder. And we can fix it easily. So I'll work for it.

@tk0miya tk0miya added this to the 1.8.5 milestone Feb 10, 2019
tk0miya added a commit that referenced this issue Feb 11, 2019
Fix #6046: LaTeX: ``TypeError`` is raised when invalid latex_elements given
@tk0miya
Copy link
Member

tk0miya commented Feb 11, 2019

I just fixed about crash in #6050. It does not means to accept wrong configuration of getfem. Please update your conf.py.
Thank you for reporting.

@tkoyama010
Copy link
Contributor Author

I've confirmed. Thank you for fixing.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 7, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants