使用時に\usepackage {pst-barcode}
エラーが発生します:
\documentclass[10pt,a4paper,twoside,openany]{book}
\usepackage[spanish]{babel}
\usepackage[dvipsnames,x11names]{pstricks}% Options for xcolor
\usepackage{pst-barcode}
\usepackage[utf8]{inputenc}
\begin{document}
\begin{pspicture}(3.5,1.2in)
\psbarcode[linecolor=red]{1613198400316}{includetext inkspread=0.1}{ean13}
\end{pspicture}
\end{document}
答え1
のオプションは次のように渡すことができxcolor
ますpstricks
:
\documentclass{article}
\usepackage[dvipsnames,x11names]{pstricks}% Options for xcolor
\usepackage{pst-barcode}
\begin{document}
\begin{pspicture}(3.5,1.2in)
\psbarcode[linecolor=red]{1234567}{includetext inkspread=0.5}{ean8}
\end{pspicture}
\end{document}
xcolor
デフォルトでロードされるcolor
そして
\psbarcode[linecolor=red]{1613198400317}{includetext inkspread=0.5}{ean13}
答え2
Pstricks
(によってロードされたpst-barcode
) は、すでにxcolor
オプションなしでロードされています。後者をオプション付きでロードすると、「オプションの衝突」が発生します。解決策は、ドキュメント クラス内からオプションをロードすることです。これにより、後続のすべてのパッケージにオプションが提案され、そのうちの 1 つがそれを認識するまで続きます。
代替解決策: 序文に記述します\PassOptionsToPackage{selected options}{xcolor}
。