1

I have the following local layout in LyX.

Format 66
Preamble
  \usepackage{xcolor}
  \newcounter{YourTurn}
  \newenvironment{YourTurn}[1][]{\refstepcounter{YourTurn}\par\medskip
  \noindent \color{green}\textbf{Your Turn ~\theYourTurn. #1} \rmfamily\color{black}}{\medskip}
EndPreamble

Counter YourTurn LabelString "\arabic{YourTurn}" End

Style YourTurn LeftMargin " MMMMMM" LaTeXName YourTurn ParSkip 0.4 Align Left LabelFont Family Roman Series Medium Size Normal Color Magenta EndFont LaTeXType Item_Environment LabelType Static LabelCounter YourTurn ItemCommand YourTurn LabelString "Your Turn \theYourTurn. " End

My MWE code in LyX looks like this:

\documentclass[12pt,a4paper,twoside,english]{article}
\renewcommand{\familydefault}{\rmdefault}

\makeatletter

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands. \usepackage{xcolor} \newcounter{YourTurn} \newenvironment{YourTurn}[1][]{\refstepcounter{YourTurn}\par\medskip \noindent \color{green}\textbf{Your Turn ~\theYourTurn. #1} \rmfamily\color{black}}{\medskip}

\makeatother

\begin{document} \begin{YourTurn} \YourTurn This should be Your Turn 1 \YourTurn This should be Your Turn 2 \end{YourTurn}

Standard text 1

Standard Text 2 \begin{YourTurn} \YourTurn This should be Your Turn 3 \end{YourTurn}

\end{document}

The LyX screenshot looks like this:

enter image description here

While the output looks like this:

enter image description here

I am unsure why there are YourTurn environments inserted where I am not expecting them.

Any ideas?

  • Post a complete a minimal working example (MWE), not a chunk of not working lyx code that show some like a list setting but omit the text that you show in the screenshots. Better if the MWE is exported to LaTeX. Probably even most LyX users cannot understand the LyX code without running it in the LyX GUI, but read without problems the LaTeX export. – Fran Jan 20 '21 at 09:06
  • 1
    Sorry. Forgot the MWE (It is LyX that has been converted to LateX) – Anthony Macks Jan 20 '21 at 09:18

0 Answers0