0

getting a Argument of \math@egroup has an extra } error that disappears as soon as I comment out the breqn 3 lines

\documentclass[12pt]{article}  
\usepackage[letterpaper,margin=1in]{geometry}
\usepackage[utf8]{inputenc}

\usepackage{subcaption}
 \usepackage{amssymb}
 \usepackage{amsmath,amssymb,amstext,amsthm}
%\usepackage[ backend=biber,
%style=alphabetic,
%sorting=ynt
%]{biblatex}
%\addbibresource{main.bib}
\usepackage{mathpazo}
\usepackage[mathpazo]{flexisym}  %required by breqn
\usepackage{breqn}   % auto next lines equations running off page

% \usepackage{mathpazo}
% \usepackage[mathpazo]{flexisym}  %required by breqn
% \usepackage{breqn} 
\begin{document}

$ y \in \mathbb{R}^ \mathcal{C}  $ 

\end{document}

Also breqn doesn't seem to auto next line properly should I try a different package?

\documentclass[12pt]{article}  
\usepackage{amsmath} 
\usepackage{mathpazo}
\usepackage[mathpazo]{flexisym}  %required by breqn
\usepackage{breqn} 

\begin{document}
Consider the following list $a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2,,a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2, a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2, a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2,,a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2, a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2,a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2,,a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2, a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2,a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2,,a,1,2,3,4,5,67,3,2,2,2,,2,2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,,2,2,2,2,2,2,2,2,2,2,22,2,2,2,a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2,,a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2, a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2,a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2,,a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2, a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2,a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2,,a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2, a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2,$   
%
\end{document}
Zarko
  • 296,517
Hao S
  • 858

1 Answers1

2

I'm not sure that breqn can help in that case. Here's working code.

\documentclass[12pt]{article}  
\usepackage{amsmath} 
\usepackage{mathpazo}
\usepackage{xparse}

\ExplSyntaxOn
\NewDocumentCommand{\mlist}{m}
 {
  \group_begin:
  \thinmuskip=3mu plus 3mu
  \seq_set_split:Nnn \l_tmpa_seq { , } { #1 }
  $\seq_use:Nn \l_tmpa_seq { ,\allowbreak }$
  \group_end:
 }
\ExplSyntaxOff

\begin{document}
Consider the following list \mlist{a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,
  22,2,2,2,,a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2,a,1,2,3,4,5,67,
  3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2, a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,
  2,2,22,2,2,2,,a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2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,2,2,2,2,2,2,22,2,2,
  2, a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2,a,1,2,3,4,5,67,3,2,2,2,,
  2,2,2,2,2,2,2,2,2,2,22,2,2,2,,a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,2,
  2,2, a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2, a,1,2,3,4,5,67,3,2,2,
  2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2,,a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,
  2,2,2, a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2,a,1,2,3,4,5,67,3,2,
  2,2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2,,a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,
  22,2,2,2, a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2,a,1,2,3,4,5,67,
  3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2,,a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,
  2,2,22,2,2,2, a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2,a,1,2,3,4,5,
  67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2,,a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,
  2,2,2,22,2,2,2, a,1,2,3,4,5,67,3,2,2,2,,2,2,2,2,2,2,2,2,2,2,22,2,2,2,}

\end{document}

enter image description here

If you want to automatically remove empty entries:

\ExplSyntaxOn
\NewDocumentCommand{\mlist}{m}
 {
  \group_begin:
  \thinmuskip=3mu plus 3mu
  \clist_set:Nn \l_tmpa_clist { #1 }
  $\clist_use:Nn \l_tmpa_clist { ,\allowbreak }$
  \group_end:
 }
\ExplSyntaxOff

Compare the first lines:

enter image description here

egreg
  • 1,121,712
  • actually I just wanted to have an like auto don't run off page thing which I thought was breqn
    what does your code do?
    – Hao S Aug 08 '19 at 03:20
  • @HaoSun breqn does automatic splitting of displays, inside the specialized environments it defines. – egreg Aug 08 '19 at 09:20