How to represent whitespace in a context-free grammar?
This is a classical confusion between language and metalanguage.

More generally, you have the same problem when you want to include in
your symbols, expecially terminal symbols, characters that have
syntactic meaning in the syntax of grammars, for example the symbol
"|" which is often used to give on the same line all possible
right-hand-sides for a given non-terminal.

In such a case, you do what I just did: use some mechanism for
quotation, such as "|", or " " in the case of a space. Some form of quoting is the usual technique to avoid confusion between language and metalanguage.
And as you remarked, the language of grammars already uses the space for its own (lack of) purposes.

So you write:

S -&gt; xAx
A -&gt; " "


Of course, the spaces outside the quotes still play the same role as before, wherever allowed. So the grammar could be written as well:

S -&gt;  x A  x
A  -&gt;   " "


Whatever is within quote must be written exactly as expected.

However, in many contexts (such as programming language syntax), it is implicit that you can add spaces wherever you want between terminal. So you have to be clear whather you just want one compulsory space where you have the terminal " ", or whether you forbid spaces, unless specified by the syntax as done here.

The quotation marks are metasyntax, i.e. part of the language used to write the grammar, like the arrow. The analyser (whether LR(1) or any other) will ignore the quotes, as it ignores the arrow -&gt;. It would work as well with a grammar written as [(S,xAx)(A," ")]. Some metalanguages for writing grammars, such as BNF, simplify the issue by making the quotes compulsory around terminals ... though there is still a problem when terminals include the quoting symbols ... but this has solutions.

Another question you may want to look at is: What are the meanings of metalanguage and metasyntax and EBNF?