diff --git a/macros/core/PGbasicmacros.pl b/macros/core/PGbasicmacros.pl
index bde1d92002..25c70aa50f 100644
--- a/macros/core/PGbasicmacros.pl
+++ b/macros/core/PGbasicmacros.pl
@@ -316,7 +316,7 @@ sub NAMED_ANS_RULE {
$tcol = $tcol < 40 ? $tcol : 40; ## get min
MODES(
- TeX => "{\\answerRule[$name]{$tcol}}",
+ TeX => "\\relax{\\answerRule[$name]{$tcol}}",
Latex2HTML => qq!\\begin{rawhtml}\\end{rawhtml}!,
# Note: codeshard is used in the css to identify input elements that come from pg
@@ -360,7 +360,7 @@ sub NAMED_HIDDEN_ANS_RULE {
$tcol = $tcol < 40 ? $tcol : 40; ## get min
MODES(
- TeX => "{\\answerRule[$name]{$tcol}}",
+ TeX => "\\relax{\\answerRule[$name]{$tcol}}",
Latex2HTML => qq!\\begin{rawhtml}\\end{rawhtml}!,
HTML => qq!!
. qq!!,
@@ -413,7 +413,7 @@ sub NAMED_ANS_RULE_EXTENSION {
my $tcol = $col / 2 > 3 ? $col / 2 : 3; ## get max
$tcol = $tcol < 40 ? $tcol : 40; ## get min
MODES(
- TeX => "{\\answerRule[$name]{$tcol}}",
+ TeX => "\\relax{\\answerRule[$name]{$tcol}}",
Latex2HTML =>
qq!\\begin{rawhtml}\n\n\\end{rawhtml}\n!,
HTML => qq! "{\\answerRule[$name]{$tcol}}",
+ TeX => "\\relax{\\answerRule[$name]{$tcol}}",
Latex2HTML =>
qq!\\begin{rawhtml}\n\n\\end{rawhtml}\n!,
HTML => qq!