Which elements can be omitted from the "not only ... but also" construction?
Since, by this answer, both of these sentences are correct:
Not only should you be able to speak, but also should you be able to write.
Not only should you be able to speak, but also to write.
Is this one correct too?
Not only should you be able to speak, but also be able to write.
What is the rule for omissions here? I'm asking because I wrote this and it doesn't sound correct to me:
This not only allows you to maintain a uniform visual style, but also to introduce new developers to your codebase.
This option is less economical, but somehow it feels right: "This not only allows you to maintain a uniform visual style, but also allows you to introduce new developers to your codebase."
Which do you think is more understandable/natural? I'm not a native speaker of English.
Solution 1:
The basic rule is that the matter following not only should parallel the matter following but also--the two should play the same syntactic role in the sentence.
So this is clumsy:
This not only allows you to maintain a uniform visual style,
but also ______ ___ to introduce new developers to your codebase.
To introduce is not parallel with allows you. But you may easily clean this up by moving not only
This allows you not only to maintain a uniform visual style,
but also to introduce new developers to your codebase.
Your other examples are a little harder to illustrate, because a) the inversion you employ when not only launches the sentence has to go away in the but also piece, and b) the also has to move; but the principle is the same:
Not only should you be able to speak,
but you should also be able to write.
Note that you can drop the but in this case. You can see the pattern more clearly without the inversion:
You should not only be able to speak,
but also be able to write.
OR
You should be able not only to speak,
but also to write.
Solution 2:
I would regard the use of "also" as (stylistic) pleonasm, even if it is well-attested and therefore, by definition, "grammatical".
Not only should you be able to speak but (be able) to write.
You should be able not only to speak but to write.
Your example
This {thing} allows you not only to maintain a uniform visual style, but also allows you to introduce new developers to your codebase.
doesn't gain much by the "not only x but y" pattern; in fact, I think it loses clarity as a result of it. The relationship of the two ideas (uniform visual style, introducing new developers) is not immediately apparent. I'd make two sentences out of it, and expand on how new developers can be more readily introduced because of the uniformity of visual style.