1

In LyX, some environments are handled by "Paragraph styles", and nested environments are handled by allowing to "indent" a paragraph to signal that it should be contained inside the environment of the previous paragraph.

enter image description here

In pseudocode (in case the image becomes inaccessible):

== LyX ==                == LaTeX ==
[Style: Quote] Hello.    \begin{quote}
[Style: Itemize] Wide.       Hello
[Style: Quote] World.    \end{quote}
                         \begin{itemize}
                             \item Wide.
                         \end{itemize}
                         \begin{quote}
                             World.
                         \end{quote}

as opposed to

== LyX ==                    == LaTeX ==
[Style: Quote] Hello.        \begin{quote}
    [Style: Itemize] Wide.       Hello.
[Style: Quote] World.            \begin{itemize}
                                     \item Wide.
                                 \end{itemize}
                                 World.
                             \end{quote}

I have some cases, where the outer environment is rather long (upward of a dozen of paragraphs) containing several such nested environments. I want to dissolve the outer environment (in LyX term: Paragraph style "Standard"), but if I just mark the whole reqgion and select "Standard", the nested Styles are lost, e.g.

enter image description here

== LyX Before ==                         == LyX After ==
[Style: Quote] Hello.       "Standard"   [Style: Standard] Hello.
    [Style: Itemize] Wide.     --->      [Style: Standard] Wide.
[Style: Quote] World.                    [Style: Standard] World.

The (inconvenient) alternative is to change each "Quote" styled paragraph separately. In this example it would be simple; In real world examples it may involve changing dozens of paragraphs.

Is there any more efficient way to change the Style of a sequence of paragraphs without changing the style of the nested paragraphs?

Example document (save as document.lyx)

#LyX 2.3 created this file. For more info see http://www.lyx.org/
\lyxformat 544
\begin_document
\begin_header
\end_header

\begin_body

\begin_layout Quote
Hello.
\end_layout

\begin_deeper
\begin_layout Itemize
Wide.
\end_layout

\end_deeper
\begin_layout Quote
World.
\end_layout

\end_body
\end_document

Specific usecase

I am using a view environments for editorial markup, e.g. continue for sections and paragraphs, that need to be finished yet. Since LyX "Flex Insets" are ill-equipped for handling multi-paragraph contents, I prefer translating these into styles (as LocalLayout or custom module) such as

Style Continue
  Category    Editorial
  LatexType   environment
  LatexName   continue
  LabelString "Continue."
  LabelType   static
  LabelSep    x
  Margin      first_dynamic
End

The usability issue occurs when trying to mark the contents as "Done" by removing the "continue" wrapper.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.