bidi-tex / bidi

Bidirectional typesetting in plain TeX and LaTeX, using XeTeX
Other
3 stars 0 forks source link

"Oops! you have loaded package color after bidi package" with minted package #12

Closed seloumi closed 5 years ago

seloumi commented 5 years ago

Brief outline of the issue

Adding minted package with bidi (even if it is added before) produce error

Oops! you have loaded package color after bidi package

Minimal example showing the issue

% !TEX TS-program = XeLaTeX
% !TEX encoding = UTF-8 Unicode
\documentclass[12pt]{article}
\usepackage{minted}
\usepackage{fontspec}
\usepackage{bidi}

\begin{document}

Test

\end{document}

Log and PDF files

test.log

davidcarlisle commented 5 years ago

It may be able to avoid this warning, but the fix implied by the error message of loading color before bidi seems to work:

\documentclass[12pt]{article}
\usepackage{color}
\usepackage{minted}
\usepackage{fontspec}
\usepackage{bidi}

\begin{document}

Test

\end{document}
seloumi commented 5 years ago

Package minted add color package at end preamble if not loaded

\AtEndPreamble{%
  \@ifpackageloaded{color}{}{%
    \@ifpackageloaded{xcolor}{}{\RequirePackage{xcolor}}}%
}

https://github.com/gpoore/minted/blob/5d72859d714a6f2f6a42eec524476994d954b960/source/minted.sty#L48-L51 Thanks for your reply, you can close the issue, I think.