Sometimes (but not too often), I want to start an environment in the middle of 
a line.

In LaTeX, it seems to work fine, although I don't know if this is considered 
bad practice. But in LyX, we can only start an environment at the beginning of 
a paragraph I believe.

Attached is an example in LyX that uses ERT. I haven't actually implemented 
this environment in LyX yet (I'm still planning to). Sometimes I can use the 
\uncover command, but other times I prefer an environment.

I also attach an example .tex file with an environment that is implemented in 
LyX (block). I attach the example as a .tex file (example-block.tex), and the 
imported .lyx file (example-block-imported.23.lyx). LyX makes a paragraph break 
and then nests the environment. This causes a linebreak that I don't want in 
the corresponding PDF.

Am I missing a way to accomplish this in LyX without ERT?

Are there common use cases for wanting to start an environment in the middle of 
a line?

If we did want to allow this operation in LyX, I wonder if we could make a 
"visual-only line-break" that is a no-op LaTeX. i.e., LyX would paint it as a 
line break but would not output a line break to LaTeX. We would have to think 
of a way to show this "just kidding line break" visually. But would there be 
support for this?

Scott

Attachment: example-uncoverenv.23.lyx
Description: application/lyx

%% LyX 2.4.0dev created this file.  For more info, see https://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[english]{beamer}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\setcounter{secnumdepth}{3}
\setcounter{tocdepth}{3}
\synctex=-1

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
% this default might be overridden by plain title style
\newcommand\makebeamertitle{\frame{\maketitle}}%
% (ERT) argument for the TOC
\AtBeginDocument{%
  \let\origtableofcontents=\tableofcontents
  \def\tableofcontents{\@ifnextchar[{\origtableofcontents}{\gobbletableofcontents}}
  \def\gobbletableofcontents#1{\origtableofcontents}
}

\makeatother

\usepackage{babel}
\begin{document}
\begin{frame}
\begin{block}<+->{}
This text on one overlay... \begin{block}<+->{}Then,
\[
xyz=3.
\]
This...
\begin{quote}
Someone said a quote...
\end{quote}
And this...

\end{block}
\end{block}
\end{frame}

\end{document}

Attachment: example-block-imported.23.lyx
Description: application/lyx

-- 
lyx-devel mailing list
lyx-devel@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-devel

Reply via email to