Aside from not leaving any blank line within the list of options (equivalent to a
\par token), I don't think there is any particular restriction.
My preferred formatting style for loading packages is shown below.
left = 1in,
right = 1in,
top = 1.5in,
headheight = 1in,
headsep = .3in,
Let me rationalise it, lest my answer be perceived as primarily opinion-based.
- Each option should be on a line on its own, so it can be easily commented/uncommented without having to reformat the code or delete stuff. For this to work, the first option should be on a dedicated line (i.e. not on the same line as
\usepackage), and the last option too should be on a dedicated line (i.e. not on the same line as the closing
- Package options should be indented by one tab stop to make the options stand out.
- If there are many
key=value pairs, aligning the equal signs vertically usually makes the code much easier to read.
Addendum (by Speravir)
There’s a variation, where the commas are set in front of all, for people, who too easily tend to delete them at the end when changing a value:
,left = 1in
,right = 1in
,top = 1.5in
,headheight = 1in
,headsep = .3in
You could even have commas before and after each key-value pair, because empty strings are stripped, as well.