4

When polyglossia is loaded noindentafter stops working:

\documentclass{article}
    \usepackage{fontspec}
        \setmainfont{Latin Modern Roman}
    \usepackage{lipsum}
    \usepackage{polyglossia}
        \setmainlanguage{french}
        %   \PolyglossiaSetup{french}{indentfirst=false}
    \usepackage{noindentafter}
        \NoIndentAfterEnv{myitemize}

    \newenvironment{myitemize}{\begin{itemize}}{\end{itemize}}

\begin{document}
   \begin{myitemize}
       \item test
   \end{myitemize}

   \lipsum
\end{document}

enter image description here

This happens with all the languages I tested. In No indent in the first paragraph in a section? egreg suggested to add indentfirst=false (commented in the code) but unfortunately it does not work for custom environments.

Is there a (possibly easy) way to restore the noindentafter functionality when usingpolyglossia?

10
  • why noindentafter{myitemize} rather than the standard latex markup which is not to indent after a list if there is no new paragraph? Nov 26, 2013 at 20:49
  • @DavidCarlisle I need this for many different kinds of custom environments: tcolorboxes, tikzpictures, etc.
    – d-cmst
    Nov 26, 2013 at 20:53
  • sure but a blank line meaning start of paragraph is deeply ingrained in latex and latex goes to lots of trouble to make that work even after a list. If you don't want to start a new paragraph, just don't insert a blank line. Nov 26, 2013 at 20:54
  • @DavidCarlisle But this does not work with tcolorboxes? I still get indented text. E.g. try: \begin{tcolorbox}test\end{tcolorbox}\lipsum
    – d-cmst
    Nov 26, 2013 at 20:59
  • a display environment based on colorbox should be using a trivlist environment (like center and quote verbatim and ...) Nov 26, 2013 at 21:01

1 Answer 1

4

Both packages are messing with \@afterindentfalse. Fortunately polyglossia stores the old version \@@fterindentfalse so we can just redefine the central command \NoIndentAfterThis to use the stored version.

Sample output

\documentclass{article}

\usepackage{fontspec}
\setmainfont{Latin Modern Roman}
\usepackage{lipsum}

\usepackage{polyglossia}
\setmainlanguage{french}

\usepackage{noindentafter}
\makeatletter
\renewcommand*{\NoIndentAfterThis}{\par\@@fterindentfalse\@afterheading}
\makeatother

\NoIndentAfterEnv{myitemize}
\newenvironment{myitemize}{\begin{itemize}}{\end{itemize}}

\begin{document}
Text. \NoIndentAfterThis Text.
\begin{myitemize}
\item test
\end{myitemize}

\lipsum
\end{document}
0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .