-1

I designed this header, but it doesnt my ideal drawing thank you enter image description here

\fancypagestyle{mainstyle}{%
\fancyhf{}
\fancyhead[LO,RE]{\myfancynum}

\fancyhead[LE]{%
  \begin{tikzpicture}[overlay,remember picture]
    \node[anchor=west] at ([xshift=12ex,yshift=-14ex]current page.north west) {\textcolor{cyan}{\rl{ نظام جامع آماری شهرداری تهران}}};
  \end{tikzpicture}%
}
\fancyhead[RO]{%
  \begin{tikzpicture}[overlay,remember picture]
%    \node[anchor=east] at ([xshift=-12ex,yshift=-14ex]current page.north east){\textcolor{cyan}{\large\rl{\leftmark}}};
  \end{tikzpicture}%
%\textcolor{cyan}{\leftmark}
}
\renewcommand{\headrulewidth}{0pt}
\pagestyle{fancy}
\linespread{1}
\newcommand{\myfancynum}{%
  \begin{tikzpicture}[remember picture,overlay,yshift=2cm]
      \path (0,0) [use as bounding box]
        node[diamond, draw=white, inner sep=0pt, minimum size=32pt] (pageno) {\thepage} ;
         \node[draw=cyan,star,star points=8,star point ratio=1.25] at (0,0) {\thepage};

%\pic at (0,0) {diamond={name=a}};
%\node at (a.center){\thepage};
%\pic at (0,0) {diamond={name=a}};
%\node at (a.center){\thepage};
    \checkoddpage\ifoddpage
    % 36pt = 32pt + 4pt +4pt; 
    \path (pageno.west) node[fill=cyan, fill opacity=0.4, diamond, inner sep=0pt, minimum size=16pt] {};
   \draw[cyan] (pageno.north) ++(0, +4pt) -- ++(55pt, -55pt) -- ++(2\linewidth,0);

    \draw[cyan] (pageno.east) ++(4pt, 0) -- ++(-60pt, -60pt) -- ++(0, -4cm);


    \else
    \path (pageno.east) node[fill=cyan, fill opacity=0.4, diamond, inner sep=0pt, minimum size=16pt] {};
    \draw[cyan] (pageno.north) ++(0, +4pt) -- ++(-55pt, -55pt) -- ++(-2\linewidth,0);%-40,-40
    \draw[cyan] (pageno.west) ++(-4pt,0) -- ++(60pt, -60pt) -- ++(0, -4cm);

    \fi
    \end{tikzpicture}%
}
\fancyfoot[OL]{%
  \begin{tikzpicture}[overlay,remember picture]
\foreach \x in {1,...,250}
\draw[color=cyan,xshift=2cm,yshift=-0.5cm] node  {\color{cyan}\rule{\paperwidth}{.1pt}};
\node[fill=cyan, fill opacity=1, diamond, inner sep=0pt, minimum size=16pt,xshift=12.4cm,yshift=-0.5cm] {};
  \end{tikzpicture}%
}

\fancyfoot[ER]{%
  \begin{tikzpicture}[overlay,remember picture]
\foreach \x in {1,...,250}
%\draw[color=cyan,xshift=-2cm,yshift=-1.5cm] node  {\color{cyan}\rule{\paperwidth}{.1pt}};
%\node[fill=cyan, fill opacity=1, diamond, inner sep=0pt, minimum size=16pt,xshift=-12.4cm,yshift=-1.5cm] {};%cric fot
%
\draw[color=cyan,xshift=-2cm,yshift=-0.5cm] node  {\color{cyan}\rule{\paperwidth}{.1pt}};
\node[fill=cyan, fill opacity=1, diamond, inner sep=0pt, minimum size=16pt,xshift=-12.4cm,yshift=-0.5cm] {};%cric fot
  \end{tikzpicture}%
}
}
\renewcommand{\headrulewidth}{0pt}
%\fancypagestyle{tocstyle}{%
%\fancyhf{} 
%\fancyhead[C]{%
%\begin{tikzpicture}[overlay,remember picture]
%j
%\end{tikzpicture}
%}
% }
  • 1
    I nominated for re-open because I think that we have mostly a language problem, here. I will add what I think it's a possible answer (if I understood correctly). I think that the OP is trying to modifying my original answer, but trying to use code from GeoGebra he is not able to fit it in. – Rmano Jun 28 '19 at 07:39
  • Esmalii, look if the added answer to my original one can help you. But I strongly advise you to seek help for your English language skills in this forum; it's really difficult to understand where the problem was. No offence intended; I would do much worse in Parsi, but this forum is English-only... – Rmano Jun 28 '19 at 08:01
  • @Rmano which answer are you referring to? https://tex.stackexchange.com/questions/367158/header-page-book-in-tikz maybe? Anyway, I think the question is still rather broad and unclear. – Marijn Jun 28 '19 at 12:37
  • @doni maybe you can explain your problem in more detail? What output or which errors do you get? Which parts do you want to improve? Also, could you post a complete minimal document, instead of just a fragment? – Marijn Jun 28 '19 at 12:39
  • @Marijn, yes, it is this one https://tex.stackexchange.com/a/367190/38080 (I extended it just this morning). I think that the OP has problems with the bounding boxes and the anchors... – Rmano Jun 28 '19 at 13:24
  • @down-voters: Please don't downvote below a score of -1, even if the question in its current form needs some improvement. A score of -1 is enough to show that the question needs work, anything below that is of no use. Also, if you downvote or vote to close, please leave a comment explaining why you did so, but wait at least 24 hours after asking the OP for improvements to the question before voting to close. – Mensch Jun 28 '19 at 16:59
  • Also, please note this question is not very old - and less visibly - has already been closed before. The OP should have a chance to update and clarify the question first, if even they are in some other time zone. – Andrew Swann Jun 28 '19 at 20:21

1 Answers1

4

This is merely to inform you about the existence of the tikzpagenodes package, which may be of use here. Unfortunately you do not provide a complete document so there are too many unknowns. In particular the information on the document class is essential here, but I feel I won't be able to provide a full answer anyway because I am not at all familiar with fonts, but you are using \rl. Please feel free to use whatever may be useful here in an updated version of your question.

\documentclass{book}
\usepackage{fancyhdr}
\usepackage{ifoddpage}
\usepackage{lipsum}
\usepackage{tikzpagenodes}
\usetikzlibrary{shapes.geometric}
\fancypagestyle{mainstyle}{%
\fancyhf{}
\fancyhead[LO,RE]{\myfancynum}

\fancyhead[LE]{%
  \begin{tikzpicture}[overlay,remember picture]
%     \node[anchor=west] at ([xshift=12ex,yshift=-14ex]current page.north west) 
%   {\textcolor{cyan}{\rl{ AAAAAAAAAAAA AAAAAAAAAAAA AAAAAAAAAAAAAAA AAAAAAAAAAAAAAAAAAAAA AAAAAAAAAAAAAAA}}};
  \end{tikzpicture}%
}
\fancyhead[RO]{%
  \begin{tikzpicture}[overlay,remember picture]
%    \node[anchor=east] at ([xshift=-12ex,yshift=-14ex]current page.north east){\textcolor{cyan}{\large\rl{\leftmark}}};
  \end{tikzpicture}%
%\textcolor{cyan}{\leftmark}
}
\renewcommand{\headrulewidth}{0pt}
\pagestyle{fancy}
\linespread{1}
\newcommand{\myfancynum}{%
\begin{tikzpicture}[remember picture,overlay]
 \checkoddpage\ifoddpage
    % 36pt = 32pt + 4pt +4pt; %<- interesting math
    \path (current page text area.north west) -- 
     (current page.north west) node[midway,draw=cyan,star,star points=8,star
     point ratio=1.25] (pageno) {\thepage};

    \path (pageno.west) node[fill=cyan, fill opacity=0.4, diamond, inner sep=0pt, minimum size=16pt] {};
    \draw[cyan] (pageno.north) ++(0, +4pt) -- ++(55pt, -55pt) coordinate(aux)
     -- (current page.east|-aux);
    \draw[cyan] (pageno.east) ++(4pt, 0) -- ++(-60pt, -60pt) -- ++(0, -4cm);
\else
    \path (current page text area.north east) -- 
    (current page.north east) node[midway,draw=cyan,star,star points=8,star
    point ratio=1.25] (pageno) {\thepage};
    \path (pageno.east) node[fill=cyan, fill opacity=0.4, diamond, inner sep=0pt, minimum size=16pt] {};
    \draw[cyan] (pageno.north) ++(0, +4pt) -- ++(-55pt, -55pt) coordinate(aux)
     -- (current page.west|-aux);    
    \draw[cyan] (pageno.west) ++(-4pt,0) -- ++(60pt, -60pt) -- ++(0, -4cm);

    \fi
\end{tikzpicture}%
}
\fancyfoot[OL]{%
  \begin{tikzpicture}[overlay,remember picture]
\foreach \x in {1,...,250}
\draw[color=cyan,xshift=2cm,yshift=-0.5cm] node  {\color{cyan}\rule{\paperwidth}{.1pt}};
\node[fill=cyan, fill opacity=1, diamond, inner sep=0pt, minimum size=16pt,xshift=12.4cm,yshift=-0.5cm] {};
  \end{tikzpicture}%
}

\fancyfoot[ER]{%
  \begin{tikzpicture}[overlay,remember picture]
\foreach \x in {1,...,250}
%\draw[color=cyan,xshift=-2cm,yshift=-1.5cm] node  {\color{cyan}\rule{\paperwidth}{.1pt}};
%\node[fill=cyan, fill opacity=1, diamond, inner sep=0pt, minimum size=16pt,xshift=-12.4cm,yshift=-1.5cm] {};%cric fot
%
\draw[color=cyan,xshift=-2cm,yshift=-0.5cm] node  {\color{cyan}\rule{\paperwidth}{.1pt}};
\node[fill=cyan, fill opacity=1, diamond, inner sep=0pt, minimum size=16pt,xshift=-12.4cm,yshift=-0.5cm] {};%cric fot
  \end{tikzpicture}%
}
}
\renewcommand{\headrulewidth}{0pt}
%\fancypagestyle{tocstyle}{%
%\fancyhf{} 
%\fancyhead[C]{%
%\begin{tikzpicture}[overlay,remember picture]
%j
%\end{tikzpicture}
%}
% }

\pagestyle{mainstyle}
\begin{document}
\chapter{Pft}
\lipsum[1-10]
\end{document}

enter image description here