How do I create geometry files for carbon nanoribbons and molecular junctions for DFTB+?

I am currently learning DFTB+ using the tutorials on the official website :

How do I go about creating the geometry files for the systems used in these tutorials?

So far, I have been using Avogadro for creating xyz files but I haven't created "planar periodic" structures as illustrated in the tutorials.

• +1 Welcome to our new community and thank you so much for contributing your question here! We hope to see much more of you in the future !!! – Nike Dattani May 11 at 6:16
• Question on Chem SE. Posting a question on multiple sites is generally discouraged. You should delete the Chem SE one or include a link to the other version in each question. This helps other users see if/where a question has been answered and avoids multiple users answering a question without being aware of existing answers. – Tyberius May 11 at 11:41

Since you know how to use Avogadro to create XYZ files, a very simple solution to your problem is to simply create the XYZ file then use an xyz2gen script to convert fron XYZ format to the GEN format you seek. This is an example of a script that converts from XYZ to DFTB+ format.