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

Seraf Fej
  • 133
  • 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 '23 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. – Raffaele Santoro Sep 25 '23 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 '23 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 '23 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 '23 at 15:06
  • I think this is (almost) the same as https://tex.stackexchange.com/questions/217879/tikz-pattern-north-west-lines-dashed or https://tex.stackexchange.com/questions/212551/is-tikz-sending-ambiguous-pdf-instructions-that-only-texstudio-understands-well – Rmano Sep 25 '23 at 15:34

1 Answers1

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

  • When I run this identical code on overleaf I still get the same results as in my original question. – Seraf Fej Sep 25 '23 at 14:48
  • 1
    @SerafFej please update your question where you also specify which TeXLive version you are using on OverLeaf. – daleif Sep 25 '23 at 14:56
  • @SerafFej I get the same result af Raffaele using TeXlIve 2019-2023 – daleif Sep 25 '23 at 14:58
  • I have updated the post. Very strange. Could this be related to https://tex.stackexchange.com/questions/217879/tikz-pattern-north-west-lines-dashed – Seraf Fej Sep 25 '23 at 15:00
  • @SerafFej It is, see my comment above. – daleif Sep 25 '23 at 15:01
  • 1
    I think the problem is the preview of OverLeaf. Look at pdf result. – Raffaele Santoro Sep 25 '23 at 15:01
  • Yes, correct. Both the preview on overleaf and viewing the pdf on Firefox caused the issue. When I open with Preview it is resolved. Thank you! – Seraf Fej Sep 25 '23 at 15:07
  • @RaffaeleSantoro Feel free to update your answer and I will accept as correct for future readers :) – Seraf Fej Sep 25 '23 at 15:08
  • @SerafFej My answer is complete and updated. Nothing to add. I dont use OverLeaf. – Raffaele Santoro Sep 25 '23 at 15:16
  • @RaffaeleSantoro Your answer implies the issue was my not using the complete code. This is incorrect. The issue persists even with your code. The real issue is with how the code is rendered with different PDF viewers. This should be included in the answer for it to be correct and useful to future readers with the same problem. – Seraf Fej Sep 26 '23 at 10:06