11 Jul 2012 04:51

## Lyx .layout language for nagauth.cls

I am writing a paper for Wiley's journal "INTERNATIONAL JOURNAL FOR
NUMERICAL AND ANALYTICAL METHODS IN GEOMECHANICS" that uses the
nagauth.cls LaTeX class.

The generic article.layout re-used for nagauth.layout file does not
produce a very compatible layout. It puts \maketitle command in the wrong
alternative to the \address{} function in nagauth.cls) and the abstract.
There may be other anomalies as I progress in writing the paper.

I suspect that a proper .layout file would fix this.

Where can I find the language definitions used for creating .layout files?

Thanks, Allen Wilkinson
----

Allen Wilkinson                       (cell)  (216) 548-2349
Cleveland Heights, OH 44121  USA      (INTERNET) aw(at)chaff(dot)biz
+++++++


11 Jul 2012 22:23

### Re: Lyx .layout language for nagauth.cls

On 07/10/2012 10:51 PM, Allen Wilkinson wrote:
> I am writing a paper for Wiley's journal "INTERNATIONAL JOURNAL FOR
> NUMERICAL AND ANALYTICAL METHODS IN GEOMECHANICS" that uses the
> nagauth.cls LaTeX class.
>
> The generic article.layout re-used for nagauth.layout file does not
> produce a very compatible layout. It puts \maketitle command in the
> wrong place with respect to author addresses (oddly defaulting to
> and the abstract. There may be other anomalies as I progress in
> writing the paper.
>
> I suspect that a proper .layout file would fix this.
>
> Where can I find the language definitions used for creating .layout
> files?
>
Chapter 5 of the Customization manual. Feel free to ask lots of
questions, too, and I'd recommend looking through other layout files
that perhaps work more like this one.

rh


12 Jul 2012 03:19

### Re: Lyx .layout language for nagauth.cls

Richard,

I read all of Section 5.2 on layouts. I used it to modify the
article.layout file to nagauth.layout, which is poor for nagauth.cls.

There are a tons of things being set in layout files, especially when you
drill down into stdclass.inc and its included .inc files.

In the linked file lyxmacros.inc the "Style Address" is noted. How can I
control the nagauth.cls \address definition be used {placing author
addresses right after the authors on the title page} and not the

The same goes for "Style Abstract" in the stdstruct.inc file. How can I
force the abstract to happen on the title page right after the \address
content? nagauth.cls renames the 'abstract' to 'Summary' LyX output seems
to botch that renaming.

Why doesn't LyX just default to the .cls files definitions and abandon the
need for layout files?

I can patch .tex files after LyX export, but that gets tedious quick.

I am looking for a manual on the structure and meaning of all elements
used in layout files. Customization help file doesn't come close to that
need.

Best, Allen
----


12 Jul 2012 17:05

### Layouts vs cls file definition (was: Lyx .layout language for nagauth.cls)

El 11/07/2012 07:19 p.m., Allen Wilkinson escribió:
> (...)
> Why doesn't LyX just default to the .cls files definitions and abandon
> the need for layout files?
>
> (...)

Dear Lyxers

I half agree with this question, layout files are very useful when you
have to get more than one cls file definition (i.e a master document is
a book and a child document is an article and so on), but when you are
writting just an article the editors often offer you a cls file already
(ElSevier for example). I propose one of two solutions: isn't a way to
get layout files automatically from cls file definitions, if this is too
overwhelming I can handle with just the basics and then add manually the
rest for the first glance (a python script would be nice, suggested name
"cls2layout.py"); second solution could be that lyx can actually read
the cls file as an option to the layout file, this is not in lyx
philosophy but why not? It would be helpful in some specific cases like
this which is used a lot. Probably this is solved someway or someone has
already found a solution so it would be nice if it is published here,
I'm open at suggestions.

--

--
Regards
~-o--{____}--o-~
Alex Vergara Gil
MSc. Física Nuclear
Laboratorio Secundario de Calibración Dosimétrica


12 Jul 2012 17:49

### Re: Layouts vs cls file definition

On 07/12/2012 11:05 AM, Alex Vergara Gil wrote:
> El 11/07/2012 07:19 p.m., Allen Wilkinson escribió:
>> (...)
>> Why doesn't LyX just default to the .cls files definitions and
>> abandon the need for layout files?
>>
>> (...)
>
> Dear Lyxers
>
> I half agree with this question, layout files are very useful when you
> have to get more than one cls file definition (i.e a master document
> is a book and a child document is an article and so on), but when you
> are writting just an article the editors often offer you a cls file
> already (ElSevier for example). I propose one of two solutions: isn't
> a way to get layout files automatically from cls file definitions, if
> this is too overwhelming I can handle with just the basics and then
> add manually the rest for the first glance (a python script would be
> nice, suggested name "cls2layout.py"); second solution could be that
> lyx can actually read the cls file as an option to the layout file,
> this is not in lyx philosophy but why not? It would be helpful in some
> specific cases like this which is used a lot. Probably this is solved
> someway or someone has already found a solution so it would be nice if
> it is published here, I'm open at suggestions.
>
If someone wants to figure out a way to generate a layout file from a
LaTeX class file, then I don't see why this would be impossible, but I
think it would prove to be a whole ton of work.

As always, if you have an itch, then open source gives you a chance to


13 Jul 2012 11:05

### Re: Layouts vs cls file definition (was: Lyx .layout language for nagauth.cls)

Hello Alex,

> I propose one of two
> solutions: isn't a way to get layout files automatically from cls
> file definitions, if this is too overwhelming I can handle with just
> the basics and then add manually the rest for the first glance (a
> python script would be nice, suggested name "cls2layout.py"); second
> solution could be that lyx can actually read the cls file as an
> option to the layout file, this is not in lyx philosophy but why
> not? It would be helpful in some specific cases like this which is
> used a lot. Probably this is solved someway or someone has already
> found a solution so it would be nice if it is published here, I'm
> open at suggestions.

This would be extremely difficult to do. Realize that most non-trivial
packages do not rely on plain LaTeX, but rather implement large amounts
of their functionality in plain TeX and things are much messier down
there.

Just consider:
1.- it simply is not the case that you can just parse out
are fine. In fact, most of the time you are not. What you need to
consider are all the \def definitions, but that's not the way to do
it. Perhaps for the default LaTeX packages yes, but not the custom
ones of journals and various publishers. In fact, many of those I
saw so far were implemented so that they work for the publisher,
they are not meant to tinker with too much.
2.- TeX (and hence LaTeX) does not facilitate specification of a public
interface of a package. In fact everything (i.e., every symbol


13 Jul 2012 14:24

### Re: Layouts vs cls file definition (was: Lyx .layout language for nagauth.cls)

To do the manual layout creation (or substantial editing of existing
layout) I need a language definition. What are all the possible structure
and elements, along with their meaning, of the style sections defined? How
does one control the placement of these style sections in the larger
document.

Richard Heck helped on my specific two examples in hand at the moment.

Could LyX offer a layout editor as a high level interface to managing
layouts?

Thanks, Allen
----

Allen Wilkinson                       (cell)  (216) 548-2349
Cleveland Heights, OH 44121  USA      (INTERNET) aw(at)chaff(dot)biz
+++++++

On Fri, 13 Jul 2012, Peter Novak wrote:

[snip]
>
> So to sum up: in my opinion, manual layout file creation is the
> easiest and most reliable method to rely upon.
>
> My 2 cents.
>
> Best,


13 Jul 2012 19:11

### Re: Layouts vs cls file definition

On 07/13/2012 08:24 AM, Allen Wilkinson wrote:
> To do the manual layout creation (or substantial editing of existing
> layout) I need a language definition. What are all the possible
> structure and elements, along with their meaning, of the style
> sections defined? How does one control the placement of these style
> sections in the larger document.
>
The language itself is defined and documented in Chapter 5 of the
Customization manual. You can see what styles a given layout defines
simply by looking at the combo box you use to choose them, though there
may also be insets that the layout defines that appear on other menus.

> Could LyX offer a layout editor as a high level interface to managing
> layouts?
>
That's a dream many of us have long had.

What might be useful here, short of the dream, would be some way to dump
all the layout information to a terminal.

Richard


14 Jul 2012 04:17

### Re: Layouts vs cls file definition (was: Lyx .layout language for nagauth.cls)

On Fri, 13 Jul 2012 08:24:20 -0400 (EDT), Allen Wilkinson said:
> To do the manual layout creation (or substantial editing of existing
> layout) I need a language definition. What are all the possible
> structure and elements, along with their meaning, of the style
> sections defined? How does one control the placement of these style
> sections in the larger document.
>
> Richard Heck helped on my specific two examples in hand at the moment.
>
> Could LyX offer a layout editor as a high level interface to managing
> layouts?
>
> Thanks, Allen

Hi Allen,

The LyX part of layouts has a relatively few choices, that would be
very amenable to a front end to a .conf file, kind of like what SWAT is
to smb.conf. A simple script could turn the conf file into a layout.

BUT...

LaTeX is all over the map. There are lots of ways to indent. Lots of
ways to invoke different spacing. The best I could do to create a tool
for writing LaTeX is to ask the user for spacing, fontface, font size,
font weight, font slant, justification, etc, and then write LaTeX to do
approximately that in a very prepackaged way. It would need to be
tweaked.

SteveT


12 Jul 2012 18:07

### Re: Lyx .layout language for nagauth.cls

On 07/11/2012 09:19 PM, Allen Wilkinson wrote:
> Richard,
>
> I read all of Section 5.2 on layouts. I used it to modify the
> article.layout file to nagauth.layout, which is poor for nagauth.cls.
>
> There are a tons of things being set in layout files, especially when
> you drill down into stdclass.inc and its included .inc files.
>
> In the linked file lyxmacros.inc the "Style Address" is noted. How can
> I control the nagauth.cls \address definition be used {placing author
> addresses right after the authors on the title page} and not the
>
and then redefine it as you wish, e.g.:
LaTeXType command
InTitle 1
End
Pretty basic, but it should come close to working. LaTeX will take care
of putting the address in the right place.

> The same goes for "Style Abstract" in the stdstruct.inc file. How can
> I force the abstract to happen on the title page right after the
> \address content? nagauth.cls renames the 'abstract' to 'Summary' LyX
> output seems to botch that renaming.
>


13 Jul 2012 15:19

### Re: Lyx .layout language for nagauth.cls

Richard,

This journal puts the abstract before the \maketitle command in the
attached .tex file.

I attach the .cls file for any help.

Thanks, Allen
----

Allen Wilkinson                       (cell)  (216) 548-2349
Cleveland Heights, OH 44121  USA      (INTERNET) aw(at)chaff(dot)biz
+++++++

On Thu, 12 Jul 2012, Richard Heck wrote:

> On 07/11/2012 09:19 PM, Allen Wilkinson wrote:
>> Richard,
>>
>> I read all of Section 5.2 on layouts. I used it to modify the
>> article.layout file to nagauth.layout, which is poor for nagauth.cls.
>>
>> There are a tons of things being set in layout files, especially when you
>> drill down into stdclass.inc and its included .inc files.
>>
>> In the linked file lyxmacros.inc the "Style Address" is noted. How can I
>> control the nagauth.cls \address definition be used {placing author
>> addresses right after the authors on the title page} and not the