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

Option clash for package textcomp #4727

Closed
ricpelo opened this issue Mar 10, 2018 · 5 comments
Closed

Option clash for package textcomp #4727

ricpelo opened this issue Mar 10, 2018 · 5 comments
Assignees
Milestone

Comments

@ricpelo
Copy link

ricpelo commented Mar 10, 2018

Problem

Trying to create a PDF version of my book I get the following error:

! LaTeX Error: Option clash for package textcomp.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.43 \RequirePackage
                    {titlesec}

Procedure to reproduce the problem

$ git clone https://github.com/ricpelo/libro-dwese.git
$ cd libro-dwese
$ pip install -r requirements.txt
$ make latexpdf

Error logs / results

Running Sphinx v1.7.1
loading translations [es]... done
loading pickled environment... done
building [mo]: targets for 0 po files that are out of date
building [latex]: all documents
updating environment: 0 added, 0 changed, 0 removed
looking for now-outdated files... none found
processing dwese.tex...index_latex introduccion php yii2 
resolving references...
writing... done
copying TeX support files...
done
build succeeded.

The LaTeX files are in _build/latex.
Run 'make' in that directory to run these through (pdf)latex
(use `make latexpdf' here to do that automatically).
make[1]: se entra en el directorio '/home/ricardo/libro-dwese/_build/latex'
latexmk -pdf -dvi- -ps-  'dwese.tex'
Latexmk: This is Latexmk, John Collins, 1 January 2015, version: 4.41.
Rule 'pdflatex': Rules & subrules not known to be previously run:
   pdflatex
Rule 'pdflatex': The following rules & subrules became out-of-date:
      'pdflatex'
------------
Run number 1 of rule 'pdflatex'
------------
------------
Running 'xelatex   -recorder  "dwese.tex"'
------------
Latexmk: applying rule 'pdflatex'...
This is XeTeX, Version 3.14159265-2.6-0.99992 (TeX Live 2015/Debian) (preloaded format=xelatex)
 restricted \write18 enabled.
entering extended mode
(./dwese.tex
LaTeX2e <2016/02/01>
Babel <3.9q> and hyphenation patterns for 81 language(s) loaded.
(./sphinxmanual.cls
Document Class: sphinxmanual 2017/03/26 v1.6 Document class (Sphinx manual)
(/usr/share/texlive/texmf-dist/tex/latex/base/report.cls
Document Class: report 2014/09/29 v1.4h Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size12.clo)))
(/usr/share/texlive/texmf-dist/tex/latex/cmap/cmap.sty

Package cmap Warning: pdftex not detected - exiting.

) (/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3-code.tex)
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/l3xdvipdfmx.def))
(/usr/share/texlive/texmf-dist/tex/latex/l3packages/xparse/xparse.sty)
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty
(/usr/share/texlive/texmf-dist/tex/latex/euenc/eu1enc.def)
(/usr/share/texlive/texmf-dist/tex/latex/euenc/eu1lmr.fd))
(/usr/share/texlive/texmf-dist/tex/xelatex/xunicode/xunicode.sty
(/usr/share/texmf/tex/latex/tipa/t3enc.def
(/usr/share/texlive/texmf-dist/tex/latex/euenc/eu1lmss.fd))
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/share/texlive/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics/trig.sty)
(/usr/share/texlive/texmf-dist/tex/latex/latexconfig/graphics.cfg)
(/usr/share/texlive/texmf-dist/tex/xelatex/xetex-def/xetex.def
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/infwarerr.sty)
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ltxcmds.sty)))))
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amssymb.sty
(/usr/share/texlive/texmf-dist/tex/latex/amsfonts/amsfonts.sty))
(/usr/share/texlive/texmf-dist/tex/latex/polyglossia/polyglossia.sty
(/usr/share/texlive/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
(/usr/share/texlive/texmf-dist/tex/latex/makecmds/makecmds.sty)
(/usr/share/texlive/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkvutils.tex)))
(/usr/share/texlive/texmf-dist/tex/generic/oberdiek/ifluatex.sty)
(/usr/share/texlive/texmf-dist/tex/generic/ifxetex/ifxetex.sty))
(/usr/share/texlive/texmf-dist/tex/latex/polyglossia/gloss-spanish.ldf)
(/usr/share/texlive/texmf-dist/tex/latex/libertine/libertine.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/textcomp.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/ts1enc.def))
*************************************************
* fontspec warning: "icu-feature-not-exist-in-font"
* 
* OpenType feature 'Numbers=Monospaced,Lining' (+tnum) not available for font
* 'LinLibertine_RZI' with script 'Latin' and language 'Default'.
*************************************************
*************************************************
* fontspec warning: "icu-feature-not-exist-in-font"
* 
* OpenType feature 'Numbers=Monospaced,Lining' (+tnum) not available for font
* 'LinLibertine_RZI' with script 'Latin' and language 'Default'.
*************************************************
(/usr/share/texlive/texmf-dist/tex/latex/libertine/LinLibertine_R.tex)
(/usr/share/texlive/texmf-dist/tex/latex/libertine/LinBiolinum_R.tex)
(/usr/share/texlive/texmf-dist/tex/latex/libertine/LinBiolinum_K.tex)
(/usr/share/texlive/texmf-dist/tex/latex/libertine/LinLibertine_I.tex)
(/usr/share/texlive/texmf-dist/tex/latex/libertine/LKey.tex))
(/usr/share/texlive/texmf-dist/tex/latex/fncychap/fncychap.sty) (./sphinx.sty
(/usr/share/texlive/texmf-dist/tex/latex/fancyhdr/fancyhdr.sty)

! LaTeX Error: Option clash for package textcomp.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...                                              
                                                  
l.43 \RequirePackage
                    {titlesec}
? The package textcomp has already been loaded with options:
  []
There has now been an attempt to load it with options
  [warn]
Adding the global options:
  ,warn
to your \documentclass declaration may fix this.
Try typing  <return>  to proceed.
? OK, entering \batchmodeLatexmk: Index file 'dwese.idx' was written
Latexmk: References changed.
Latexmk: Missing input file: 'dwese.ind' from line
  'No file dwese.ind.'
Latexmk: References changed.
Latexmk: Log file says output to 'dwese.pdf'
Collected error summary (may duplicate other messages):
  pdflatex: Command for 'pdflatex' gave return code 256
Latexmk: Use the -f option to force complete processing,
 unless error was exceeding maximum runs of latex/pdflatex.
Latexmk: Errors, so I did not complete making targets
Makefile:32: fallo en las instrucciones para el objetivo 'dwese.pdf'
make[1]: *** [dwese.pdf] Error 12
make[1]: se sale del directorio '/home/ricardo/libro-dwese/_build/latex'
Makefile:18: fallo en las instrucciones para el objetivo 'latexpdf'
make: *** [latexpdf] Error 2

Expected results

No errors and PDF generated successfully.

Reproducible project / your project

https://github.com/ricpelo/libro-dwese

Environment info

  • OS: Ubuntu 16.04.3 LTS
  • Python version: 2.7.12
  • Sphinx version: 1.7.1
pdfTeX 3.14159265-2.6-1.40.16 (TeX Live 2015/Debian)
kpathsea version 6.2.1
Copyright 2015 Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
There is NO warranty.  Redistribution of this software is
covered by the terms of both the pdfTeX copyright and
the Lesser GNU General Public License.
For more information about these matters, see the file
named COPYING and the pdfTeX source.
Primary author of pdfTeX: Peter Breitenlohner (eTeX)/Han The Thanh (pdfTeX).
Compiled with libpng 1.6.17; using libpng 1.6.17
Compiled with zlib 1.2.8; using zlib 1.2.8
Compiled with poppler version 0.41.0
@tk0miya
Copy link
Member

tk0miya commented Mar 11, 2018

(/usr/share/texlive/texmf-dist/tex/latex/libertine/libertine.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/textcomp.sty

It seems your project uses libertine package which depends textcomp.
https://github.com/ricpelo/libro-dwese/blob/master/conf.py#L263

On the other hand, Sphinx also uses textcomp package with warn option.
It was introduced at #4267.

@jfbu could you check this please?

@tk0miya tk0miya added this to the 1.7.2 milestone Mar 11, 2018
@jfbu
Copy link
Contributor

jfbu commented Mar 11, 2018

@ricpelo can you try adding this key to latex_elements in your conf.py:

latex_elements = {
    passoptionstopackages: '\\PassOptionsToPackage{warn}{textcomp}',
}

does this fix your issue ? I will make a PR to address this premptively.

jfbu added a commit to jfbu/sphinx that referenced this issue Mar 11, 2018
Some packages loaded from user customized 'fontpkg' key may load
textcomp with no option, clashing with sphinx.sty which comes later
and wants it with "warn" option. This makes sure textcomp receives
always "warn" option, even if loaded prior to sphinx.

	modified:   CHANGES
	modified:   sphinx/templates/latex/latex.tex_t
	modified:   sphinx/texinputs/sphinx.sty
@jfbu jfbu added the type:bug label Mar 11, 2018
@ricpelo
Copy link
Author

ricpelo commented Mar 11, 2018

@jfbu Yes, adding that line fix the issue! Thank you very much!

ricpelo added a commit to ricpelo/libro-dwese that referenced this issue Mar 11, 2018

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
jfbu added a commit that referenced this issue Mar 11, 2018
Fix #4727: Option clash for package textcomp
@jfbu
Copy link
Contributor

jfbu commented Mar 11, 2018

Fixed at 87e8dd1 . With 1.7.2 you can remove the extra latex_elements key, but leaving it should cause no harm. Thanks for report.

@jfbu jfbu closed this as completed Mar 11, 2018
@ricpelo
Copy link
Author

ricpelo commented Mar 11, 2018

Thanks to you!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 17, 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