1

This is really driving me crazy. Within Lyx I can use the option to include an enumerated list in my letter (g-brief2). When I do, the list is put after closing and name \end{g-brief} is inserted just before \begin{enumerate}).

I would like to include the list inside my letter text. How do I do that?

I have tried:

  1. contacting the maintainer of g-brief2
  2. including \usepackage{enumitem} in the preamble
  3. Extensive fiddling with curly braces

Any help is greatly appreciated. I can, of course switch to another letter class, but I really want to know what I could have done to resolve this (learning how Lyx/LateX works).

Regards, Matthijs

Here's a MWE:

% Preview source code

%% LyX 2.1.2 created this file.  For more info, see http://www.lyx.org/.
%% Do not edit unless you really know what you are doing.
\documentclass[12pt,english]{g-brief2}
\usepackage{mathpazo}
\usepackage[T1]{fontenc}
\usepackage[latin9]{inputenc}
\pagestyle{empty}
\setlength{\parskip}{\medskipamount}
\setlength{\parindent}{0pt}

\makeatletter
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% Textclass specific LaTeX commands.
 \newcommand{\LyxGruss}[1]
   { \Gruss{#1}{0.5cm} }

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% User specified LaTeX commands.
\fenstermarken % prints address window marks
\faltmarken % prints folding marks
%\lochermarke % prints puncher marks 
\trennlinien % prints striplines
%\unserzeichen % prints "our ref" instead of "my ref"
\usepackage{graphicx}
\usepackage{enumitem}

\makeatother

\usepackage{babel}
\begin{document}



\NameZeileA{My company}


\AdressZeileA{My Address}


\AdressZeileB{My Country}


\RetourAdresse{My Address}


\Adresse{{\large{}Address line 1}\\
{\large{}Address line 2}}


\Datum{1 december 2014}


\Betreff{Myreference}


\Anrede{Dear X,}


\LyxGruss{Regards,}


\Unterschrift{My name}
\begin{g-brief}
Letter first sentence.

Letter second sentence, includes an enumeration:\end{g-brief}

\begin{enumerate}
\item eerste
\item tweede
\item derde punt\end{enumerate}

\end{document}

My letter looks like this: Letter with enumeration AFTER closing and name instead of inside the letter

1
  • Welcome to TeX.SX! You can have a look at our starter guide to familiarize yourself further with our format.
    – cfr
    Dec 2, 2014 at 1:53

2 Answers 2

2

Your output is due to the fact that the list is outside the g-brief environment.

If you change the end of your tex code to:

\begin{g-brief}
Letter first sentence.

Letter second sentence, includes an enumeration:

\begin{enumerate}
\item eerste
\item tweede
\item derde punt\end{enumerate}

\end{g-brief}

You will find that it compiles as expected.

The issue is that the letter class expects all body content to be inside this environment.

To achieve this in LyX you need to highlight the enumeration and press tab. This will make the list a child of the previous line, moving it back inside the g-brief environment. You will see a similar behaviour in LyX if, for example, you create a paragraph with the Standard style, rather than using the Letter style. The same applies to the use of other lists.

0

If all else fails, insert the TeX code directly using an ERT:

enter image description here

Your Answer

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

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