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 \newcommand, \renewcommand and newenvironmennt definitions and you 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 defined in any package) is public - hence all the issues with namespace clashes between packages. So there's no easy way to say what should be articulated in the resulting layout. 3.- for many non-trivial packages, the parsing of arguments (e.g., starred environments) is done dynamically. Without interpreting the underlying TeX code you wouldn't be able to find out what the arguments of a command, nor their semantics and layout ([] vs. {}) should be. ... and we did not dive yet into all the options, and configuration directives various packages enable (e.g., KOMA packages are very rich and complex in this respect). All this could be helped by having package implementors annotated commands, but well, it's already too late (30+ years too late?) to complain about that one, right? We have thousands of packages existing already. Another idea might me to parse the cls file and then decide what is important and how it is used by searching the web for tex files with that document class and automatically extract/learn from those what is the package interface. Well, good luck with that one... 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, Peter. -- Peter Novak, p...@aronde.net, http://peter.aronde.net/ signature.asc Description: Digital signature
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 Address: Allen Wilkinson (cell) (216) 548-2349 1286 Yellowstone Road 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, Peter. -- Peter Novak, p...@aronde.net, http://peter.aronde.net/
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 Address: Allen Wilkinson (cell) (216) 548-2349 1286 Yellowstone Road 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 \lyxaddress definition? If you don't want to use that definition, then start with: NoStyle Address and then redefine it as you wish, e.g.: Style Address LaTeXType command LaTeXName address 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. I'd have to see nagauth.cls to be sure about this. In the article class, the abstract appears on a separate page when the titlepage option is given, and LyX's default definition is for that case. 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. I still don't understand what it is you want. You want something that says what each and every style that is defined does? If so, then I'm not sure why looking at the layout files themselves isn't sufficient. That's what I do. Richard % nagdoc.tex V2.0, 13 May 2010 \documentclass[times]{nagauth} \usepackage{moreverb} \usepackage[dvips,colorlinks,bookmarksopen,bookmarksnumbered,citecolor=red,urlcolor=red]{hyperref} \newcommand\BibTeX{{\rmfamily B\kern-.05em \textsc{i\kern-.025em b}\kern-.08em T\kern-.1667em\lower.7ex\hbox{E}\kern-.125emX}} \def\volumeyear{2010} \begin{document} \runningheads{A.~N.~Other}{A demonstration of the \journalabb\ class file} \title{A demonstration of the \LaTeXe\ class file for the \itshape{\journalnamelc}\footnotemark[2]} \author{A.~N.~Other\corrauth} \address{John Wiley \& Sons, Ltd, The Atrium, Southern Gate, Chichester, West Sussex, PO19~8SQ, UK} \corraddr{Journals Production Department, John Wiley \& Sons, Ltd, The Atrium, Southern Gate, Chichester, West Sussex, PO19~8SQ, UK.} \begin{abstract} This paper describes the use of the \LaTeXe\ \textsf{\journalclass} class file for setting papers for the \emph{\journalnamelc}. \end{abstract} \keywords{class file; \LaTeXe; \emph{\journalabb}} \maketitle \footnotetext[2]{Please ensure that you use the most up to date class file, available from the NAG Home Page at\\ \href{http://www3.interscience.wiley.com/journal/3312/home}{\texttt{http://www3.interscience.wiley.com/journal/3312/home}}} \section{Introduction} Many authors submitting to research journals use \LaTeXe\ to prepare their papers. This paper describes the \textsf{\journalclass} class file which can be used to convert articles produced with other \LaTeXe\ class files into the correct form for publication in the \emph{\journalnamelc}. The \textsf{\journalclass} class file preserves much of the standard \LaTeXe\ interface so that any document which was produced using the standard \LaTeXe\ \textsf{article} style can easily be converted to work with the \textsf{\journalclassshort} style. However, the width of text and typesize will vary from that of \textsf{article.cls}; therefore, \emph{line breaks will change} and it is likely that displayed mathematics and tabular material will need re-setting. In the following sections we describe how to lay out your code to use \textsf{\journalclass} to reproduce the typographical look of the \emph{\journalnamelc}. However, this paper is not a guide to using \LaTeXe\ and we would refer you to any of the many books available (see, for example, \cite{R1,R2,R3}). \section{The Three Golden Rules} Before we proceed, we would like to stress \emph{three golden rules} that need to be followed to enable the most efficient use of your code at the typesetting stage: \pagebreak \begin{enumerate} \item[(i)] keep your own macros to an absolute minimum; \item[(ii)] as \TeX\ is designed to make sensible spacing decisions by itself, do \emph{not} use explicit horizontal or vertical spacing commands, except in a few accepted
RE: using LyX to write AGU journal articles
Dear Dr. Heck, Thank you for contacting us. I have forwarded your email to Editor Support Team Leader who will answer your concerns as soon as possible. Regards, Edith Judd author.h...@agu.org AGU galvanizes a community of Earth and space scientists that collaboratively advances and communicates science and its power to ensure a sustainable future. Support the American Geophysical Union! Visit the AGU Blogosphere Get the latest information on Facebook and tweet us at @TheAGU! -Original Message- From: Richard Heck [mailto:rgh...@lyx.org] Sent: Thursday, July 12, 2012 12:10 PM To: Kristoffer Walker Cc: lyx-users@lists.lyx.org; author.help Subject: Re: using LyX to write AGU journal articles On 07/10/2012 07:33 PM, Kristoffer Walker wrote: > Folks, > > I am trying to write an AGU journal article using the AGU document class in > LyX, a front-end to MacTex. I have been able to generate a good looking > manuscript with LyX, with one important caveat: the compiled manuscript fails > to include the Abstract. I have determined the problem is that the AGU > document class expects the following missing statement just after the > abstract definition: > > /begin{article} > > Similarly, a /end{article} is needed at the end of the document, just before > the /end{document}. > > I can of course write in LyX and then ultimately export to *.tex in the end, > add the lines, recompile, and submit the manuscript, but is there a better > way to fix this? For example, can I edit a Layout file or similar to have > these things done automatically so that the Abstract will show up from a > compilation within LyX? > Please post a simple file illustrating the problem. We probably need to hack the layout file. rh
Re: Is this a bug?
On 07/13/2012 06:32 AM, Frederick FN Noronha फ्रेड्रिक नोरोन्या *فريدريك نورونيا wrote: Place two (duplicate) index-entries for the same word/s and the entire index doesn't show up. If anyone wants to study this, I could send you a copy of the file where it happened. FN Best would be the simplest possible file that illustrates the problem. Richard
Re: Lyx .layout language for nagauth.cls (esp. abstract)
Richard, I have Address and KeyWords working okay now tweaking your sample. But abstract is still trouble. my nagauth.layout now NoStyle Abstract Style Abstract LaTeXType command LaTeXName abstract CategoryFrontMatter InTitle 1 End nagauth.cls \newbox\absbox \def\abstract{\lrbox\absbox\minipage{\textwidth}% \small\normalfont% \centerline{{SUMMARY}}\par\vspace{8pt}% } \def\endabstract{\copyrightline\endminipage\endlrbox} How do I create layout language for this .cls case and have it come before \maketitle via .layout file? Thanks, Allen Address: Allen Wilkinson (cell) (216) 548-2349 1286 Yellowstone Road Cleveland Heights, OH 44121 USA (INTERNET) aw(at)chaff(dot)biz +++
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
Re: Lyx .layout language for nagauth.cls (esp. abstract)
On 07/13/2012 01:07 PM, Allen Wilkinson wrote: Richard, I have Address and KeyWords working okay now tweaking your sample. But abstract is still trouble. my nagauth.layout now NoStyle Abstract Style Abstract LaTeXType command LaTeXName abstract CategoryFrontMatter InTitle 1 End nagauth.cls \newbox\absbox \def\abstract{\lrbox\absbox\minipage{\textwidth}% \small\normalfont% \centerline{{SUMMARY}}\par\vspace{8pt}% } \def\endabstract{\copyrightline\endminipage\endlrbox} How do I create layout language for this .cls case and have it come before \maketitle via .layout file? This is actually an environment, though it looks like a command, so you need to make it LaTeXType envrionment. (This is a very good example of what Peter was saying about the problem of trying to read these things.) The "InTitle 1" tag tells LyX that this comes before \maketitle. LyX issues \maketitle when it sees something that doesn't have "InTitle 1". E.g., a section heading, or whatever. Richard
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 Steve Litt* http://www.troubleshooters.com/ * http://twitter.com/stevelitt Troubleshooting Training * Human Performance
Keeping lists together?
Hi all, Is there any way, using LaTeX or maybe a LaTeX package, that I could make lists try to stay on one page? For the clarity of my book, it's much better if a list doesn't flow across pages, even if it causes different pages to have significantly different amounts of text. The latter is cosmetic, the former is a matter of reader understanding. I'm thinking maybe something with rubber lengths, but can't really fathom it out any farther. Thanks SteveT Steve Litt* http://www.troubleshooters.com/ Troubleshooting Training * Human Performance