Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I want to define an environment with LaTeX3 where I can supress the indention in the first line. For LaTeX2e you can use \@afterindentfalse\@afterheading.

The example use this combination. But I want to avoid this combination.

\documentclass{scrartcl}
\usepackage{lipsum}
\usepackage{expl3,xparse}
\makeatletter
\def\tempaaaa{\@afterindentfalse\@afterheading}
\makeatother
\ExplSyntaxOn
\box_new:N \l_fullwidth_store_contents_one_box

\DeclareDocumentEnvironment { fullwidth } { }
  {
   \par\noindent Starting~savebox
   \vbox_set_inline_begin:N \l_fullwidth_store_contents_one_box
   \tempaaaa
  }
  {
   \vbox_set_inline_end:
   \par The~Output:\par
    \fbox{ \box_use_clear:N \l_fullwidth_store_contents_one_box }
  }
\ExplSyntaxOff
\begin{document}
\begin{fullwidth}

FOO bar

\lipsum[1]
\end{fullwidth}
\end{document}

enter image description here

share|improve this question
    
Joseph Wright or Frank Mittelbach will probably chime in, but I think you're mostly out of luck for the moment. The work on the galley is ongoing. –  Bruno Le Floch Feb 5 '12 at 14:37
    
I removed the boxes tag because your question seems to be more general. –  lockstep Feb 5 '12 at 14:41
    
@BrunoLeFloch: In this case I must use a combination of LaTeX2e and LaTeX3. The same manner must be used for \textwidth and columnwidth. Up to know I simple use \skip_set:Nn \tex_hsize:D {10cm}. The modul coffin looks also very nice but the seems to be no split operation. –  Marco Daniel Feb 5 '12 at 14:48
    
@lockstep: No problem. –  Marco Daniel Feb 5 '12 at 14:48
    
On splitting boxes, what we don't have is a use case and so forth. Splitting boxes is related to the output routine, which I'm working on at the moment. Use cases and potential input syntax is what is needed to add more functionality: one for LaTeX-L. –  Joseph Wright Feb 5 '12 at 15:22

1 Answer 1

up vote 6 down vote accepted

As Bruno remarks, dealing with galley issues is not as developed as working with low-level code. There is also the issue that changing the way galley operations are implemented is not going to be a 'totally safe' operation with LaTeX2e: you simply cannot be sure that a change will not impact on existing code. As such, working with LaTeX3-in-LaTeX2e requires a mix of LaTeX3 and LaTeX2e code. (For example, see how siunitx detects fonts using LaTeX2e's NFSS.)

The xgalley package is close to working fluidly, but may still need a few changes. With the current implementation (which I'd love to have feedback for), you want something like

\documentclass{article}
\usepackage{lipsum,expl3,xparse,xgalley}
\ExplSyntaxOn
\box_new:N \l_fullwidth_store_contents_one_box

\DeclareDocumentEnvironment { fullwidth } { }
  {

   \par\noindent Starting~savebox
   \vbox_set_inline_begin:N \l_fullwidth_store_contents_one_box
   \bool_gset_true:N \g_galley_omit_next_indent_bool
  }
  {
   \vbox_set_inline_end:
   \par The~Output:\par
    \fbox{ \box_use:N \l_fullwidth_store_contents_one_box }
  }
\ExplSyntaxOff
\begin{document}
\begin{fullwidth}

FOO bar

\lipsum[1]

\end{fullwidth}
\end{document}

Ideally, \noindent would be defined as

\bool_gset_true:N \g_galley_omit_next_indent_bool

when xgalley is loaded. However, people rely on the fact that the \noindent primitive leaves vertical mode, and so such a change breaks a lot of LaTeX2e code. Once we have a sectioning module then perhaps I can alter this, but not at the moment.

share|improve this answer
    
The box here might be a separate galley level (I'm not clear on the wider situation), in which case you'd want to employ \galley_level: either inside a coffin or with an additional group. –  Joseph Wright Feb 5 '12 at 15:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.