Skip to main content
Corrected error - removed \node{}
Source Link
pds
  • 261
  • 2
  • 8

When compiling the MWE below with PDFLatex the linear-gradient color background appears, however when compiled in XeLatex the background is white.

  • (NB: using [fill] produces the salmon color background)
  • The linear-gradient is produced with tikz with \path and \node(\node` also experiences the effect).
  • The tex file has previously compiled in XeLatex correctly, so perhaps my local configuration is incorrect (it is a recent reinstall of MikTex and TexStudio) or perhaps a tikz issue.
  • The compilation is via TeXstudio's built-in commands. MiKTeX Console has updated to the latest packages.
pdflatex --version MiKTeX-pdfTeX 4.16 (MiKTeX 23.10)
xelatex --version MiKTeX-XeTeX 4.10 (MiKTeX 23.10)
TeXstudio TeXstudio 4.0.2 (git 4.0.2)
Compiled with xelatex Compiled with pdflatex
enter image description hereenter image description here enter image description hereenter image description here

MWE:

\documentclass[a4paper]{article} \usepackage[left=0.9cm, right=0.9cm, vmargin=0.75cm]{geometry} \usepackage{tikz} \definecolor{backgroundcolor}{HTML}{00264B} % -- Background color: \usepackage{background} \backgroundsetup{ scale=1, opacity=1, angle=0, contents={\begin{tikzpicture}[overlay] \path [fill, top color = backgroundcolor, middle color = backgroundcolor, bottom color = backgroundcolor!50] (-10.5,9.9) rectangle (10.5,15) {}; \node [fill, rectangle, top color=backgroundcolor, bottom color=backgroundcolor!50, anchor=north, minimum width=\paperwidth, minimum height=\paperheight]  (-10.5,9.9) rectangle (10.5,15) {}; \end{tikzpicture}} } \begin{document} \section{Section head} xxxxxxxxxxxxxxxxxxxxxxxxxx \end{document} 

Some related Xelatex tikz color issues:

When compiling the MWE below with PDFLatex the linear-gradient color background appears, however when compiled in XeLatex the background is white.

  • (NB: using [fill] produces the salmon color background)
  • The linear-gradient is produced with tikz with \path and \node.
  • The tex file has previously compiled in XeLatex correctly, so perhaps my local configuration is incorrect (it is a recent reinstall of MikTex and TexStudio) or perhaps a tikz issue.
  • The compilation is via TeXstudio's built-in commands. MiKTeX Console has updated to the latest packages.
pdflatex --version MiKTeX-pdfTeX 4.16 (MiKTeX 23.10)
xelatex --version MiKTeX-XeTeX 4.10 (MiKTeX 23.10)
TeXstudio TeXstudio 4.0.2 (git 4.0.2)
Compiled with xelatex Compiled with pdflatex
enter image description here enter image description here

MWE:

\documentclass[a4paper]{article} \usepackage[left=0.9cm, right=0.9cm, vmargin=0.75cm]{geometry} \usepackage{tikz} \definecolor{backgroundcolor}{HTML}{00264B} % -- Background color: \usepackage{background} \backgroundsetup{ scale=1, opacity=1, angle=0, contents={\begin{tikzpicture}[overlay] \path [fill, top color = backgroundcolor, middle color = backgroundcolor, bottom color = backgroundcolor!50] (-10.5,9.9) rectangle (10.5,15) {}; \node [fill, rectangle, top color=backgroundcolor, bottom color=backgroundcolor!50, anchor=north, minimum width=\paperwidth, minimum height=\paperheight]  (-10.5,9.9) rectangle (10.5,15) {}; \end{tikzpicture}} } \begin{document} \section{Section head} xxxxxxxxxxxxxxxxxxxxxxxxxx \end{document} 

Some related Xelatex tikz color issues:

When compiling the MWE below with PDFLatex the linear-gradient color background appears, however when compiled in XeLatex the background is white.

  • (NB: using [fill] produces the salmon color background)
  • The linear-gradient is produced with tikz with \path (\node` also experiences the effect).
  • The tex file has previously compiled in XeLatex correctly, so perhaps my local configuration is incorrect (it is a recent reinstall of MikTex and TexStudio) or perhaps a tikz issue.
  • The compilation is via TeXstudio's built-in commands. MiKTeX Console has updated to the latest packages.
pdflatex --version MiKTeX-pdfTeX 4.16 (MiKTeX 23.10)
xelatex --version MiKTeX-XeTeX 4.10 (MiKTeX 23.10)
TeXstudio TeXstudio 4.0.2 (git 4.0.2)
Compiled with xelatex Compiled with pdflatex
enter image description here enter image description here

MWE:

\documentclass[a4paper]{article} \usepackage[left=0.9cm, right=0.9cm, vmargin=0.75cm]{geometry} \usepackage{tikz} \definecolor{backgroundcolor}{HTML}{00264B} % -- Background color: \usepackage{background} \backgroundsetup{ scale=1, opacity=1, angle=0, contents={\begin{tikzpicture}[overlay] \path [fill, top color = backgroundcolor, middle color = backgroundcolor, bottom color = backgroundcolor!50] (-10.5,9.9) rectangle (10.5,15) {}; \end{tikzpicture}} } \begin{document} \section{Section head} xxxxxxxxxxxxxxxxxxxxxxxxxx \end{document} 

Some related Xelatex tikz color issues:

Source Link
pds
  • 261
  • 2
  • 8

Linear-gradient background in tikz differs when compiled in Xelatex than PdfLatex

When compiling the MWE below with PDFLatex the linear-gradient color background appears, however when compiled in XeLatex the background is white.

  • (NB: using [fill] produces the salmon color background)
  • The linear-gradient is produced with tikz with \path and \node.
  • The tex file has previously compiled in XeLatex correctly, so perhaps my local configuration is incorrect (it is a recent reinstall of MikTex and TexStudio) or perhaps a tikz issue.
  • The compilation is via TeXstudio's built-in commands. MiKTeX Console has updated to the latest packages.
pdflatex --version MiKTeX-pdfTeX 4.16 (MiKTeX 23.10)
xelatex --version MiKTeX-XeTeX 4.10 (MiKTeX 23.10)
TeXstudio TeXstudio 4.0.2 (git 4.0.2)
Compiled with xelatex Compiled with pdflatex
enter image description here enter image description here

MWE:

\documentclass[a4paper]{article} \usepackage[left=0.9cm, right=0.9cm, vmargin=0.75cm]{geometry} \usepackage{tikz} \definecolor{backgroundcolor}{HTML}{00264B} % -- Background color: \usepackage{background} \backgroundsetup{ scale=1, opacity=1, angle=0, contents={\begin{tikzpicture}[overlay] \path [fill, top color = backgroundcolor, middle color = backgroundcolor, bottom color = backgroundcolor!50] (-10.5,9.9) rectangle (10.5,15) {}; \node [fill, rectangle, top color=backgroundcolor, bottom color=backgroundcolor!50, anchor=north, minimum width=\paperwidth, minimum height=\paperheight] (-10.5,9.9) rectangle (10.5,15) {}; \end{tikzpicture}} } \begin{document} \section{Section head} xxxxxxxxxxxxxxxxxxxxxxxxxx \end{document} 

Some related Xelatex tikz color issues: