I'm somewhat new to LaTeX, and since I'm used to more traditional OO programming languages like Java, C, or Python this is bugging me as it seems like very basic syntax for LaTeX. I'm wondering if there's a good general resource for this level of syntax as I feel like this would be useful for writing LaTeX packages too.
I'm kind of confused as to what the distinction between {}
and []
is in LaTeX as it seems like both serve as a way of specifying parameters, but it seems like other LaTeX may work inside {}
. I want to say {}
is just generally a syntax block, but it's not quite analogous to it's usage in Object Oriented which is probably why I would want to jump to syntax blocks anyway.
Ultimately LaTeX has a lot more in common with markup than object oriented programming from what I've seen, so making a comparison with OOP might not always make sense here. That said, I can't help but notice a functional analogy with \command{something}
being a function call (or even a C macro usage perhaps) essentially, which is probably getting into defining commands a bit too. I'd be interested in understanding if this has any connection for LaTeX command definition or if that's purely coincidental similarity and there's a completely different meaning and explanation for that.