2

I have a class file that is used by my students to create their final year project reports. The class imposes a style and limits the number of pages the students can write.

However, there is nothing that prevents students from using commands to change indentation, line spacing etc.

I guess, my question is: is there a class of commands that can all be disabled as being "low level"

Pierre
  • 883
  • 3
    Not really, and everything you impose can be overwritten. – daleif Jul 09 '19 at 13:22
  • 1
    You can un-define such commands (or define them to throw an error), like \let\parindent\@undefined. But it will be hard to hunt all of them (TeX's primitives plus LaTeX's commands, plus possible packages), and it's most likely it will break something. Also this will take effect after the \documentclass, so if they really want to they can do something before that. A "you shall not pass" kind of warning might work better. – Phelype Oleinik Jul 09 '19 at 13:24
  • 2
    @PhelypeOleinik er after \let\parindent\@undefined then every \centering or \raggedright or \parbox or minipage or tabular p column and every itemize or enumerate list would give an error. – David Carlisle Jul 09 '19 at 14:11
  • @DavidCarlisle That's why I said it will most likely break something. Of course "most likely" is an euphemism :-) – Phelype Oleinik Jul 09 '19 at 14:17

1 Answers1

2

TeX is a macro expansion language. Definitions are not like functions in a compiled language where the implementation details are hidden and underlying commands can be changed without affecting the defined commands.

The definitions are simply expanded in place with each macro being replaced by its replacement text until a primitive is encountered.

That means that you can not disable specifying paragraph indentation (for example) without disabling every command (lists, section heads, ....) that uses \parindent internally.

The above isn't quite true, there are always things you can do, (for example your class could define section commands to locally restore the original definitions) but it is near enough true to mean that disabling this at the technical level is not possible. You have to enforce the house style by social means (or administrative control) not via TeX definitions.

David Carlisle
  • 757,742