-
Notifications
You must be signed in to change notification settings - Fork 2
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
driver overwrite added #3
base: main
Are you sure you want to change the base?
Conversation
That's the same approach the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the idea is sound, a couple of English comments have been made inline but we would need to address color
as well since they share back end files.
If just graphics.cfg
is modified as here then
\documentclass{article}
\usepackage[dvips]{color}
\usepackage[dvips]{graphicx}
\begin{document}
\end{document}
runs without error but loads both dvips.def
and graphics.def
which is not a good combination.
You could copy graphics.def to color.def (and optionally change {graphics}
to {color}
in the Packagewarning. That fixes things for color
but unfortunately that breaks xcolor and
\documentclass{article}
\usepackage[dvips]{xcolor}
\usepackage[dvips]{graphicx}
\begin{document}
\end{document}
gives
! LaTeX Error: \RequirePackage or \LoadClass in Options Section.
Probably easy to fix, but I can't look until later.
|
As a first workaround I've made a |
And the new version of \documentclass{article}
\usepackage[dvips]{xcolor}
\usepackage[dvips]{graphicx}
\begin{document}
\end{document} results in: Running `LaTeX' on `test' with ``pdflatex -file-line-error --synctex=1 -interaction=nonstopmode test.tex''
This is pdfTeX, Version 3.141592653-2.6-1.40.25 (TeX Live 2023) (preloaded format=pdflatex)
restricted \write18 enabled.
entering extended mode
(./test.tex
LaTeX2e <2023-11-01> patch level 1
L3 programming layer <2024-02-20>
(/usr/local/texlive/2023/texmf-dist/tex/latex/base/article.cls
Document Class: article 2023/05/17 v1.4n Standard LaTeX document class
(/usr/local/texlive/2023/texmf-dist/tex/latex/base/size10.clo))
(/usr/local/texlive/2023/texmf-dist/tex/latex/xcolor/xcolor.sty (./color.cfg)
Package xcolor Warning: Explicit driver option dvips ignored,
(xcolor) because detected engine does not support it.
(xcolor) We recommend to remove the explicit driver option.
(xcolor) Still staying with driver pdftex.def.
(/usr/local/texlive/2023/texmf-dist/tex/latex/graphics-def/pdftex.def)
(/usr/local/texlive/2023/texmf-dist/tex/latex/graphics/mathcolor.ltx))
(/usr/local/texlive/2023/texmf-dist/tex/latex/graphics/graphicx.sty
(/usr/local/texlive/2023/texmf-dist/tex/latex/graphics/keyval.sty)
(/usr/local/texlive/2023/texmf-dist/tex/latex/graphics/graphics.sty
(/usr/local/texlive/2023/texmf-dist/tex/latex/graphics/trig.sty)
(./graphics.cfg)
Package graphics Warning: Explict driver option dvips ignored,
(graphics) because detected engine does not support it.
(graphics) We recommend to remove the explicit driver option.
(graphics) Still staying with driver pdftex.def.
)) (/usr/local/texlive/2023/texmf-dist/tex/latex/l3backend/l3backend-pdftex.def) (./test.aux)
(/usr/local/texlive/2023/texmf-dist/tex/context/base/mkii/supp-pdf.mkii
[Loading MPS to PDF converter (version 2006.09.02).]
) (/usr/local/texlive/2023/texmf-dist/tex/latex/epstopdf-pkg/epstopdf-base.sty
(/usr/local/texlive/2023/texmf-dist/tex/generic/infwarerr/infwarerr.sty)
(/usr/local/texlive/2023/texmf-dist/tex/latex/grfext/grfext.sty
(/usr/local/texlive/2023/texmf-dist/tex/generic/kvdefinekeys/kvdefinekeys.sty)) (/usr/local/texlive/2023/texmf-dist/tex/latex/kvoptions/kvoptions.sty
(/usr/local/texlive/2023/texmf-dist/tex/generic/ltxcmds/ltxcmds.sty)
(/usr/local/texlive/2023/texmf-dist/tex/latex/kvsetkeys/kvsetkeys.sty))
(/usr/local/texlive/2023/texmf-dist/tex/generic/pdftexcmds/pdftexcmds.sty
(/usr/local/texlive/2023/texmf-dist/tex/generic/iftex/iftex.sty))
(/usr/local/texlive/2023/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg))
(./test.aux) )
No pages of output.
Transcript written on test.log.
TeX Output finished at Wed Feb 28 11:19:13 |
BTW: I've also corrected
and did not install |
@komascript this errors with the
gives
it would of course be possible to add more guards here or add a definition of I'm wondering about a different approach: then add a guard in each of the def files so they warn if a different def has already been loaded, and |
I've just tried to do it without changing of BTW: IMHO you don't need |
BTW: There is also a branch with test files currently only for my own convenience. |
thanks I'll look at the weekend.. I should never have allowed color and graphics to both load back end files into the same document, there should have been guards in place from the start but maybe you are right and it's 30 years too late to fix that design error. |
I quite often see users loading
graphics
orgraphicx
with totally wrong driver options. The most common case is that (superfluous) optionpdftex
is used and then this is overlooked when switching to XeLaTeX or LuaLaTeX. In both cases, this leads to error messages which the user can usually do little with.I have therefore created a modification of
graphics.cfg
which basically deactivates the wrong driver options so that only a suitable warning is issued. Instead of a warning, a suitable error message could of course also be output — similar to thehyperref
package. Which is better is IMHO more a matter of taste.