# patta42/lipsum

Closed
opened this Issue Dec 24, 2018 · 8 comments

Projects
None yet
2 participants

### polysyllabic commented Dec 24, 2018

 The current version appears to be expanding paragraphs in a way that produces incorrect behavior with both the KOMA-Script addmargin and the changepage adjustwidth environment. For both, only the first and last lipsum paragraphs have the adjusted length. Anything in the middle goes to the full text width. This problem does not occur with lipsum 1.3. \documentclass{scrreprt} \usepackage{changepage} \usepackage{lipsum} \begin{document} \begin{addmargin}[0pt]{.5\textwidth} \lipsum [1-3] \end{addmargin} \begin{adjustwidth}{0pt}{.5\textwidth} \lipsum [1-3] \end{adjustwidth} \end{document} 
Owner

### patta42 commented Dec 24, 2018

 I can confirm this weird behavior and I have no faint idea where it does come from. lipsum does not use any boxes that specify a length, thus this might(!) be a bug related to latex3, but again, I have no idea. Alas, I do not even have a workaround (except for using \lipsum[1]\par\lipsum[2]\par.... I'll try to figure out what happens here when I have time. Thanks for reporting!

### polysyllabic commented Dec 24, 2018

 Whatever is causing it, kantlipsum (also expl3, I believe) works fine.
Owner

### patta42 commented Dec 25, 2018

 It was easier than I thought. I haven't looked into the details of the two environments, but it seems they somehow scan for the occurrence of \par within their content. lipsum.sty, however, uses (not everywhere, there are some inconsistencies, I found out now) \tex_par:D instead of \par as recommended by the docs of latex3 (see interface3.pdf (describing release 2018/10/31), page 7, docs for package l3names). I guess this is more an incompatibility of KOMA-Script and changepage with latex3 than a bug in lipsum, but I agree that this leads to highly unexpected results. So I guess I will patch it and release a next version (in a few days). As long as the new version is not available, here is a workaround: \documentclass{scrreprt} \usepackage{changepage} \usepackage{lipsum} \SetLipsumParListItemSeparator{\par} \begin{document} \begin{addmargin}[0pt]{.5\textwidth} \lipsum[1-3] \end{addmargin} \begin{adjustwidth}{0pt}{.5\textwidth} \lipsum[1-3] \end{adjustwidth} \end{document} 

### polysyllabic commented Dec 25, 2018

 I believe they both use the traditional LaTeX2 trick of setting up a list to alter the indentation, so this same problem likely exists for any package that tries to use the same method.

### polysyllabic commented Dec 25, 2018

 I just tested, and it looks like an interaction between \tex_par:D and the list environment. Using the expl3 version resets the left and right margins at least, and probably everything that's set in list's second parameter. Try this: \documentclass{article} \usepackage{xparse} \usepackage{lipsum} \ExplSyntaxOn \NewDocumentCommand{\mypar} {} {\tex_par:D} \ExplSyntaxOff \begin{document} \lipsum[1] \begin{list}{}{\setlength{\leftmargin}{2cm}\setlength{\rightmargin}{2cm}} \item Here's a paragraph with enough text that we can see where the line wraps. Here's another paragraph after a traditional paragraph break. Now we'll end this one with the expl3 version to see what happens next.\mypar And here's a forth to see where we are. The left and right margins are now disregarded. \end{list} \end{document}  I think this shows that it's actually expl3 that's the source of the problem, and only the LaTeX3 team will know if that's an intended side-effect or not.
Owner

### patta42 commented Dec 25, 2018

 The definition of the list environment is a quite complex monster in source2e, and I do not see where exactly the difference between using \par and \tex_par:D is, but I think you should notify the LaTeX3 team and file an issue. They still can decide that this is an intended side-effect.
Owner

### patta42 commented Dec 25, 2018

 The problem is that the list environment redefines \par, but (I guess) \tex_par:D is generated with \let: \documentclass{article} \let\mypar\par \begin{document} \begin{list}{}{\setlength{\leftmargin}{2cm}\setlength{\rightmargin}{2cm}} \item Here's a paragraph with enough text that we can see where the line wraps. Here's another paragraph after a traditional paragraph break. Now we'll end this one with the expl3 version to see what happens next.\mypar And here's a forth to see where we are. The left and right margins are now disregarded. \end{list} \end{document} 
Owner