On Thursday 16 September 2010, Richard Heck wrote:
> On 09/16/2010 03:06 AM, Graham Smith wrote:
> > I have two timetables within the same document.
> >

>< snip ><

> > Is there some way of doing this in Lyx.
> >
> >    
> It can easily be done in LaTeX, by defining macros that contain the 
> dates and titles and then using those more than once. You can do this in 
> LyX, too, therefore, using ERT, but there's no native support for it.

Yes there is native support for macros in lyx, but the name is misleading; they 
are called Math macros. [Menu | Insert | Math | Macros] will allow you to 
define the macro, in both LaTeX and how it should appear in LyX if you so 
desire. Then, to use it in your text, insert some Inline Math; type your macro 
name preceded with a back-slash.

This is instead of defining the LaTeX macros in your preamble, as per below 
(which also work just as well).

Mateo.

> So 
> e.g.:
>      \newcommand\datea{10 September 2010}
>      \newcommand\dateb{12 October 2010}
>      \newcommand\datec{20 November 2010}
>      \newcommand\titlea{Wow, What a Title!}
>      \newcommand\titleb{This Will Be Great}
>      \newcommand\titlec{Lorem Ipsum}
> Put that where you like, e.g., in the preamble. If you want to be able 
> to use LyX to edit the text part, then you can do this in the main body 
> of the document:
>      [ERT]\newcommand\titlea{[/ERT]Now we're in LyX mode[ERT]}[/ERT]
> You could also put these things in a separate child document and include 
> it to keep from cluttering your main document with ERT.
> 
> Then in the tables:
>      [ERT]\datea{}[/ERT]
> etc, where you need it. The braces are just to make sure nothing odd 
> happens following the command.
> 
> Richard
> 
> 

Reply via email to