1

enter image description here

\documentclass[a4paper]{article}

\title{Using PSTricks with pdflatex on overleaf}
\author {Overleaf}

\usepackage{pst-node}
\usepackage{pst-coil}
\usepackage{auto-pst-pdf}

\usepackage{graphicx}
\usepackage{hyperref}
\pagestyle{empty}

\begin{document}
\maketitle
This is a PSTricks drawing:

\psset{subgriddiv=0}
\SpecialCoor
\psset{griddots=5, subgriddiv=0,gridlabels=5pt}


\begin{pspicture}(14,14)\psgrid
\rput(3.2,7.2) {$A$}
\rput(10.8,6.8) ($B$}
\rput(6.8, 10.8){$C$}
\rput(7.2,3.2) ($D$}
\rput(6.8,7.2){$0$}
\pscircle(7,7){4}
\psline[linecolor=red, linewidth=1.5pt](7,3) (3,7) (11,7) (7,11) (7,3) (7,11)
\rput(1,2.2) {$r$}
\end{pspicture}

\end{document)
1
  • 3
    Do you specifically require pstricks or are you open to a solution using tikz? – Markus G. May 4 at 9:08
0

With a code simplification using pst-eucl:

\documentclass[a4paper]{article}

\title{Using PSTricks with pdflatex on overleaf}
\author {Overleaf}

\usepackage{pst-node, pst-eucl}
\usepackage{pst-coil}
\usepackage{auto-pst-pdf}
\usepackage{siunitx}
\usepackage{graphicx}
\usepackage{hyperref}
\pagestyle{empty}

\begin{document}
\maketitle
%This is a PSTricks drawing:

\psset{subgriddiv=0}
\SpecialCoor
\psset{griddots=1, subgriddiv=0, gridlabels=5pt, gridwidth=1.5pt, linejoin=1}

\begin{pspicture}(14,14)
\pstGeonode[PosAngle={60,-150,-120,60,130}, PointSymbol=none, PointNameSep=1.5em](3,7){A}(11,7){B}(7,11){C}(7,3){D}(7,7){O}
\pscircle(7,7){4}
\pstRightAngle{A}{O}{D}
\pstMarkAngle[MarkAngleRadius=0.7]{D}{A}{B}{\SI{45}{\degree}}
\pstRightAngle{B}{O}{C}
\psline[linecolor=red, linewidth=1.5pt](A)(B)(C)(D)(A)
\psgrid
\rput(1,2.2) {$r$}
\end{pspicture}

\end{document} 

enter image description here

1
  • You don't realise but you just helped me get full marks in an examination. Thank you so much. – Zapruder May 4 at 12:46
1

If you want to use tikz, this is another possibility:

\documentclass[border=2mm]{standalone}
\usepackage{siunitx} % for display angles (\ang command)
\usepackage{tikz}

\begin{document}
\begin{tikzpicture}[line cap=round,line join=round]
\draw[thick]     (0,0) circle (4);
\draw[thick,red] (4,0) -- (-4,0) -- (0,-4) -- (0,4) -- cycle;
\draw (0, 0.5) -| ( 0.5,0);
\draw (0,-0.5) -| (-0.5,0);
\draw (-3.5,0) arc (0:-45:0.5) node [midway,right] {\ang{45}};
\foreach\x in {-5,...,5} \foreach\y in {-4,...,4}
{% the little dots
  \fill (\x,\y) circle (0.5pt);
}
\node at ( 0, 0) [above left]  {$O$};
\node at (-4, 0) [above right] {$A$};
\node at ( 4, 0) [below left]  {$B$};
\node at ( 0, 4) [below left]  {$C$};
\node at ( 0,-4) [above right] {$D$};
\end{tikzpicture}
\end{document}

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.