Document ClassesWould you, in your opinion, say dtx is overkill for a personal class?

Information and discussion about specific document classes and how to create your own document classes.
Post Reply
spramar1
Posts: 5
Joined: Fri Aug 09, 2024 8:30 pm

Would you, in your opinion, say dtx is overkill for a personal class?

Post by spramar1 »

I've decided to dabble in the art of making a LaTeX class (if one has reason to suggest I should make a package instead, I'm all ears) because I want to have more refined control over how the contents of the output document are created by pdflatex. Now, is a dtx file overkill if I don't really intend on publishing on CTAN and mostly intend for personal use?

I've gone through some examples of dtx files and it honestly feels like less juggling multiple concepts if I just make a cls file instead of doing a dtx file. If there is a strong reason to use a dtx over cls for all scenarios, I'm all ears.

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org
LaTeX Beginner's Guide LaTeX Cookbook LaTeX TikZ graphics
User avatar
Stefan Kottwitz
Site Admin
Posts: 10275
Joined: Mon Mar 10, 2008 9:44 pm

Would you, in your opinion, say dtx is overkill for a personal class?

Post by Stefan Kottwitz »

Hi,

welcome to the forum!

It depends. If you plan to write a lot of documentation, it's good to have a dtx file as a single source of truth with documentation and code in the same place. If you just might comment on some source code lines and have a small document about the class, especially if it's just for you and more a reminder for you, I would consider it as overkill. It may be an interesting challenge though. But without dealing with dtx, on the other hand, you could focus more on the cls code and be a bit faster.

Stefan
LaTeX.org admin
spramar1
Posts: 5
Joined: Fri Aug 09, 2024 8:30 pm

Would you, in your opinion, say dtx is overkill for a personal class?

Post by spramar1 »

Thank you Stefan, now, is cls all I truly need? Do I truly require a drv or sty files just to make a class mostly for my own personal use with sprinkles of documentation to clear up any ambiguity with the macros, maybe make a detailed separate .txt file to explain everything and anything the user should know before they use said class. Maybe I might put it somewhere if I think it's something someone else my find useful, just not sure if it would be CTAN. Probably a personal website or something like that.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10275
Joined: Mon Mar 10, 2008 9:44 pm

Would you, in your opinion, say dtx is overkill for a personal class?

Post by Stefan Kottwitz »

I think, if I would do such a thing for my personal purpose, I would at first have a .tex file with some definitions or macros to include, and when it gets bigger, maybe I make a .sty file. I would base it on a common class like from KOMA-Script that already has a huge amount of features, so creating a .cls myself might be an option but very probably I won't do that.

Will you use a class as a base? If not, why not? KOMA-Script classes are extremely feature-rich to be customized.

Stefan
LaTeX.org admin
spramar1
Posts: 5
Joined: Fri Aug 09, 2024 8:30 pm

Would you, in your opinion, say dtx is overkill for a personal class?

Post by spramar1 »

I was going to derive from article as a base. Other packages/classes I've seen online use article, so I thought I should do that as well.
spramar1
Posts: 5
Joined: Fri Aug 09, 2024 8:30 pm

Would you, in your opinion, say dtx is overkill for a personal class?

Post by spramar1 »

What I wanted to do, was do creative writing with LaTeX, more specifically the art of screenwriting. I highly doubt I can make the next Citizen Kane, but I can still make something cool. The formatting is very specific, which I felt I would have very tight control over it using LaTeX.

Image

While there already exists a screenplay class, I wanted to make something more tailored to my own personal usage plus I wasn't really a fan of the choices the creator picked for macros. So I decided to make my own solution. Would you say that I could squeeze this all in a separate tex file and then use a macro to let pdflatex know to include it as a second script to know the macros? Or would a class/package be more suitable for such a thing?
User avatar
Stefan Kottwitz
Site Admin
Posts: 10275
Joined: Mon Mar 10, 2008 9:44 pm

Would you, in your opinion, say dtx is overkill for a personal class?

Post by Stefan Kottwitz »

With such specific requirements and if you want to create all formatting from scratch, a class file is perfect. With a .sty file or .tex for input, it's probably to much.

However, my way would be starting with scrartcl (or scrreprt or scrbook) and using the ton of class feature to customize fonts, paragraphs, sections, layout and page dimensions, page numbering etc. with just using class options and class commands. That can be in a .sty file. Plus additional own macros.

Stefan
LaTeX.org admin
Post Reply