qinglee / wrapstuff

Wrapping text around stuff
https://ctan.org/pkg/wrapstuff
LaTeX Project Public License v1.3c
13 stars 4 forks source link

Not compatible with package circledtext sometimes #17

Open Piaoshi opened 6 months ago

Piaoshi commented 6 months ago
\documentclass{article} 
\usepackage{ctex}
\usepackage{circledtext}
\usepackage{wrapstuff}
\begin{document}

\begin{wrapstuff}[r]
  \large \bfseries AA \circledtext{1} : \verb|\circledtext{2}| AA
\end{wrapstuff}
\circledtext{1} This case produces \LaTeX{} Error 
as \verb|\circledtext{1}| is at the beginning of the paragraph.
The wrapsuff does not work and output nothing.
I use xelatex to compile.

\end{document}
muzimuzhi commented 6 months ago

Simplified \circledtext{1} to {\indent}.

\circledtext{1} uses \coffin_typeset:Nnnnn in a group and the latter expl3 function starts with \mode_leave_vertical:.

\documentclass{article} 
\usepackage{wrapstuff}

\begin{document}

\begin{wrapstuff}
  \Large\bfseries Wrapped stuff
\end{wrapstuff}
{\indent}%
Text text

\end{document}

Using pdflatex or xealatex or lualatex, the error raised is

! Extra }, or forgotten \endgroup.
muzimuzhi commented 6 months ago

Workaround: prepend the \circledtext{1} that starts the paragraph with \leavevmode.

Piaoshi commented 6 months ago

Thanks,\leavevmodeis the solution, though I am not clear about \leavevmode . Does \leavevmode have side effect? Is it OK if I use \leavevmode after every wrapstuff? Or put it in wrapstuff package?

muzimuzhi commented 6 months ago

Better to prepend \leavevmode/\mode_vertical_leave: to \circiledtext instead.

muzimuzhi commented 5 months ago

Duplicate of #11