0

I am attempting to reproduce a pattern fill from the tikz documentation. Specifically, I run

\usetikzlibrary {patterns,patterns.meta} 
\begin{tikzpicture}

\draw[pattern={Lines[angle=45,distance={3pt/sqrt(2)}]},pattern color=blue]
(0,1) rectangle +(1,1);

\end{tikzpicture}

Which should output northeast lines as pictured

expected output

However, when I run this on overleaf I obtain dashed lines

actual output

Is there a way to ensure this command outputs lines without dashes?

Edit in response to comments

To confirm the issue, I have created a new project on overleaf, input the suggested code and still obtain the same results. See the screenshot below using TeX Live version 2023 (although the issue seems to persist on previous versions too.

overleaf reproduce

6
  • 1
    Please show the full code we can compile because currently it's not clear why your output is incorrect. See this link: I've just been asked to write a minimal working example (MWE), what is that? for deetails.
    – Celdor
    Sep 25 at 14:30
  • Look at the pdf result also. In preview I look some white dot in the lines pattern. In the pdf the result is correct. Sep 25 at 14:36
  • 1
    Though the patterns.meta library is known for having many issues (some holes in the lines, for example, and some aligment problems), your code compiles correctly and doesn't provide dashed lines.
    – SebGlav
    Sep 25 at 14:39
  • 1
    Have you tried a different PDF renderer? I can repreduce it using overleaf in firefox. But not using standalone TL23 rendered using Evince on Linux.
    – daleif
    Sep 25 at 15:00
  • Ah wow, yes this was it. When I render using Firefox the issue occurs but when I render with Preview it is resolved. Thank you very much!
    – Seraf Fej
    Sep 25 at 15:06

1 Answer 1

1

Whit this COMPLETE code:

\documentclass[tikz, border=10pt]{standalone}
\usetikzlibrary {patterns,patterns.meta} 
\begin{document}
    \begin{tikzpicture}[scale=3]
        \draw[pattern={Lines[angle=45,distance={3pt/sqrt(2)}]},pattern color=blue]
        (0,1) rectangle +(1,1);
    \end{tikzpicture}
\end{document}

I have this result:

enter image description here

10
  • When I run this identical code on overleaf I still get the same results as in my original question.
    – Seraf Fej
    Sep 25 at 14:48
  • 1
    @SerafFej please update your question where you also specify which TeXLive version you are using on OverLeaf.
    – daleif
    Sep 25 at 14:56
  • @SerafFej I get the same result af Raffaele using TeXlIve 2019-2023
    – daleif
    Sep 25 at 14:58
  • I have updated the post. Very strange. Could this be related to tex.stackexchange.com/questions/217879/…
    – Seraf Fej
    Sep 25 at 15:00
  • 1
    I think the problem is the preview of OverLeaf. Look at pdf result. Sep 25 at 15:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .