# How can I make a geometric representation of an infinite sum in latex code?

I am trying to make a graphical solution for the infinite sum of 1/2^n. It is simple if we draw a 1x1 square, and start representing this sum inside the square. could someone tell me how I could draw this with latex code? I attach an image to make it clearer.

• This is fairly easy to do via tikz, but note that this site is not a please do this for me service. Please show what you have so far besides the image. Sep 27 at 9:05

I hope this question and answer helps you.

How to Create a Fast Code with TikZ Using MATHCHA

I am not an expert as well, but this way was helpful for me! Following the steps in the above link,

1. Go to this site https://www.mathcha.io/editor
2. Add geometric objects in the "Diagram" part. (and remove all other default things with 'delete' key in your key board)
3. Export the image you drew as tikz codes(copy at your clipboard)
4. Write "\usepackage{tikz}" up in your latex codes
5. Paste the tikz codes(in step 3) to appropriate location(inside "\begin{document}" and "\end{document}")

for example, I drew simple figure using these steps and the resulting figure was like below.(Since the actual codes will not directly help you, I just attach the whole codes and sample image written in overleaf site.)

• Welcome to TeX.SE! Sep 27 at 11:00