# I need an environment similar to, but not identical to LyX-Code

Paul A. Rubin parubin73 at gmail.com
Fri Jun 11 00:01:22 UTC 2021

```On 6/10/21 7:54 PM, Steve Litt wrote:
> I need an environment similar to, but not identical to the LyX-Code
> environment. Specifically, I need the page margins to be the same as
> regular text, and I'd also like a smaller font.
>
> So I figured I'd find the LaTeX definition of LyX-Code and work from
> there, possibly using CopyStyle. But I've searched for 1/2 hour and
> cannot find the TeX definition of the latexname part of LyX-Code, nor
> can I find the LyX user interface part of LyX-Code.
>
> So where can I find the definition of LyX-Code?
>
> SteveT
>
> Steve Litt
> Spring 2021 featured book: Troubleshooting Techniques of the Successful
> Technologist http://www.troubleshooters.com/techniques
Steve,

Create a file with one line of whatever in a LyX-Code environment. Turn
on View > Code Preview Pane, and in the preview pane use an appropriate
format (such as pdflatex) and set the drop down for what to show to
Preamble Only. You'll find the \newenvironment{lyxcode}{...} stuff in
the preview pane (after a little scrolling).

Paul

```