I ran across a sentence. We all have been working hard on this. In the sentence, I'd like to know whether the use of "all" is correct or not.
Yes, it's correct grammatically.
But you usually use "all" immediately after a subject pronoun when there's no auxiliary. For example:
We all worked hard on this.
In case of an auxiliary or two auxiliaries, you usually use it after the first auxiliary. For examples:
We are all working hard on this.
We have all been working hard on this.
Alternatively, you can start your sentence with all of + object pronoun. For example:
All of us have been working hard on this.
The use of "all" after the subject pronoun in the sentence with two auxiliaries presented by the OP is correct grammatically, but it's less common.
Some people use all after the second auxiliary, which is also less common. For example:
We have been all working hard on this.
Yes, I believe so. According to dictionary.cambridge.org (you might need a subscription),
All as an adverb
When all refers to the subject of a clause, it usually comes in the normal mid position for adverbs (between the subject and the main verb, or after the modal verb or first auxiliary verb, or after be as a main verb):
- The kids all go to school on the same bus.
- These items could all have been bought cheaper on the Internet.
- The students are all here now. We can start.