#LyX 1.3 created this file. For more info see http://www.lyx.org/ \lyxformat 221 \textclass book \begin_preamble \usepackage{multicol} \newcommand{\extratablespace}[1]{\noalign{\vskip#1}} \end_preamble \language romanian \inputencoding latin2 \fontscheme default \graphics default \paperfontsize default \spacing single \papersize Default \paperpackage a4 \use_geometry 0 \use_amsmath 0 \use_natbib 0 \use_numerical_citations 0 \paperorientation portrait \secnumdepth 3 \tocdepth 3 \paragraph_separation indent \defskip medskip \quotes_language polish \quotes_times 2 \papercolumns 1 \papersides 2 \paperpagestyle headings \layout Title Caracteristici avansate LyX \layout Author de Echipa LyX \begin_inset Foot collapsed true \layout Standard \noindent Principal maintainer of this file is \noun on Mike Ressler \noun default . If you have comments or error corrections, please send them to the LyX Documentation mailing list, . \end_inset \begin_inset Foot collapsed true \layout Standard traducere de Claudiu Costin \end_inset \layout Standard \begin_inset LatexCommand \tableofcontents{} \end_inset \layout Chapter Introducere \layout Standard The \emph on Extended LyX Features \emph default manual, which you are now reading, is essentially Part II of the \emph on User's Guide\SpecialChar \@. \emph default The reason for splitting this document is simple: the \emph on User's Guide \emph default is already huge, and it contains all of the basic features one needs to know in order to prepare most documents. However, the LyX Team has a long-term goal of making LyX extensible through various configuration files and external packages. That means that if you want to support the Fizzwizzle LaTeX package, you can create a layout file for it without having to alter LyX itself. We've already had contributions of several new features this way. This is the place where all of that gets documented. \layout Standard This manual also documents some special features, like fax support, version control, and SGML support, which require additional software to work properly. Lastly, there's a chapter of LaTeX tools and tips, things you can use to spruce up your documents by directly using the powerful features of LaTeX. After all, LyX \emph on is \emph default only WYSIWYM, and will only ever interface to certain LaTeX features. \layout Standard Of course, with all of this extra documentation, \emph on Extended LyX Features \emph default may itself grow too big for its britches. In that case, you can just call it the \begin_inset Quotes eld \end_inset Overextended Manual \begin_inset Quotes erd \end_inset for fun! \layout Standard If you haven't read the \emph on Introduction \emph default yet, you are definitely in the wrong manual. The \emph on Introduction \emph default is the first place to go, since it will direct you to the correct manual, and it also describes the notation and format of all of the manuals. You should also be thoroughly familiar with the \emph on User's Guide \emph default and all of the basic features of LyX. \layout Standard In this document, many sections are independent articles contributed by an individual and are noted as such. This person is generally whoever wrote the layout file for the new document class or LaTeX package, or implemented the feature. If there is no mention of an author to a chapter [or chapter sections], that means it was written by the LyX Documentation Team. \layout Standard Since all the topics in this manual depend heavily on LyX's interaction with LaTeX, this first chapter covers \emph on \emph default the inner workings of LyX and how to direct LyX to generate exactly the LaTeX code you want. It is obviously for more seasoned LyX users. \layout Chapter LyX ºi LaTeX \layout Section Cum utilizeazã LyX LaTeX-ul \layout Standard \begin_inset LatexCommand \label{sec:lyxandlatex} \end_inset This chapter is for both TeX-nicians and the LaTeX-curious. In it, we'll explain how LyX and LaTeX work together to produce printable output. This is the only place in any of the manuals where we assume you know something about LaTeX. \layout Standard At one time, we called LyX a \begin_inset Quotes eld \end_inset WYSIWYM frontend to LaTeX, \begin_inset Quotes erd \end_inset but that's no longer true. There are frontends to LaTeX out there. They are basically editors with the ability to run LaTeX and mark any errors in the file you're editing. Although LyX \emph on is \emph default an editor, and it \emph on does \emph default run LaTeX, and it also marks errors in the file, it also does much, much more. Thanks to the WYSIWYM concept, you don't need LaTeX to use LyX effectively. LyX has also added a few extensions to LaTeX. Try the following sometime: select \family sans Export\SpecialChar \menuseparator LaTeX \family default from the \family sans \bar under F \bar default ile \family default menu, then look at the preamble of the resulting \family typewriter .tex \family default file. You'll notice a variety of new macros defined specifically by LyX. These macros are defined automatically, according to the features you use in the document. \layout Standard There are several commands that automatically invoke LaTeX. They are: \layout Itemize \family sans \bar under V \bar default iew\SpecialChar \menuseparator View\SpecialChar ~ \emph on Format \layout Itemize \family sans \bar under V \bar default iew\SpecialChar \menuseparator \bar under U \bar default pdate\SpecialChar \menuseparator \emph on Format \layout Itemize \family sans \bar under F \bar default ile \bar under \SpecialChar \menuseparator P \bar default rint... \layout Itemize \family sans \bar under F \bar default ile \bar under \SpecialChar \menuseparator F \bar default ax... \layout Standard They will only invoke LaTeX if the file has changed since the last time LaTeX was run. \layout Standard When you run LaTeX on the file you're editing, LyX performs these steps: \layout Enumerate Convert the document to LaTeX and save to a file with the extension \family typewriter .tex \family default in place of \family typewriter .lyx \family default . \layout Enumerate Run LaTeX on the \family typewriter .tex \family default file (maybe several times). \layout Enumerate If there are any errors, insert error boxes in the document to mark where they are. These boxes are transient and are not saved along with the document. \layout Standard If you've run LaTeX using \family sans View\SpecialChar ~ DVI \family default , LyX then executes \family typewriter xdvi \family default on the Dvi file. If you've used \family sans View\SpecialChar ~ PostScript \family default or \family sans \bar under P \bar default rint... \family default \SpecialChar ~ , LyX performs two more steps: \layout Itemize Run \family typewriter dvips \family default to convert the Dvi file to PostScript®: \begin_deeper \layout Itemize For \family sans View\SpecialChar ~ PostScript \family default , the output file has the extension \family typewriter .ps_tmp \layout Itemize For \family sans \bar under P \bar default rint... \family default \SpecialChar ~ , the output file has the extension \family typewriter .ps \family default , as expected. \end_deeper \layout Itemize Execute \family typewriter ghostview \family default or send the PostScript® file to the printer. \layout Section \begin_inset Quotes eld \end_inset Help! LyX generated an unreadable \family typewriter .tex \family default file! \begin_inset Quotes erd \end_inset \layout Standard Die-hard LaTeX users will scream and howl this into the night, then declare LyX useless, simply because they didn't RTFM. \layout Standard We're going to set the record straight. LyX produces two kinds of LaTeX files. One is human readable. The other is LyX readable. Every time LyX executes LaTeX, it produces a LaTeX file that it can easily scan for errors. The resulting \family typewriter .tex \family default file is not human readable. Don't even try to read it. If you want a \family typewriter .tex \family default file that you can send to a colleague, select \family sans Export\SpecialChar \menuseparator LaTeX... \family default from the \family sans \bar under F \bar default ile \family default menu. \layout Section Translatarea fiºierelor LaTeX în fiºiere LyX \layout Standard You can import a LaTeX file into LyX by using the \family sans \bar under F \bar default ile\SpecialChar \menuseparator Import\SpecialChar \menuseparator LaTeX \family default command in LyX. This will call a Perl script named \family typewriter reLyX \family default ---which will create a file \family typewriter foo.lyx \family default from the file \family typewriter foo.tex \family default ---and then open that file. If the translation doesn't work, you can try calling \family typewriter reLyX \family default from the command line, possibly using fancier options. \layout Standard \family typewriter reLyX \family default will translate most legal LaTeX, but not everything. It will leave things it doesn't understand in TeX mode, so after translating a file with \family typewriter reLyX \family default , you can look for red text and hand-edit it to look right. \layout Standard \family typewriter reLyX \family default has its own section in the \emph on Extended Features \emph default manual (as well as a Unix manpage equivalent), which you should read to find out about what LaTeX isn't supported, bugs (and how to get around them), and how to use the various options. \layout Standard If you can't get \family typewriter reLyX \family default to work, or you just want to put a piece of LaTeX code into a LyX file, see Section \begin_inset LatexCommand \ref{sec:latexcodes} \end_inset . \layout Section Inserarea de cod LaTeX în documentele LyX \begin_inset LatexCommand \label{sec:Inserting-LaTeX-Code} \end_inset \layout Standard \begin_inset LatexCommand \label{sec:latexcodes} \end_inset This is a rather important point: You can always insert LaTeX code into any LyX document. LyX simply cannot, and will probably never be able to, display every possible LaTeX construct. If ever you need to insert LaTeX commands into your LyX document, you can use the ERT box, which you can insert into your document with \family sans \bar under I \bar default nsert\SpecialChar \menuseparator \bar under T \bar default eX \family default . The ERT box comes in three forms: collapsed, open, and inlined. The first two are used just like any other collapsable (foldable) box (such as footnotes), and are useful for significant amounts of LaTeX commands. An \begin_inset Quotes eld \end_inset inlined \begin_inset Quotes erd \end_inset ERT box displays its content as part of the button, and is useful for very short sections of LaTeX commands. \begin_inset ERT status Inlined \layout Standard % like this \end_inset \layout Standard You can switch between all three by right-clicking on the ERT. Note that if you want more than one line of LaTeX commands, you cannot use the inlined mode. \layout Standard Here's an example of inserting LaTeX commands in a LyX document. The code looks like this: \layout LyX-Code \backslash begin{tabular}{ll} \newline \backslash begin{minipage}{5cm} \newline This is an example for a minipage environment. You \newline can put nearly everything in it, even (non-floating) \newline figures and tables. \newline \backslash end{minipage} \newline & \newline \backslash begin{minipage}{5cm} \newline \backslash begin{verbatim} \newline \backslash begin{minipage}{5cm} \newline This ... \newline \backslash end{minipage} \newline \backslash end{verbatim} \newline \backslash end{minipage} \newline \backslash end{tabular} \layout LyX-Code \layout Standard The ERT box containing this text is directly after this paragraph. Those of you reading the manual online will only see a bunch of funky text in red. Those reading a printed version of the manuals will see the actual results: \layout Standard \begin_inset ERT status Collapsed \layout Standard \backslash begin{tabular}{ll} \newline \backslash begin{minipage}{5cm} \newline This is an example for a minipage environment. You can put nearly everything in it, even (non-floating) figures and tables. \newline \backslash end{minipage} \newline & \newline \backslash begin{minipage}{5cm} \newline \backslash begin{verbatim} \newline \backslash begin{minipage}{5cm} \newline This ... \newline \backslash end{minipage} \newline \backslash end{verbatim} \newline \backslash end{minipage} \newline \backslash end{tabular} \end_inset \layout Standard In addition to these two methods, you can also create a separate file containing some complex LaTeX structure. You can then use \family sans \bar under I \bar default nsert\SpecialChar \menuseparator \bar under I \bar default nclude\SpecialChar ~ File \family default to include your file (you should select the type \family sans Input \family default ). We recommend that you only do this if you have a \family typewriter .tex \family default file which you \emph on know \emph default works already. Otherwise, you'll have a big job tracking down LaTeX errors\SpecialChar \ldots{} \layout Standard There are a few last notes to emphasize: \layout Itemize Inside of LyX, LaTeX code appears \emph on in red \layout Itemize LyX \emph on does not \emph default check if your LaTeX code is correct. \layout Itemize Beware reinventing the wheel. \layout Standard That last note refers to two things. First, LyX does have quite a few features tucked into it, and more are coming. Be sure to check the manuals to make sure that LyX doesn't have such-and-such feature before you go off merrily coding LaTeX. Second, there are numerous LaTeX packages out there to do all sorts of things, from labels to envelopes to fancy multipage tables. Check out a CTAN site for details (see Section \begin_inset Quotes eld \end_inset Requirements \begin_inset Quotes erd \end_inset of the \emph on User's Guide \emph default ). \begin_inset Foot collapsed true \layout Standard Note from \noun on John Weiss \noun default : I seem to do this an awful lot. Sat down and merrily began coding something to print out labels, only to learn that there were already 2 different LaTeX packages to do this. Worse yet --- I had them already! \end_inset \layout Standard If you do need to do some wild and fancy things within your document, be sure to check out a good LaTeX book for assistance. There are a number of them listed in the bibliography of the \emph on User's Guide \emph default . \layout Standard There are a number of LaTeX commands which have to be placed before the beginning of the actual text. They go into the preamble, and this is explained in the next section. \layout Section LyX and the LaTeX Preamble \layout Subsection About the LaTeX Preamble \layout Standard \begin_inset LatexCommand \label{sec:preamble} \end_inset If you already know LaTeX, there is no need to explain here what the preamble is good for. If you don't, the following will give you some ideas --- we recommend again that you consult a LaTeX book for further information. In any case, you should read the points below, because they explain what you can do and what you don't need to do in the LaTeX preamble of a LyX document. \layout Standard The LaTeX preamble comes at the very beginning of a document, \emph on before \emph default the text. It serves to: \layout Itemize declare the document class. LyX already does this for you. \begin_deeper \layout Standard If you're a seasoned LaTeX-nician, and you have some custom document class you want to use, check out the \emph on Customization Manual \emph default for information on how to make LyX interface to it. Be sure to submit your efforts to the LyX Team for inclusion in future versions! \end_deeper \layout Itemize declare the usage of packages. LaTeX packages provide special commands, which are only available within a document when the package has been declared in the preamble. For example, the \family typewriter \family default package \family typewriter indentfirst \family default forces all paragraphs to be indented. There are other packages for labels, envelopes, margins, etc. \layout Itemize set counters, variables, lengths and widths. There are several LaTeX counters and variables which \emph on must \emph default be set globally from within the preamble in order to have the desired effect. [There are other variables which you can set and reset inside the document, too.] Margins are a good example of something which must be set in the preamble. Another example is the label format for lists. You can actually set these just about anywhere, but it's best to do it just once, inside the preamble. \layout Itemize declare user defined commands [with \family typewriter \backslash newcommand \family default or \family typewriter \backslash renewcommand \family default ], mostly abbreviations for LaTeX commands which appear very often inside a document. Although the preamble is a good place to declare such commands, they \emph on can \emph default be declared anywhere else [but \emph on before \emph default they are used for the first time, of course\SpecialChar \ldots{} ]. This can be useful if there is a lot of raw LaTeX code in your document, which normally should not be the case. \layout Standard LyX adds its own set of definitions to the preamble of the \family typewriter .tex \family default file it produces. This makes LaTeX files generated by LyX portable. \layout Subsection Changing the Preamble \layout Standard The commands which LyX adds to the preamble of a LaTeX file are fixed; you can't change them without patching LyX itself. You can, however, add your own stuff to the preamble. There are two ways to do this: \layout Enumerate Select \family sans \bar under P \bar default reamble\SpecialChar \ldots{} \family default from the \family sans \bar under L \bar default ayout \family default menu, or via the \family sans \bar under L \bar default ayout \family default \SpecialChar \menuseparator \family sans \bar under D \bar default ocument \family default dialog, depending on your frontend. Note that the LyX keybindings will not work in this dialog, alas. \layout Enumerate Use the preamble contents you've added as your default template (see \begin_inset Quotes eld \end_inset Basic LyX Setup \begin_inset Quotes erd \end_inset in the \emph on User's Guide \emph default ), so that it will be the default preamble for any file you create. \layout Standard LyX adds anything in the \family sans \bar under P \bar default reamble \family default dialog to its own built-in preamble. Before adding your own declarations in the preamble, you should make sure that LyX doesn't already support what you want to do (remember what we said about reinventing the wheel?). Also, \emph on make sure your preamble code is correct \emph default . LyX doesn't check it. \layout Subsection Examples \layout Standard Here are some examples of what you can add to a preamble, and what they do: \layout Subsubsection Example #1: Offsets \layout Standard There are two variables under LaTeX that control page position: \family typewriter \backslash hoffset \family default and \family typewriter \backslash voffset \family default . Their names should be self-explanatory. These variables are useful if you think for a moment about computer labels. Sometimes, the size of a print medium and the area of the medium that you can actually print on aren't the same. This is where \family typewriter \backslash hoffset \family default and \family typewriter \backslash voffset \family default come in. \layout Standard The default values for \family typewriter \backslash hoffset \family default and \family typewriter \backslash voffset \family default are both 0 pt.,\SpecialChar ~ i.\SpecialChar ~ e.\SpecialChar ~ the page isn't shifted. \layout Standard Unfortunately, some DVI drivers always seem to shift the page. We have no idea why, or why the sysadmin hasn't fixed such behavior. If you're using LyX on a system that you don't personally maintain, and your sysadmin is a doofus, \family typewriter \backslash hoffset \family default and \family typewriter \backslash voffset \family default can save the day. Suppose you're left and top margins are always 0.5 inches too big. You can add this to the preamble: \layout LyX-Code \backslash setlength{ \backslash hoffset}{-0.5 in} \layout LyX-Code \backslash setlength{ \backslash voffset}{-0.5 in} \layout Standard \SpecialChar \ldots{} and your margins should now be correct. \layout Subsubsection Example #2: Labels \layout Standard Speaking of labels, suppose you wanted to print out a bunch of address labels. There's a rather nice package, available at your nearest CTAN archive, for printing sheets of labels, called \family typewriter labels.sty \family default . Now, your system may not have this package installed by default. We leave that up to you to check. You'll also want to read the documentation for it; we're not going to do that for you. Since this is an example, however, we'll give you an example of how you use this package. \layout Standard First, make sure you're using the \family sans article \family default document class. Next, you need to put the following in your preamble: \layout LyX-Code \backslash usepackage{labels} \layout LyX-Code \backslash LabelCols=3 \layout LyX-Code \backslash LabelRows=7 \layout LyX-Code \backslash LeftBorder=8mm \layout LyX-Code \backslash RightBorder=8mm \layout LyX-Code \backslash TopBorder=9mm \layout LyX-Code \backslash BottomBorder=2mm \layout Standard This sets things up for Avery® label sheets, stock #5360. You're now ready to print labels, but you'll need to insert LaTeX code, placing the commands \family typewriter \backslash begin{labels} \family default and \family typewriter \backslash end{labels} \family default around each label text. This and other special features of \family typewriter labels.sty \family default are explained in its documentation. \layout Standard Someday, someone may write a LyX layout file to support this package directly. Maybe that someone is you. \layout Subsubsection Example #3: Paragraph Indentation \layout Standard Americans are trained to indent the first line of \emph on every \emph default paragraph. As with all of their other weird quirks, most Americans will whine and moan until they can have their way and indent the first line of all paragraphs. \begin_inset Foot collapsed true \layout Standard Note from \noun on John Weiss \noun default : This was written by an American --- \emph on me \emph default ! It's my perception of my fellow countrymen. Tough if you don't like it. Thpbpbpbpbpbpbpbp! \end_inset \layout Standard Of course, this behavior isn't standard typography. In books, you typically only indent the first line of a paragraph \emph on if \emph default it follows another one. The idea behind indenting the first line of a paragraph is to distinguish neighboring paragraphs from one another. If there is no previous paragraph, for example, it follows a figure, or is the first paragraph in a section, then there is no special indentation. \layout Standard If you're a typical American, though, you don't care about such esoteric things; you want your indentation! Add this to the preamble: \layout LyX-Code \backslash usepackage{indentfirst} \layout Standard If your TeX distribution isn't a braindead one, you'll have this package, and all of your paragraphs will get the indentation you think they deserve. \layout Subsubsection Example #4: This Document \layout Standard You can also check out the preamble of this document to get an idea of some of the advanced things you can do. You'll probably need to make the \family sans \bar under P \bar default reamble\SpecialChar \ldots{} \family default dialog full-screen to see most of it. Also, there are more examples and an assortment of LaTeX \begin_inset Quotes eld \end_inset dirty tricks \begin_inset Quotes erd \end_inset given in Chapter\SpecialChar ~ \begin_inset LatexCommand \ref{cha:secrets} \end_inset . \layout Section LyX and LaTeX Errors \layout Standard When LyX calls LaTeX, it tells LaTeX to blithely ignore any errors and keep going. It then uses the log-file from the LaTeX run to do a post-mortem. As we stated earlier in the chapter, LyX generates two kinds of \family typewriter .tex \family default files, one of which it uses to locate errors in the document. If there was an error someplace, LyX will put a box with the word \begin_inset Quotes eld \end_inset Error \begin_inset Quotes erd \end_inset at the appropriate place in the document. \begin_inset Foot collapsed true \layout Standard LyX will occasionally misguess where the error was. This will typically happen with tables, figures, math, and the preamble. \end_inset It will also display a message alerting you to the fact that there were errors. \layout Standard You can navigate through the errors by using \family sans \bar under E \bar default rror \family default in the \family sans \bar under N \bar default avigate \family default menu. You can \begin_inset Quotes eld \end_inset open \begin_inset Quotes erd \end_inset the error-boxes and view the error message LaTeX produced by clicking on it. \layout Standard Some folks also like to look at the log file directly, accessible from \family sans \bar under V \bar default iew\SpecialChar \menuseparator \bar under L \bar default aTeX\SpecialChar ~ Logfile \family default . There are some fairly common error messages and warnings. We'll cover those here. You should look at a good LaTeX book for a complete listing. \layout Itemize \begin_inset Quotes eld \end_inset \family typewriter LaTeX Warning: \family default \begin_inset Quotes eld \end_inset \begin_deeper \layout Standard Anything beginning with these word is a warning message for the purpose of \begin_inset Quotes eld \end_inset debugging \begin_inset Quotes erd \end_inset the LaTeX code itself. You'll get messages like this if you added or changed cross-references or bibliography entries, in which case, LaTeX is trying to tell you that you need to make another run. \layout Standard You can by-and-large ignore these. \end_deeper \layout Itemize \begin_inset Quotes eld \end_inset \family typewriter LaTeX Font Warning: \family default \begin_inset Quotes erd \end_inset \begin_deeper \layout Standard Another warning message, this time about fonts which LaTeX couldn't find. The rest of the message will often say something about a replacement font that LaTeX used. \layout Standard You can safely ignore these. \end_deeper \layout Itemize \begin_inset Quotes eld \end_inset \family typewriter Overfull \backslash hbox \family default \begin_inset Quotes erd \end_inset \begin_deeper \layout Standard LaTeX absolutely \emph on loves \emph default to spew these out. They are warning you about lines that were too long and run past the right margin. Almost always, this is unnoticeable in the final output. Or, only one or two characters extend past the margin. LaTeX seems to generate at least one of these messages for just about any document you write. \layout Standard You can ignore these stupid messages. Your eyes will tell you if there's a problem with something that's too wide; just look at the output. \end_deeper \layout Itemize \begin_inset Quotes eld \end_inset \family typewriter Underfull \backslash hbox \family default \begin_inset Quotes erd \end_inset \begin_deeper \layout Standard Not quite as common as its cousin. LaTeX seems to like to print lines that are a bit too wide as opposed to ones that are a bit too narrow. We have no idea why. \layout Standard You can ignore these, too. \end_deeper \layout Itemize \begin_inset Quotes eld \end_inset \family typewriter Overfull \backslash vbox \family default \begin_inset Quotes erd \end_inset and \begin_inset Quotes eld \end_inset \family typewriter Underfull \backslash vbox \family default \begin_inset Quotes erd \end_inset \begin_deeper \layout Standard Warnings about troubles breaking the page. Once again, just look at the output. Your eyes will tell you where something has gone wrong. \end_deeper \layout Itemize \begin_inset Quotes eld \end_inset \family typewriter LaTeX Error: File \begin_inset Quotes els \end_inset Xxxx \begin_inset Quotes ers \end_inset not found \family default \begin_inset Quotes erd \end_inset \begin_deeper \layout Standard The file \begin_inset Quotes eld \end_inset Xxxx \begin_inset Quotes erd \end_inset isn't installed on this system. This usually appears because some package your document needs isn't installed. If you didn't touch the preamble or didn't use the \family typewriter \backslash usepackage{} \family default command, then one of the packages LyX tried to load is missing. Use \family sans \bar under H \bar default elp\SpecialChar \menuseparator L \bar under a \bar default TeX Configuration \family default , to get a list of packages that LyX knows about. This file is updated whenever you reconfigure LyX (using \family sans \bar under E \bar default dit \bar under \SpecialChar \menuseparator R \bar default econfigure \family default ) and tells you which packages have been detected and what they do. \layout Standard If you \emph on did \emph default use the \family typewriter \backslash usepackage{} \family default command, and the package in question isn't installed, you'll need to install it yourself. \end_deeper \layout Itemize \begin_inset Quotes eld \end_inset \family typewriter LaTeX Error: Unknown option \family default \begin_inset Quotes erd \end_inset \begin_deeper \layout Standard Error messages beginning with this are trying to tell you that you specified a bad or undefined option to a package. Check the package's documentation. \end_deeper \layout Itemize \begin_inset Quotes eld \end_inset \family typewriter Undefined control sequence \family default \begin_inset Quotes erd \end_inset \begin_deeper \layout Standard If you've inserted LaTeX code into your document, but made a typo, you'll get one of these. You may have forgotten to load a package. In any case, this error message usually means that you used an undefined command. \end_deeper \layout Standard There are other error and warning messages. Some are self-explanatory. These are usually LaTeX messages. Others are downright cryptic. These are actually TeX error messages, and we really have \emph on no clue \emph default what they mean or how to decipher them. \layout Standard There's a general sequence you should follow if you get error messages: \layout Enumerate Look at the LaTeX code you inserted for typos. \layout Enumerate If there are no typos, check and see that you used the command(s) correctly. \layout Enumerate If you get a bunch of error boxes piled up at the very top of the document, it means that there are errors in the preamble. Start debugging your preamble. \layout Enumerate If you didn't add anything to the preamble and didn't add any LaTeX code to the document, the first suspect is your LaTeX distribution itself. Check for missing packages and install them. \layout Enumerate Okay, so there are no missing packages. Did you use any of the fine-tuning options in LyX? Specifically, did you \emph on misuse \emph default any of them, like trying to manually insert lots of \family sans Protected\SpecialChar ~ Blank \family default s, \family sans Linebreak \family default s, or \family sans Pagebreak \family default s? Did you try to kludge something together with these instead of using the appropriate paragraph environment? \layout Enumerate All right, you didn't use any of the fine-tuning options, you played by the rules. Did you try to pull a fancy maneuver? Did you do something funky inside a table or an equation, like inserting a graphic into a table cell? \layout Enumerate Do you have long sections of text where LaTeX cannot find a place to break a line? By default, LaTeX is rather strict about how much extra inter-word spacing it will add in order to break a line. Preferrably, you should rework the paragraph to avoid the problem. If this isn't an option, you can wrap your text in \family typewriter \backslash sloppypar \family default to make LaTeX's line breaking more, well, sloppy. \layout Enumerate Did you go overboard with the nesting? LyX (currently) doesn't check to make sure you're in the limits for nesting environments. If you nested a bunch of environments to the \begin_inset Formula $17^{\mathrm{th}}$ \end_inset level, that's the problem. \layout Enumerate Okay, you didn't get any error messages, but your output looks whacked. If you have a table or figure that's too wide or long for the page, you need to: \begin_deeper \layout Enumerate rescale the figure so it fits. \layout Enumerate trim down the table so it fits. \layout Standard If something else is wrong with the output, and you didn't try to pull anything fancy or kludge the fine-tuning options, we're not sure what's wrong. \end_deeper \layout Standard If all this doesn't help --- well, then \emph on perhaps \emph default you might have found a bug in LyX\SpecialChar \ldots{} \layout Chapter Supplemental Tools \layout Section Preparing a Bibliography with BibTeX \layout Standard \added_space_bottom bigskip by \noun on Mike Ressler \layout Standard \noindent STOP! If you don't know what BibTeX is, or have a reasonably good idea of how to use it ( \emph on e.g. \emph default setting up your own bibliographic databases), \emph on run \emph default , do not walk, to your nearest copy of the 2nd edition of Lamport's \emph on LaTeX: A Document Preparation System \emph default , particularly Appendix B. The rest of this discussion assumes you have created a correct bibliography file, that you have all relevant environment variables set correctly (esp. \family typewriter BIBINPUTS \family default , \family typewriter BSTINPUTS \family default , and \family typewriter TEXINPUTS \family default ), and that if sufficiently desperate, you could create and \begin_inset Quotes eld \end_inset TeX \begin_inset Quotes erd \end_inset a LaTeX file with a BibTeX database. \layout Standard For those who don't know what BibTeX is, it is a system for creating a large database of your most used journal references. For all future articles you write, you only need to include this standard database and reference the appropriate key to each reference. Even if you write only a few papers with handful of references each, it is well worth your time to examine BibTeX and decide whether it will be useful to you. \layout Standard To use BibTeX with LyX, first read the \emph on User Guide \emph default where it describes how to insert citations. The basic mechanism for inserting BibTeX references is the same. Then, at the very end of your document, select \family sans Insert\SpecialChar \menuseparator Lists \family default & \family sans TOC\SpecialChar \menuseparator BibTeX Reference \family default . In the resulting dialog, fill out the dialog boxes as follows: \layout Description Database: enter the name of your \family typewriter .bib \family default file \emph on without \emph default the \family typewriter .bib \family default extension. For searching multiple \family typewriter .bib \family default files, just enter them in the desired order, separated by commas. \layout Description Style: enter the name of your BibTeX style file *without* the \family typewriter .bst \family default extension. The default style is \family typewriter plain \family default (which should be included in your LaTeX distribution, so you don't have to worry about creating it). \layout Standard For each citation, assuming that the source is in the \family typewriter .bib \family default file, just call \family sans Insert\SpecialChar \menuseparator Citation Reference \family default at the correct location in the text, and enter the appropriate reference key. Nothing else is required; when invoking \family sans \bar under V \bar default iew\SpecialChar \menuseparator \bar under D \bar default vi \family default , for example, you should see that BibTex and LaTeX are invoked as needed, including multiple invocations of LaTeX. \layout Section Making an Index \layout Standard A good index is one of the hardest things to make in a lengthy document, but LyX helps make things a bit simpler by interfacing to the \family typewriter makeindex \family default program which is found in most recent LaTeX distributions. Inserting an index and marking words to include in it works much the same way as preparing a bibliography as mentioned in the last section. \layout Standard First, go to the end of your file and select \family sans \bar under I \bar default nsert\SpecialChar \menuseparator Lists \family default \SpecialChar ~ &\SpecialChar ~ \family sans T \bar under O \bar default C\SpecialChar \menuseparator \bar under I \bar default ndex \family default \SpecialChar ~ \family sans List \family default . Then, for each word you would like to include in the index, go to the end of that word and click on \family sans \bar under I \bar default nsert\SpecialChar \menuseparator Index \family default \SpecialChar ~ \family sans entry \family default \SpecialChar \ldots{} . This will insert a tag showing the word as it will appear in the index. That's all there is to it; LyX will automatically call \family typewriter makeindex \family default for you and create the index itself. The text in the dialog available from right-clicking on the index button accepts LaTeX, so you'll need to be careful to avoid using any special characters. On the positive side, you can use the advanced options - have a look at the documentation which comes with your LaTeX distribution to find out how to do things like \begin_inset Quotes eld \end_inset nested entries \begin_inset Quotes erd \end_inset , etc. \layout Standard Be careful not to put spaces between the word in the text and the index marker; apparently the wrong page number can be produced if this happens. \layout Section Multipart Documents \layout Subsection General Operation \layout Standard When you are working on a large file with many sections, it is often convenient to break up the document into several files, or perhaps you have something where a table may change from time to time, but the preceding text does not. In these cases, you should seriously consider using multipart documents. For example, scientific papers often have five major sections: the introduction , observations, results, discussion, and conclusion. Each of these could be its own separate LyX file, with one \begin_inset Quotes eld \end_inset master \begin_inset Quotes erd \end_inset file which contains the title, authors, abstract, references, etc., plus the five included files. It is important to note that each of these files is a full LyX file which can be formatted and printed on its own, as well as included in a master file. Each of these files must have the same document class, however--- don't attempt to mix book classes with article classes. You may also include LaTeX files; however, these files must not have their own preamble \emph on (i.e. \emph default everything up to and including the \family typewriter \backslash begin{document} \family default line as well as the \family typewriter \backslash end{document} \family default line must be deleted) or else errors will be generated when you try to make a DVI file. \layout Standard LyX allows you to include files quite easily with \family sans \bar under I \bar default nsert\SpecialChar \menuseparator In \bar under c \bar default lude\SpecialChar ~ File \family default . When you click on this selection a small box is inserted into the file at the current cursor location. Clicking on the box raises a dialog which allows you to select the file to be included, and the method of its inclusion. \layout Standard The file selection box should by now be obvious. The three inclusion methods are \begin_inset Quotes eld \end_inset include \begin_inset Quotes erd \end_inset , \begin_inset Quotes eld \end_inset input \begin_inset Quotes erd \end_inset , and \begin_inset Quotes eld \end_inset verbatim \begin_inset Quotes erd \end_inset . The difference between \begin_inset Quotes eld \end_inset include \begin_inset Quotes erd \end_inset and \begin_inset Quotes eld \end_inset input \begin_inset Quotes erd \end_inset is really only meaningful to LaTeXperts, but the practical difference is that files which are \begin_inset Quotes eld \end_inset included \begin_inset Quotes erd \end_inset are typeset beginning on a new page, while files which are \begin_inset Quotes eld \end_inset inputted \begin_inset Quotes erd \end_inset are typeset starting on the current page. Perhaps the labeling in LyX will be changed someday to reflect this. \layout Standard Generally, the master file is converted into a full LaTeX file before typesettin g, while the included files are converted to LaTeX files which do not have all the preamble information. Checking the \family sans Don't \family default \SpecialChar ~ \family sans typeset \family default button prevents this conversion. \layout Standard A \begin_inset Quotes eld \end_inset verbatim \begin_inset Quotes erd \end_inset included file allows you to include a file typeset exactly as it appears in the file, i.e.\SpecialChar ~ verbatim mode, with the characters set in a fixed-width typewriter font. Normally, spaces in this file are invisible, though two consecutive spaces are conserved, unlike LyX's normal treatment of spaces. However, the \family sans Visible \family default \SpecialChar ~ \family sans space \family default button typesets a mark to unambiguously define the presence of a space. \emph on \layout Subsection Cross-References Between Files \layout Standard It is possible to set up cross-references between the different files. First, open all the files in question: let's call them A and B in a two file example, where B is included in A. Let's say you insert a label in A, then want to reference it in B. Open the cross-reference dialog in whilst in document B, and you can select the \begin_inset Quotes eld \end_inset buffer \begin_inset Quotes erd \end_inset to use. \layout Section Algorithms \layout Standard The package \family sans algorithm \family default is needed by LyX to be able to output algorithm floats. These are useful in placing short algorithms across page breaks and support an index of algorithms too. \layout Section Subfigures \layout Standard The package \family sans subfigure \family default is used by LyX when you select ``subfigure'' in the graphics dialog and enter the subfigure caption. Several figures marked in this way can be packed into a single float with individual sub-captions. \layout Section Fancy Headers and Footers \layout Standard The default page layout is rather plain; for an article document class, all you get is a centered page number at the bottom of the page. This document is the book class, so it appears to be a bit fancier, but to really put on a show, you need to set the document page style to \begin_inset Quotes eld \end_inset fancy \begin_inset Quotes erd \end_inset , as mentioned in the \family sans User\SpecialChar ~ Guide \family default . This section describes the LaTeX codes you need to insert in your LaTeX preamble or the text in order to get the desired effects. \layout Standard The page header is divided into three fields, not surprisingly labeled \begin_inset Quotes eld \end_inset left \begin_inset Quotes erd \end_inset , \begin_inset Quotes eld \end_inset center \begin_inset Quotes erd \end_inset , and \begin_inset Quotes eld \end_inset right \begin_inset Quotes erd \end_inset . The footer is also divided into these three fields. The LaTeX commands to set these fields in the simplest manner are \family typewriter \backslash lhead \family default , \family typewriter \backslash chead \family default , \family typewriter \backslash rhead \family default , \family typewriter \backslash lfoot \family default , etc. Suppose you wish to put your name in the upper left hand corner of each page. Simply insert the following command in the preamble: \layout Standard \family typewriter \backslash lhead{John Q. DocWriter} \layout Standard You will now see your name in the upper left. If a field has a default entry that you would like to get rid of (often the page number appears in the central footer, simply include a command with a blank argument, e.g. \layout Standard \family typewriter \backslash cfoot{} \layout Standard Let's get really fancy: lets put the section number with the word \begin_inset Quotes eld \end_inset Section \begin_inset Quotes erd \end_inset (e.g. Section 3) in the upper left, the page number (e.g. Page 4) in the upper right, your name in the lower left, and the date in the lower right. The following commands should now appear in the preamble: \layout Standard \family typewriter \backslash lhead{Section \backslash thesection} \layout Standard \family typewriter \backslash chead{} \layout Standard \family typewriter \backslash rhead{Page \backslash thepage} \layout Standard \family typewriter \backslash lfoot{John Q. DocWriter} \layout Standard \family typewriter \backslash cfoot{} \layout Standard \family typewriter \backslash rfoot{ \backslash today} \layout Standard The codes \family typewriter \backslash thesection \family default and \family typewriter \backslash thepage \family default access LaTeX's section and page counters, and so print out the current section and page numbers. \family typewriter \backslash today \family default simply prints out today's date. \layout Standard The thicknesses of the horizontal rules drawn beneath the header and above the footer can also be modified. If you don't want one of the headers, set its thickness to 0. The header rule has a default thickness of 0.4pt, the footer rule is 0pt. Use the commands, e.g. \family typewriter \backslash renewcommand{ \backslash headrulewidth}{0.4pt} \family default and \family typewriter \backslash renewcommand{ \backslash footrulewidth}{0.4pt} \family default to set the thicknesses. \layout Standard You can switch the header/footer settings on and off for individual pages using commands like \family typewriter \backslash thispagestyle{empty} \family default , \family typewriter \backslash thispagestyle{plain} \family default , and \family typewriter \backslash thispagestyle{fancy} \family default . Simply insert them in the text on the page you want changed and mark them as TeX code. In fact, title pages are marked as plain by default, while following pages are marked fancy when using the global fancy setting. \layout Standard There are more complex commands which will let you insert things in the upper left on odd numbered pages, etc., but I will refer you to the \family typewriter fancyhdr \family default package documentation for more descriptions. For example, if you have a teTeX installation, look for \family typewriter /usr/share/texmf/doc/latex/fancyhdr/\SpecialChar \- fancyhdr.dvi \family default . \layout Standard As a final example, it is possible to include an Encapsulated PostScript® file in the header or footer. Suppose you want to put a company logo in the upper lefthand corner. You might try something like \layout Standard \family typewriter \backslash lhead{ \backslash resizebox{1in}{!}{ \backslash includegraphics{logo.eps}}} \layout Standard \noindent (you may need to preface this with \family typewriter \backslash usepackage{graphics} \family default if you don't include EPS files elsewhere in your document). \layout Section Minipages \layout Standard LaTeX provides a mechanism to produce essentially a page within a page, called minipages. Within a minipage, all the usual rules of indentation, line wrapping, etc.\SpecialChar ~ apply. LyX also provides some of the minipage capability. \layout Standard Minipages in LyX have their own collapsable box; insert one via \family sans \bar under I \bar default nsert\SpecialChar \menuseparator Mini \bar under p \bar default age \family default . Right-clicking on the box allows you to alter the minipage's width and alignment within the page. Warning: if the minipage is too long to fit on a page, it is truncated, not wrapped onto the next page. \layout Standard If you place two minipages side-by-side, you can use \family sans \bar under I \bar default nsert\SpecialChar \menuseparator \bar under S \bar default pecial\SpecialChar ~ Character \family default to insert a special instruction known in the LaTeX world as an \family typewriter hfill \family default to put a maximum amount of space between them; it forces one minipage to the left edge, the other to the right edge. The examples below show the difference. \layout Standard \begin_inset Minipage position 0 inner_position 0 height "0pt" width "1.5in" collapsed true \layout Standard This is a minipage which does not use hfill. This is the second sentence of a minipage which does not use hfill. \end_inset \layout Standard \begin_inset Minipage position 0 inner_position 0 height "0pt" width "1.5in" collapsed true \layout Standard This is a second minipage which does not use hfill. This is the second sentence of a second minipage which does not use hfill. \end_inset \layout Standard \added_space_top medskip \added_space_bottom medskip Here is some normal text to separate the two examples. \layout Standard \begin_inset Minipage position 0 inner_position 0 height "0pt" width "1.5in" collapsed true \layout Standard This is a minipage which does use hfill. This is the second sentence of a minipage which does use hfill. \end_inset \hfill \begin_inset Minipage position 0 inner_position 0 height "0pt" width "1.5in" collapsed true \layout Standard This is a second minipage which does use hfill. This is the second sentence of a second minipage which does use hfill. \end_inset \layout Section Wrapping Text Around Figures \begin_inset LatexCommand \label{sec:floatflt} \end_inset \layout Standard \begin_inset Wrap figure placement r width "6cm" collapsed false \layout Standard \begin_inset Graphics filename mobius.eps display color width 40col% rotateOrigin center \end_inset \layout Caption This is a wrapped figure, and this is the brilliant caption that describes it \end_inset \layout Standard A very frequently asked question is whether text can be made to \begin_inset Quotes eld \end_inset wrap \begin_inset Quotes erd \end_inset around figures so that a figure occupies some fraction of the column width and text fills the rest. If you have the LaTeX package \family typewriter floatflt \family default installed (you can find out about it in the \emph on LaTeX Configuration \emph default manual) you can do this. \layout Standard At the right is a figure of a mobius strip---you should have already seen this in the \emph on User's Guide \emph default . To wrap the text like this insert a wrap box via \family sans \bar under I \bar default nsert\SpecialChar \menuseparator Flo \bar under a \bar default ts\SpecialChar \menuseparator Floatflt Figure \family default . \layout Standard Note: this package is very fragile! For example, having a figure too close to the bottom of the page will mess things up, as will having two figures close together. Use this package sparingly and do read the documentation that came with it (which will also tell you how to wrap text around tables). \layout Section Extra Table Options \layout Standard While the standard table layout will suffice in 99% of all tables you generate, occasionally you will run into one which requires a bit of extra tweaking. The tabular dialog which appears on a right-click of a table allows these tweaks to be made. It will give you access to some extra column alignment parameters. A little bit of LaTeX background is useful here: when you set up a table in LaTeX, each column is given an alignment type. For example, you would give it \begin_inset Quotes eld \end_inset \family typewriter l \family default \begin_inset Quotes erd \end_inset , \begin_inset Quotes eld \end_inset \family typewriter c \family default \begin_inset Quotes erd \end_inset , or \begin_inset Quotes eld \end_inset \family typewriter r \family default \begin_inset Quotes erd \end_inset for left-aligned, centered, and right-aligned columns respectively (which appear as the left/center/right radio buttons in LyX). A fourth type is \begin_inset Quotes eld \end_inset \family typewriter p \family default \begin_inset Quotes erd \end_inset , which will make a column of a specified width (the width box in LyX), and will wrap text within that box. A fifth type is \begin_inset Quotes eld \end_inset \family typewriter | \family default \begin_inset Quotes erd \end_inset (vertical bar) which rather than making a column will make a vertical rule at that point; this manifests itself in LyX as the \begin_inset Quotes eld \end_inset borders \begin_inset Quotes erd \end_inset buttons. Finally, there is a type \begin_inset Quotes eld \end_inset \family typewriter @ \family default \begin_inset Quotes erd \end_inset , which allows you to use whatever is enclosed in the accompanying braces as the column separator, including a null argument. The reasons for doing this may not be obvious, but they can be very powerful. They are best demonstrated by example. \layout Subsection Removing Extra Column Space \layout Standard Here is a standard table: \layout Standard \align center \begin_inset Tabular \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none Type \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none Example \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none Rock \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none Granite \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none Mineral \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none Quartz \end_inset \end_inset \layout Standard Notice that the horizontal rule extends a bit past the text on both sides. If you wanted the line to end even with the text, we can put a null separator on the ends to get rid of the bit of extra space LaTeX adds by default. Here is the example: \layout Standard \align center \begin_inset Tabular \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none Type \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none Example \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none Rock \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none Granite \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none Mineral \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none Quartz \end_inset \end_inset \layout Standard In this case, the column specifier for the left column was set to \begin_inset Quotes eld \end_inset \family typewriter @{} l \family default \begin_inset Quotes erd \end_inset , while the right column was set to \begin_inset Quotes eld \end_inset \family typewriter l @{} \family default \begin_inset Quotes erd \end_inset , in order to put the null characters on the edges. \layout Subsection Changing the Column Separator Character \layout Standard Now suppose you really wanted, for reasons that are completely opaque, to use \begin_inset Formula $\sqrt{\pi}$ \end_inset with some space around it for the column separator. Simply turn off the vertical border, then set the right column specifier to \begin_inset Quotes eld \end_inset \family typewriter @{~$ \backslash sqrt{ \backslash pi}$~} l \family default \begin_inset Quotes erd \end_inset . You could now make a table like this: \layout Standard \align center \begin_inset Tabular \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none Type \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none Example \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none Rock \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none Granite \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none Mineral \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none Quartz \end_inset \end_inset \layout Subsection Making a Decimal Point Aligned Column \layout Standard Okay, that last example was very silly, but here is one that is not. Suppose you want to make a table that has a column which is aligned on a decimal point. A standard LaTeX trick to do this is to set the whole number part in a right-aligned column, use a decimal point for the column separator, then set the fractional part as a left-aligned column. A variation on this is to include the decimal point explicitly with the whole part, then use just a null separator in between. The latter variation is demonstrated here: \layout Standard \align center \begin_inset Tabular \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none Expression \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none Value \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none \begin_inset Formula $\pi$ \end_inset \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none 3. \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none 1416 \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none \begin_inset Formula $\pi^{\pi}$ \end_inset \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none 36. \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none 462 \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none \begin_inset Formula $(\pi^{\pi})^{\pi}$ \end_inset \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none 80663. \end_inset \begin_inset Text \layout Standard \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none \begin_inset Formula $\pi^{\pi^{\pi}}$ \end_inset \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none 1. \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none 3402 \begin_inset Formula $\times10^{18}$ \end_inset \end_inset \end_inset \layout Standard Though it appears a bit funny in LyX, on paper it will produce what appears to be a 2-column table in which the right column is aligned on the decimal point and the header appears to be centered over it. \layout Standard Perhaps it is best if I described just what I did: first, create a 3 \begin_inset Formula $\times$ \end_inset 3 table and remove all the borders. Then re-add a bottom border to the top row, and a right border to the first column. Type in the values for the first column and set its alignment to \family sans center \family default . Type in the \family typewriter 3. \family default , \family typewriter 36. \family default , \family typewriter 80663. \family default , and \family typewriter 1. \family default and set that column's alignment to \family sans right \family default . Type in the \family typewriter 1416 \family default , \family typewriter 462 \family default , and \family typewriter 3402 \begin_inset Formula $\times10^{18}$ \end_inset \family default and set the extra column alignment to \family typewriter @{} l \family default . Finally type in the word \family typewriter Value \family default in the middle column, highlight it and the blank entry to its right, and check the \family sans Special Cell \family default entry \family sans multicolumn \family default . Easy, right? \layout Subsection A Better Decimal-Alignment Solution \layout Standard An alternative way to have decimal alignment in tables is through the \family typewriter dcolumn \family default package. Add the following to the LateX preamble: \layout LyX-Code \backslash usepackage{dcolumn} \layout LyX-Code \backslash newcolumntype{d}[1]{D{.}{.}{#1}} \layout Standard To have a column decimally aligned, enter in the \family sans Special Column Alignment \family default box of the \family sans Tabular \family default dialog the following: \layout LyX-Code d{number of decimals of the data} \layout Standard To create extra column space just increase the number of decimals in \family typewriter d{} \family default . Setting the multicolumn attribute for a single cell makes it insensitive to the decimal alignment which comes in handy as well. A drawback of this method is that math mode is not allowed in a column with decimal alignment except if the multicolumn attribute is set. \layout Standard This method offers the same flexibility as the \family typewriter dcolumn \family default package. One could, for example, change the alignment separator, and have different alignment separators for different columns by defining multiple column types in the preamble. The syntax is as follows: \layout LyX-Code D{inputsep}{outputsep}{decimal places} \layout Standard The interested reader is directed towards the \family typewriter dcolumn \family default package documentation for more details. \layout Section Itemize Bullet Selection \begin_inset LatexCommand \label{sec:bullet} \end_inset \layout Standard by \noun on Allan Rae \layout Subsection Introduction \layout Standard LyX provides 216 bullet shapes that can be accessed from a simple dialog. Using this dialog you can easily specify what bullet shape to use at each level of an itemized list. These settings are document-wide so you won't be able to specify different sets of bullets for different paragraphs \begin_inset Foot collapsed true \layout Standard Well, actually you can but you'll have to do it by hand. \end_inset . \layout Subsection How it looks \layout Standard Open the dialog by selecting the \family sans \bar under L \bar default ayout\SpecialChar \menuseparator \bar under D \bar default ocument \family default menu item and then select the \family sans \bar under B \bar default ullets \family default tab. \layout Standard The dialog provides you with a table of bullet shapes. A column of buttons on the left of the table provides access to the six different panels of bullet shapes. The row of buttons across the top is used to select which bullet depth you are changing. A text entry under the table shows the currently selected bullet shape's LaTeX equivalent and this can be edited if desired. If you do modify the text you will also need to specify any needed packages in the LaTeX preamble. \layout Standard The six panels are divided up by the packages they require. The following table shows the mappings from button name to LaTeX packages. \layout Standard \align center \begin_inset Tabular \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none Button \end_inset \begin_inset Text \layout Standard \family roman \series medium \shape up \size normal \emph off \bar no \noun off \color none Packages Required \end_inset \begin_inset Text \layout Standard \family sans \series medium \shape up \size normal \emph off \bar no \noun off \color none Standard \end_inset \begin_inset Text \layout Standard \series medium \shape up \size normal \emph off \bar no \noun off \color none base LaTeX \end_inset \begin_inset Text \layout Standard \family sans \series medium \shape up \size normal \emph off \bar no \noun off \color none Maths \end_inset \begin_inset Text \layout Standard \family typewriter \series medium \shape up \size normal \emph off \bar no \noun off \color none amssymb.sty \end_inset \begin_inset Text \layout Standard \family sans \series medium \shape up \size normal \emph off \bar no \noun off \color none Ding1 \end_inset \begin_inset Text \layout Standard \family typewriter \series medium \shape up \size normal \emph off \bar no \noun off \color none pifont.sty \end_inset \begin_inset Text \layout Standard \family sans \series medium \shape up \size normal \emph off \bar no \noun off \color none Ding2 \end_inset \begin_inset Text \layout Standard \family typewriter \series medium \shape up \size normal \emph off \bar no \noun off \color none pifont.sty \end_inset \begin_inset Text \layout Standard \family sans \series medium \shape up \size normal \emph off \bar no \noun off \color none Ding3 \end_inset \begin_inset Text \layout Standard \family typewriter \series medium \shape up \size normal \emph off \bar no \noun off \color none pifont.sty \end_inset \begin_inset Text \layout Standard \family sans \series medium \shape up \size normal \emph off \bar no \noun off \color none Ding4 \end_inset \begin_inset Text \layout Standard \family typewriter \series medium \shape up \size normal \emph off \bar no \noun off \color none pifont.sty \end_inset \end_inset \layout Standard LyX doesn't stop you using bullets from packages you don't have. If you get errors from LaTeX when you try to view or print the file then its likely you are missing a package. LyX doesn't restrict your use since you may be editing locally and exporting elsewhere. \layout Subsection How to use it \layout Standard Select which bullet depth you want to change then select the bullet shape and size. \family sans \family default Any changes will not be visible in LyX, but are visible when viewing the document using xdvi or ghostview. \layout Standard You can reset a bullet shape to the default simply by clicking your right mouse button on the appropriate bullet depth button. \layout Standard If you \emph on really \emph default want to have multiple sets of paragraphs with different sets of bullets in each then you're going to have to get your hands dirty. The itemize bullet selection dialog can help though because it provides you with the LaTeX code for a wide range of bullet shapes. To make your own custom paragraphs you have the following options: \layout Standard \begin_inset ERT status Inlined \layout Standard \backslash let \backslash savelabelitemi= \backslash labelitemi \end_inset \layout Standard \begin_inset ERT status Inlined \layout Standard \backslash renewcommand \backslash labelitemi[0]{ \backslash small \backslash ( \backslash sharp \backslash )} \end_inset \layout Itemize Use the LaTeX command \family typewriter \backslash renewcommand{}{} \family default to specify a new bullet shape for a given depth. You'll also need to save the current bullet shape so you can restore it again afterwards. In this itemized list the following LaTeX code was used to change the bullet used for the first depth. \newline \family typewriter \backslash let \backslash savelabelitemi= \backslash labelitemi \family default \family typewriter \newline \backslash renewcommand \backslash labelitemi[0]{ \backslash small \backslash ( \backslash sharp \backslash )} \newline \family default Note that the itemize depth is specified in Roman numerals as part of the \family typewriter \backslash labelitem \family default command. \layout Itemize \begin_inset ERT status Inlined \layout Standard [ \backslash ( \backslash star \backslash )] \end_inset Specify each individual entry by starting each item with the bullet shape enclosed in square brackets and set as TeX. For example, this item was started with \family typewriter [ \backslash ( \backslash star \backslash )] \family default . \layout Standard \begin_inset ERT status Inlined \layout Standard \backslash renewcommand \backslash labelitemi[0]{ \backslash savelabelitemi} \end_inset \layout Standard You'll also need to revert the labelitem back to its previous setting for the global bullet shape settings to remain in effect. The way used here was: \newline \family typewriter \backslash renewcommand \backslash labelitemi[0]{ \backslash savelabelitemi} \layout Chapter Special Document Classes \layout Section AMS LaTeX \layout Standard by \noun on David Johnson \layout Standard \added_space_top bigskip \noindent The AMS LaTeX layouts are set up to conform to suggested styles for mathematical papers to be submitted to American Mathematical Society publications. The layouts are not tailored to a specific journal, but easily can be. You should refer to the AMS documentation for specific instructions for each journal (usually it will entail only changing a single line in the TeX output). That documentation is available on the Web at \begin_inset LatexCommand \url{http://www.ams.org} \end_inset or by ftp at \begin_inset LatexCommand \url{ftp://ftp.ams.org/pub/tex/amslatex/} \end_inset .These layouts are appropriate, and useful, for any mathematical writing. There are currently 4 distinct AMS LaTeX layouts: \layout Enumerate amsart: The standard AMS-article format. All results and similar statements are numbered as \begin_inset Formula $(n.m)$ \end_inset , where the first number refers to the section, and the second refers to the total number of results (Theorems, Corollaries, Propositions, Definitions and Remarks, etc.) in that section. There are also many (but not all) environments available unnumbered, which is occasionally needed. Unnumbered environments indicated by an asterisk at the end. \layout Enumerate amsart-seq: Here, numbering for each type of statement is in its own sequence, with no reference to the section number. There are also many (but not all) environments available unnumbered, which is occasionally needed. Unnumbered environments indicated by an asterisk at the end. \layout Enumerate amsart-plain: This one is even more terse, since all the environments are unnumbered. \layout Enumerate amsbook: the standard AMS book (really, monograph) format. Numbering is similar to the amsart layout, except that all numbering is by \begin_inset Formula $(n.m.p)$ \end_inset , where the first number refers to the chapter, the second to the section, and the third is the number of the results (Theorems, Corollaries, Propositions , Definitions and Remarks, etc.) in that section. There are also many (but not all) environments available unnumbered, which is occasionally needed. Unnumbered environments indicated by an asterisk at the end. \layout Standard Any AMS LyX file can be converted to either of the numbering schemes by simply changing the document class in the \family sans \bar under L \bar default ayout\SpecialChar \menuseparator \bar under D \bar default ocument \family default dialog. \layout Subsection What these layouts provide \layout Standard There is a long list of included environments provided by these layouts. Most mathematical papers or books will set as special statements most of these environments, in AMS-LaTeX there is an opportunity to define an unlimited variety of such declarations. However, the AMS recommends the environments that are available in LyX. The list of environments (not counting the standard environments such as \family sans sections, bibliography, title, author, date \family default ), is: \layout Description Theorem This is typically used for the statements of major results. The word \begin_inset Quotes eld \end_inset \family sans Theorem \family default \begin_inset Quotes erd \end_inset appears in bold type, along with an automatically-determined number (an unnumbered version, \family sans Theorem* \family default , is also available). The text is italicized. \layout Description Corollary This is used for statements which follow fairly directly from previous statements. Again, these can be major results. Unnumbered version \family sans Corollary* \family default is available. \layout Description Lemma These are smaller results needed to prove other statements. \layout Description Proposition These are less major results which (hopefully) add to the general theory being discussed. \layout Description Conjecture These are statements provided without justification, which the author does not know how to prove, but which seem to be true (to the author, at least). \layout Description Criterion A required condition. \layout Description Algorithm A general procedure to be used. \layout Description Axiom This is a property or statement taken as true within the system being discussed. \layout Description Definition Guess what this is for. The font, both on-screen and in the output, is different for this environment than for the previous ones. The heading ( \begin_inset Quotes eld \end_inset definition \begin_inset Quotes erd \end_inset ) is still set in boldface, along with the number, if any, but the rest is set upright. \layout Description Example Typeset similarly to Definition. \layout Description Condition \layout Description Problem \layout Description Exercise \layout Description Remark This environment is also a new type of theorem. This is set with the word Remark in italics, and the rest upright. \layout Description Note Set similarly to the Remark environment. \layout Description Notation \layout Description Claim \layout Description Summary \layout Description Acknowledgement \layout Description Case Generally, these are used to break up long arguments, using specific instances of some condition. The numbering scheme for cases is on its own, not together with other numbered statements. \layout Description Conclusion \layout Description Fact \layout Description Proof The word \begin_inset Quotes eld \end_inset \shape italic Proof \shape default \begin_inset Quotes erd \end_inset is set in italics, but the rest is set upright. At the end of this environment (other environments can be nested within this one, of course) a QED symbol (usually a square, but it can vary with different styles) is placed. \layout Description Address This should be the author's permanent address. \layout Description Current\SpecialChar ~ Address This should be the author's temporary address at the time of submission, if different from the Address. \layout Description Email Author's e-mail address \layout Description URL Author's Web address, if desired. \layout Description Keywords Key words or phrases used to identify specific topics discussed in the paper. \layout Description Subjectclass These refer to the AMS Subject Classifications, published and described in \emph on Mathematical Reviews \emph default . These are also available online at the AMS cites listed above. \layout Description Thanks \layout Description Dedicatory \layout Description Translator \layout Standard In addition, these environments automatically provide the AMS LaTeX and AMS fonts packages. They need to be available on your system in order to use these environments. \layout Section Dinbrief \layout Standard The document class \family sans dinbrief \family default can be used to type letters according to German conventions. A template file is included in \family typewriter .../lyx/share/templates \family default for you to use as a starting point. \layout Section Paper \layout Standard The document class \family sans paper \family default provides an alternative to the standard \family sans article \family default class. It provides similar functionality, but you might prefer this layout with sans serif sections, headings, and more. \layout Section A&A Paper \layout Standard by \noun on Peter Sütterlin \layout Subsection Introduction \layout Standard This section describes how LyX can be used to write articles for submission to the scientific journal \emph on Astronomy and Astrophysics \emph default ( \begin_inset LatexCommand \url[www.edpsciences.fr/aa/]{http://www.edpsciences.fr/aa/} \end_inset ) \emph on \emph default using \emph on \emph default Version 5.01 of the document class \family typewriter aa.cls \family default . This package can be downloaded from the ftp site \layout Standard \added_space_top medskip \added_space_bottom medskip \align center \begin_inset LatexCommand \url{ftp://ftp.edpsciences.org/pub/aa/readme.html} \end_inset \layout Standard A manual comes together with that package, and this text is not meant to replace the original manual but merely a short guide how to realize the correct form of your paper. \layout Standard Please note that the publisher of the journal was changed from Springer to EDP Sciences starting January 1, 2001. That change implicated also some slight changes of the style files, namely the removal of the thesaurus command. The LyX class aa supports the newest version of these style files, V 5.01. If you have an older version installed, please upgrade. For compatibility, the old (version 4) layout has been kept as \family sans article (A&A V4) \family default . Please refer to the comments in \family typewriter LyXDir/layouts/aapaper.layout \family default . \layout Subsection Getting started \layout Standard It is recommended you start from the example template distributed with LyX. If you are not using a template, note the following settings: \layout Itemize Select \family sans article (A&A) \family default from the \family sans \bar under C \bar default lass \family default entry in the \family sans Document\SpecialChar \menuseparator Layout \family default dialog (OK, that one was obvious). \layout Itemize Don't change the option \family sans \bar under P \bar default agestyle \family default : Leave it set to \family sans default \family default . The whole layout is done by the macros, you shouldn't change anything. \layout Subsection The header block \layout Standard First thing to enter is the header information. It consists of seven entries, of which some are optional. They are \layout Itemize \family sans Title \family default : [required] \layout Itemize \family sans Subtitle \family default : [optional] \layout Itemize \family sans Author \family default : [required] \layout Itemize \family sans Address \family default : [required] \layout Itemize \family sans Offprints \family default : [optional] if more than one author: whom to contact for offprint requests. \layout Itemize \family sans Mail \family default : [optional] mail address for contacts. \layout Itemize \family sans Date \family default : [required]. Suggested format is \family typewriter Received: ; Accepted \layout Standard There is no need to issue the \family typewriter \backslash maketitle \family default command, this is done automatically by LyX when the header is finished. Although the order of the single header entries doesn't matter it is advised to keep the above sequence, just to get the best optics and meets the layout of the real document. \layout Standard If you want to place footnotes in the header block, e.g. \begin_inset ERT status Collapsed \layout Standard \backslash \end_inset to state your present address, just use the standard footnote via \family sans \bar under I \bar default nsert\SpecialChar \menuseparator \bar under F \bar default ootnote. \family default LyX will automagically use the term \family typewriter \backslash thanks{} \family default in that case. \layout Standard In addition to these topics, the macros use three additional LaTeX commands that have no counterpart in LyX: \layout Itemize \family typewriter \backslash and \family default to separate different names for more than one author and institute, respectivel y. \layout Itemize \family typewriter \backslash inst{} \family default to mark corresponding author/institute pairs. The institutes are numbered sequentially as they appear in the \family sans Address \family default field, so you have to put a marker to each author. \layout Itemize \family typewriter \backslash email{address} \family default to supply an email address for fast contact. \layout Standard In all cases, the appropriate command has to be entered in LyX an marked as LaTeX code. See the examples. \layout Subsection The abstract \layout Standard The abstract should immediately follow the header block. With version 5 the abstract environment was changed to a command, and there is now a resctriction to only one paragraph. In addition, it should contain an entry with the keywords. This is not yet implemented for LyX, therefore you have to enter the LaTeX command \family typewriter \backslash keywords{} \family default by hand and mark it as LaTeX code. Refer to the example paper. \layout Subsection Supported environments \layout Standard The A&A paper layout supports the following environments for structuring your text: \layout Itemize \family sans Standard \layout Itemize \family sans Section \layout Itemize \family sans Subsection \layout Itemize \family sans Subsubsection \layout Itemize \family sans Itemize \layout Itemize \family sans Enumerate \layout Itemize \family sans Description \layout Itemize \family sans Caption \layout Itemize \family sans Abstract \layout Itemize \family sans Acknowledgment \layout Itemize \family sans Bibliography \layout Itemize \family sans LaTeX \layout Subsection Commands not supported by LyX \layout Standard Some commands are not yet supported by the \family sans paper (A&A) \family default layout for LyX. Some have already been mentioned. For the sake of completeness, they are listed all together here: \layout Itemize \family typewriter \backslash and \layout Itemize \family typewriter \backslash email \layout Itemize \family typewriter \backslash appendix \layout Itemize \family typewriter \backslash authorrunning \layout Itemize \family typewriter \backslash inst{} \layout Itemize \family typewriter \backslash keywords{} \layout Itemize \family typewriter \backslash object{} \layout Itemize \family typewriter \backslash titlerunning{} \layout Standard If you want to use any of these commands, you have to enter them yourself. \series bold Do not forget to mark them as LaTeX code! \layout Subsection Figure and Table Floats \layout Standard LyX provides support for the necessary float environments \family sans figure, figure*, table \family default and \family sans table* \family default , therefore we won't tell much about it here. Refer to the \emph on User's\SpecialChar ~ Guide \emph default . Just remember that tables should be left-aligned. For that, select the table and change the alignment in \family sans \bar under L \bar default ayout\SpecialChar \menuseparator \bar under P \bar default aragraph. \layout Standard There is \family sans \family default only one special thing: the figures with caption besides the figure. To create such a figure, you have to do the following: \layout Enumerate Create a wide figure float: \family sans \bar under I \bar default nsert\SpecialChar \menuseparator Fl \bar under o \bar default ats\SpecialChar \menuseparator Figure \family default , then right click in the figure and select \family sans \bar under S \bar default pan columns \family default . \layout Enumerate Enter your caption text. \layout Enumerate Press \family sans Return \family default to move the cursor above the caption. \layout Enumerate Insert your figure \layout Enumerate Position the cursor behind the figure and insert a horizontal fill: \family sans \bar under I \bar default nsert\SpecialChar \menuseparator \bar under S \bar default pecial\SpecialChar ~ Character \bar under \SpecialChar \menuseparator H \bar default Fill \family default . \layout Enumerate Switch to LaTeX mode: \family sans M-c\SpecialChar ~ t \family default . \layout Enumerate Enter \family typewriter \backslash parbox[b]{55mm}{ \family default . \series bold Do not close the brace! \layout Enumerate Position the cursor behind the caption text, switch to LaTeX mode and insert the closing brace: \family sans M-c\SpecialChar ~ t \family typewriter } \family default . \layout Standard Also, refer to the figures in the example paper. \layout Subsection Referee layout \layout Standard For submission, the paper has to be formated in a special double-spacing layout. For this purpose, you have to give the option \family typewriter referee \family default to the documentclass. This must be done using the \family sans E \bar under x \bar default tra\SpecialChar ~ Options \family default field in the \family sans Document\SpecialChar ~ Layout \family default dialog. Just enter the string \family typewriter referee \family default there. \layout Subsection The example paper \layout Standard The \family sans Examples \family default directory contains an example paper written with LyX. It is the example paper from the original macro package, translated to LyX. Use it for inspiration, and compare the original LaTeX code with LyX way of writing. \layout Section AASTeX \layout Standard by \noun on Mike Ressler \layout Subsection Introduction \layout Standard AASTeX is a set of macros produced by the American Astronomical Society to facilitate electronic manuscript submission to the three journals they publish: the Astrophysical Journal (including the Letters and Supplement), the Astronomical Journal, and the Publications of the Astronomical Society of the Pacific. LyX requires version 5.0 (or higher) of these macros. Versions prior to 5.0 are intended for use with LaTeX2.09 and are fundamentally incompatible with LyX. The AASTeX package may be downloaded from the AAS's ftp site \layout Standard \added_space_top medskip \added_space_bottom medskip \align center \begin_inset LatexCommand \url{ftp://ftp.aas.org/pubs} \end_inset \layout Standard A complete user guide is contained in that package and you should familiarize yourself with it thoroughly before embarking on writing a paper in LyX. LyX will not reduce the need to figure out all the AASTeX commands, it will only reduce the drudgery of typing everything in. It is your responsibility to ensure that the final exported LaTeX document conforms completely to the requirements of the journal to which you are submitting your paper. \layout Subsection Starting a New Paper \layout Standard I strongly suggest that you start with the AASTeX template file. Click on \family sans File\SpecialChar \menuseparator New from template \family default , enter the new file name, then choose the \family typewriter aastex.lyx \family default template. This will show the most common fields found in a manuscript. Simply overwrite the existing text (including the brackets, \family typewriter <> \family default ) with the correct information. Many of the AASTeX commands and environments can be implemented directly in LyX, but some cannot: most noticeably \family typewriter \backslash altaffilmark \family default and \family typewriter \backslash altaffiltext \family default , which should stick out like a sore thumb if you actually just opened the template file. For commands such as these, the LaTeX code must be entered directly and marked as such. Such commands are referred to as ERT, or Evil Red Text. I tried to minimize the amount of ERT needed in an AASTeX document, but there is still more required than any of us would like. \layout Subsection Finishing Your Paper \layout Standard When the paper is finished to your satisfaction and previews/prints correctly, there are a few \begin_inset Quotes eld \end_inset postprocessing \begin_inset Quotes erd \end_inset actions which need to be done before you submit it to the journals. \layout Enumerate Export your paper as a LaTeX file ( \family sans \bar under F \bar default ile\SpecialChar \menuseparator \bar under E \bar default xport\SpecialChar \menuseparator \bar under L \bar default ateX \family default ). \layout Enumerate Edit the resulting \family typewriter .tex \family default file with your favorite text editor \begin_deeper \layout Enumerate remove the comment lines before the \family typewriter \backslash documentclass \family default command \layout Enumerate remove the \family typewriter \backslash usepackage...{fontenc} \family default line if it appears (usually just after \family typewriter \backslash documentclass \family default }; also remove the \family typewriter \backslash secnumdepth \family default line if it appears. \layout Enumerate remove everything between (and including) the \family typewriter \backslash makeatletter \family default and \family typewriter \backslash makeatother \family default commands, except for any commands you specifically put into the LaTeX preamble (which should appear immediately after the \begin_inset Quotes eld \end_inset User specified LaTeX commands \begin_inset Quotes erd \end_inset comment in the \family typewriter .tex \family default file). \layout Enumerate search for any \family typewriter \backslash figcaption \family default commands and replace \begin_inset Quotes eld \end_inset \family typewriter FileName \family default \begin_inset Quotes erd \end_inset with the correct, real file name. \layout Enumerate alter any \family typewriter \backslash cite \family default commands, if necessary (see section\SpecialChar ~ \begin_inset LatexCommand \ref{cite} \end_inset below). \end_deeper \layout Enumerate Run the resulting file through LaTeX to make sure it still processes correctly. \layout Enumerate Reread the journal requirements to make sure your filenames and formats are correct. \layout Enumerate Submit it. \layout Subsection Comments On Specific Commands \layout Standard I will not describe the detailed usage of the individual AASTeX commands: the AASTeX User Guide ( \family typewriter aasguide.tex \family default ) gives a good description of each. Thus it's probably easiest for me to go down the list as found in the guide and offer comments where necessary. So let's begin \SpecialChar \ldots{} \layout Subsubsection Things that work as expected \layout Standard \begin_inset ERT status Inlined \layout Standard \backslash begin{sloppypar} \end_inset \layout Standard Because they work as you might expect, I simply list them and the section they are found in: \family typewriter \backslash documentclass \family default (2.1.1), \family typewriter \backslash begin{document} \family default (2.2), \family typewriter \backslash title \family default (2.3), \family typewriter \backslash author \family default (2.3), \family typewriter \backslash affil \family default (2.3), \family typewriter \backslash abstract \family default (2.4), \family typewriter \backslash keywords \family default (2.5), \family typewriter \backslash section \family default (2.7), \family typewriter \backslash subsection \family default (2.7), \family typewriter \backslash subsubsection \family default (2.7), \family typewriter \backslash paragraph \family default (2.7), \family typewriter \backslash begin{displaymath} \family default (2.11), \family typewriter \backslash begin{equation} \family default (2.11), \family typewriter \backslash begin{eqnarray} \family default (2.11), \family typewriter \backslash begin{mathletters} \family default (2.11), \family typewriter \backslash begin{thebibliography} \family default (2.12.1), \family typewriter \backslash bibitem \family default (2.12.2), \family typewriter \backslash begin{table} \family default (2.14.4), \family typewriter \backslash begin{tabular} \family default (2.14.4), \family typewriter \backslash caption \family default (2.14.4), \family typewriter \backslash label \family default (2.14.4, amongst other places), \family typewriter \backslash tablerefs \family default (2.14.5), \family typewriter \backslash tablecomments \family default (2.14.5), \family typewriter \backslash url \family default (2.15.4), \family typewriter \backslash end{document} \family default (2.16). \layout Standard The following style options also work correctly: \family typewriter preprint \family default , \family typewriter preprint2 \family default , \family typewriter eqsecnum \family default , \family typewriter flushrt \family default (3, 3.1, 3.2). Simply put them in \family sans Extra Options \family default box in \family sans Layout\SpecialChar \menuseparator Document \family default . \layout Standard \begin_inset ERT status Inlined \layout Standard \backslash end{sloppypar} \end_inset \layout Subsubsection Things that work, but require more comment \layout Standard The following items work, but require a little more discussion: \layout Itemize These items are reserved for use by the journal editors, but you can put them into the LaTeX preamble if you feel compelled to do so: \family typewriter \backslash received \family default , \family typewriter \backslash revised \family default , \family typewriter \backslash accepted \family default , \family typewriter \backslash ccc \family default , \family typewriter \backslash cpright \family default (all from 2.1.3) \layout Itemize These items may be placed in the LaTeX preamble, and are included as blanks in the template file: \family typewriter \backslash slugcomment \family default (2.1.4), \family typewriter \backslash shorttitle \family default (2.1.5), \family typewriter \backslash shortauthors \family default (2.1.5) \layout Itemize \family typewriter \backslash email \family default (2.3) -- can only be used \begin_inset Quotes eld \end_inset standalone \begin_inset Quotes erd \end_inset , not in the middle of a paragraph. Use ERT if you need to embed it. \layout Itemize \family typewriter \backslash and \family default (2.3) -- will have extra {} after it. This should not cause an error. \layout Itemize \family typewriter \backslash notetoeditor \family default (2.6) -- can only be used \begin_inset Quotes eld \end_inset standalone \begin_inset Quotes erd \end_inset , not in the middle of a paragraph. Use ERT if you need to embed it. \layout Itemize \family typewriter \backslash placetable \family default (2.8) -- can't insert a cross-reference tag, you must type the tag name by hand \layout Itemize \family typewriter \backslash placefigure \family default (2.8) -- same as for \family typewriter \backslash placetable \layout Itemize \family typewriter \backslash acknowledgements \family default (2.9) -- will have extra {} after it. This should not cause an error. \layout Itemize \family typewriter \backslash appendix \family default (2.10) -- will have extra {} after it. This should not cause an error. \layout Itemize \family typewriter \backslash figcaption \family default (2.13.2) -- you will have to edit the optional argument by hand in the final LaTeX file. \layout Subsubsection Things not implemented, use ERT \layout Standard \begin_inset ERT status Inlined \layout Standard \backslash begin{sloppypar} \end_inset \layout Standard \family typewriter \backslash altaffilmark \family default (2.3), \family typewriter \backslash altaffiltext \family default (2.3), \family typewriter \backslash eqnum \family default (2.11), \family typewriter \backslash setcounter{equation} \family default (2.11), \family typewriter \backslash citet \family default (2.12), \family typewriter \backslash citep \family default (2.12), Journal name abbreviations (2.12.4), \family typewriter \backslash figurenum \family default (2.13.1), \family typewriter \backslash epsscale \family default (2.13.1), \family typewriter \backslash plotone \family default (2.13.1), \family typewriter \backslash plottwo \family default (2.13.1), \family typewriter \backslash tablenum \family default (2.14.4), \family typewriter \backslash tableline \family default (2.14.4, insert it as the first element in the lefthand cell after where you want it. Don't use any of LyX's rules in the table), \family typewriter \backslash tablenotemark \family default (2.14.5), \family typewriter \backslash tablenotetext \family default (2.14.5), most everything in Misc (2.15, except \family typewriter \backslash url \family default and \family typewriter \backslash email \family default ; see above), \family typewriter \backslash singlespace \family default (3.1), \family typewriter \backslash doublespace \family default (3.1), \family typewriter \backslash onecolumn \family default (3.2), \family typewriter \backslash twocolumn \family default (3.2) \layout Standard \begin_inset ERT status Inlined \layout Standard \backslash end{sloppypar} \end_inset \layout Subsubsection Things that cannot be implemented \layout Standard \SpecialChar \ldots{} at least in any meaningful sort of way, so I suggest ignoring them. They are the references environment (2.12.3), and the deluxetable environment (2.14). If you really, really need to use deluxetable, I suggest editing it in a separate file with a text editor, then using \family sans Insert\SpecialChar \menuseparator Include File \family default to include it in your LyX document. See the \family typewriter aas_sample.lyx \family default file to see an example of this. \layout Subsection FAQs, Tips, Tricks, and Other Ruminations \layout Subsubsection Getting LyX and AASTeX to cooperate \layout Standard It can be a bit tricky to get LyX to recognize a new layout and document class. When all else fails, do this: \layout Enumerate Make certain that LaTeX can find AASTeX. Copy sample.tex (and perhaps table.tex) from the AASTeX distribution into a directory completely unrelated to LaTeX or AASTeX and run LaTeX on \family typewriter sample.tex \family default . \layout Enumerate Make certain that \family typewriter aastex.layout \family default appears in \family typewriter /usr/.../share/lyx/layouts \family default or \family typewriter ~/.lyx/layouts \family default . \layout Enumerate Rerun \family sans Options\SpecialChar \menuseparator Reconfigure \family default in LyX, then restart LyX. \layout Enumerate Open a regular new file, not from a template. Does AASTeX appear in \family sans Layout\SpecialChar \menuseparator Document\SpecialChar \menuseparator Class \family default ? \layout Standard If you get a warning from an existing AASTeX document about not being able to find the AASTeX layout or a message about \begin_inset Quotes eld \end_inset You should not mix title layouts with normal ones \begin_inset Quotes erd \end_inset , things haven't been installed correctly. \layout Subsubsection LaTeX error processing a table \layout Standard LyX, by default, attempts to center the table caption/title. This seems to produce a bad interaction in AASTeX so you should click somewhere in the caption/title, then select \family sans \bar under L \bar default ayout\SpecialChar \menuseparator \bar under P \bar default aragraph \family default , then set the \family sans Alignment \family default to \family sans \bar under B \bar default lock \family default . This took care of it for me. \layout Subsubsection References \begin_inset LatexCommand \label{cite} \end_inset \layout Standard A few things: 1) I have noticed some funny spacing in the reference entries in the text. When you enter the bibliography item data, make sure their is \emph on no \emph default space between the last author and the parenthesis setting off the year; \emph on e.g. \emph default type \family typewriter Ressler(1992) \family default , not \family typewriter Ressler (1992) \family default . 2) I am really unhappy that I can't make \family typewriter \backslash citet \family default and \family typewriter \backslash citep \family default more automatic, but that would require changes to the LyX source code. For now you can do one of two things: a) enter all your citations using the built-in \family sans Insert\SpecialChar \menuseparator Citation Reference \family default mechanism; at least you can take advantage of the automatic insertions. Then edit the exported LaTeX file by hand changing the \family typewriter \backslash cite \family default entries to the appropriate \family typewriter \backslash citet \family default or \family typewriter \backslash citep \family default commands before you submit it ( \family typewriter \backslash cite \family default is currently equivalent to \family typewriter \backslash citet \family default , so you wouldn't necessarily have to change those). Or b) you can simply enter all your citations as ERT using the same key for the argument that you used in the bibliography dialog, \emph on e.g. \emph default \family typewriter \backslash citet{key} \family default . Neither choice is pleasant, but until LyX's citation mechanism understands \family typewriter natbib \family default , we'll have to put up with it. 3) Entering the references at all is not obvious. The easiest thing is to start typing your first reference at the end of the document, then mark it as type \family sans References \family default . That will put a small gray box in front of what you just typed. Click on the box to fill in the rest of the information. For new references, go to the end of an existing reference and press return. That will create a new line with its own box, etc. \layout Subsubsection Including EPS files \layout Standard With all due respect to Chris Biemesderfer and the others who have helped to write the AASTeX package, the figure handling mechanism smells really foul. You can insert the \family typewriter \backslash plotone \family default , etc. \begin_inset ERT status Inlined \layout Standard \backslash \end_inset commands as ERT into a Figure Float box, but I never have much luck getting the layout right. My advice would be to avoid all EPS inclusions in the manuscript you submit to the journal, but then use the standard LyX EPS file inclusion mechanism when you want to make your nicer looking preprints. LyX will insert a \family typewriter \backslash usepackage{graphics} \family default command into the LaTeX preamble and handle the figures in the standard LaTeX2e way. Anyone who attempts to print your AASTeX 5.0 manuscript must have a LaTeX2e installation anyway, so why not take advantage of the infinitely better graphics handling mechanism? If they complain about LaTeX2e or the graphics package, point out that it appears in the second edition of Lamport (1994), so it was time to upgrade many years ago. \layout Subsubsection Things I could have done, but didn't \layout Standard There are a few \begin_inset Quotes eld \end_inset pretty \begin_inset Quotes erd \end_inset things I could have implemented, but chose not to. For instance, I saw no point in double-spacing the text in the LyX window, even though it is double-spaced in the paper manuscript. Also, I chose not to make separate layouts for the preprint and preprint2 styles. Since I assume you will spend most of your time in the plain manuscript mode anyway, I decided not to chew up more disk space with this. If you feel strongly that I should make such layouts, I will adhere to the spirit of the rules laid out by the Mudgeeraba Creek Emu-Riding and Boomerang-Throwing Association: \layout Quotation \begin_inset Quotes eld \end_inset Decisions of the judges will be final unless shouted down by a really overwhelmi ng majority of the crowd present. Abusive and obscene language may not be used by contestants when addressing members of the judging panel, or, conversely, by members of the judging panel when addressing contestants (unless struck by a boomerang). \begin_inset Quotes erd \end_inset \layout Subsection Final Caveat \layout Standard To mangle the infamous quote by Donald Knuth about a computer algorithm, \begin_inset Quotes eld \end_inset I have only proved this to be correct, I have not actually tried it. \begin_inset Quotes erd \end_inset I believe following the above procedures will produce an acceptable AASTeX document, but as of this update (Jan 25, 2000), I have not yet submitted a paper using it. Hopefully in the next few months \SpecialChar \ldots{} \layout Section ijmpd \layout Standard by \noun on Panayotis Papasotiriou \layout Subsection Overview \layout Standard The ijmpd package is a set of macros that facilitates electronic manuscript submission to the \emph on International Journal of Modern Physics D \emph default published by World Scientific. The name of the document class is \family typewriter ws-ijmpd.cls \family default . This file, together with instructions for the authors, can be downloaded from the site \begin_inset LatexCommand \url{http://www.worldscinet.com/ijmpd/mkt/guidelines.shtml} \end_inset . The ijmpd package is a modified version of the standard \begin_inset Quotes eld \end_inset article \begin_inset Quotes erd \end_inset package. Most of its features are supported by LyX. I have recently used LyX successfully to write an article submitted to the \emph on International Journal of Modern Physics D \emph default . \layout Subsection Writing a paper \layout Standard As usual, the easiest way to write a paper is to start with a template. Click on \family sans \bar under F \bar default ile\SpecialChar \menuseparator New from \bar under T \bar default emplate \family default , then choose the \family typewriter ijmpd.lyx \family default template. This will give an (almost) empty document that includes the most common fields found in a manuscript. Simply overwrite the existing text (including the brackets, \family typewriter <> \family default ) with the correct information. You should keep in mind the following remarks. \layout Enumerate LyX won't let you change the font size and the page style of the document, because the ijmpd package does not allow such modifications. \layout Enumerate The ijmpd package requires that the language of the document should not be changed. Before previewing your paper, be sure that the babel package is not used. To do this, click on \family sans \bar under E \bar default dit\SpecialChar \menuseparator \bar under P \bar default references \family default , select the \family sans Language \family default tab (under the \family sans Lang Opts \family default tab), then deselect the \family sans \bar under U \bar default se babel \family default option and click on \family sans \bar under A \bar default pply \family default (or \family sans Save \family default , if you wish to make this change permanent). \layout Enumerate Two new environments, named \begin_inset Quotes eld \end_inset Theorem \begin_inset Quotes erd \end_inset and \begin_inset Quotes eld \end_inset Proof \begin_inset Quotes erd \end_inset are available (their use is obvious). \layout Enumerate Appendices may be added to the paper. LyX offers a special environment, called \begin_inset Quotes eld \end_inset Appendix \begin_inset Quotes erd \end_inset which marks the beginning of the appendix. An appendix can contain normal sections, subsections, or subsubsections. \layout Enumerate The ijmpd package implements table captions quite differently than LyX does. As a result, a table created by LyX is printed correctly, but its caption is ignored. If you need table captions, you should implement the whole table float in a \family typewriter .tex \family default file, then include this file to the LyX document ( \family sans \bar under I \bar default nsert\SpecialChar \menuseparator Inclu \bar under d \bar default e file \family default ). Details on how to create an ijmpd table float can be found in the file \family typewriter ws-ijmpd.tex \family default , which is included in the ijmpd package. \layout Subsection Preparing a paper for submission \layout Standard Before you submit your paper you must export the LyX document as a LaTeX file ( \family sans \bar under F \bar default ile\SpecialChar \menuseparator \bar under E \bar default xport\SpecialChar \menuseparator \bar under L \bar default ateX \family default ), then make the following changes to the resulting \family typewriter .tex \family default file. \layout Enumerate Remove the comment lines before the \family typewriter \backslash documentclass \family default command. \layout Enumerate Remove everything between (and including) the \family typewriter \backslash makeatletter \family default and \family typewriter \backslash makeatother \family default commands, except for any commands you specifically put into the LaTeX preamble. \layout Standard The modified \family typewriter .tex \family default file should be saved and processed through LaTeX as many times as necessary. You may also want to check the resulting \family typewriter .dvi \family default document. \layout Subsection Use of ERT \layout Standard The use of ERT is optional, and is reduced to three commands, which affect the look of the page. If you started writing your paper by using the \family typewriter ijmpd.lyx \family default template, the ERT needed is already in its place; you usually don't need to delete it. You may only change the first ERT to specify the information printed to the top of odd and even pages (authors' names and short paper's title, respectively). This ERT must have the form \family typewriter \backslash markboth{Authors' Names}{Short Paper's Title} \family default . \layout Section Kluwer \layout Standard by \noun on Panayotis Papasotiriou \layout Subsection Overview \layout Standard The Kluwer package is a set of macros produced by Kluwer Academic Publishers that facilitates electronic manuscript submission to the journals they publish. Most known of them (at least in my domain of interest) are \emph on Astrophysics and Space Science \emph default and \emph on Solar Physics \emph default , but there are many others (see a complete list at \begin_inset LatexCommand \url{http://www.wkap.nl/jrnllist.htm/JRNLHOME} \end_inset ). The Kluwer package may be downloaded from the site \begin_inset LatexCommand \url{http://www.wkap.nl/kaphtml.htm/STYLEFILES} \end_inset . A complete user guide is contained in that package (but it can also be downloaded separately). \layout Standard LyX supports many features of the package but not everything. However, the ERT needed is reduced to some \begin_inset Quotes eld \end_inset peculiar \begin_inset Quotes erd \end_inset commands of the package (see\SpecialChar ~ \begin_inset LatexCommand \ref{subsec:kluwer_peculiarities} \end_inset ). I have recently used LyX to write an article submitted to the \emph on Astrophysics and Space Science \emph default without any problem. \layout Subsection Writing a paper \layout Standard The easiest way to write a paper is to start with the Kluwer template file. Click on \family sans File\SpecialChar \menuseparator New from template \family default , then choose the \family typewriter kluwer.lyx \family default template. This will give an (almost) empty document that includes the most common fields found in a manuscript and a short description of their use. As in most templates, simply overwrite the existing text (including the brackets, \family typewriter <> \family default ) with the correct information. \layout Subsection Preparing a paper for submission \layout Standard As in the AASTeX package, before you submit your paper to a journal you must \begin_inset Quotes eld \end_inset postprocess \begin_inset Quotes erd \end_inset it as follows. \layout Enumerate Export your paper as a LaTeX file. To do this, click on \family sans \bar under F \bar default ile\SpecialChar \menuseparator \bar under E \bar default xport\SpecialChar \menuseparator \bar under L \bar default ateX \family default . \layout Enumerate Edit the resulting \family typewriter .tex \family default file with a text editor and make the following changes \begin_deeper \layout Enumerate remove the comment lines before the \family typewriter \backslash documentclass \family default command, \layout Enumerate remove everything between (and including) the \family typewriter \backslash makeatletter \family default and \family typewriter \backslash makeatother \family default commands, except for any commands you specifically put into the LaTeX preamble. \layout Standard Save the resulting \family typewriter .tex \family default file. \end_deeper \layout Enumerate Run the \family typewriter .tex \family default file through LaTeX as many times as necessary (usually up to three). \layout Enumerate View the resulting \family typewriter .dvi \family default document using, e.g., \family sans xdvi \family default , and check if everything is ok (it should, if you didn't make any mistake). \layout Subsection \begin_inset Quotes eld \end_inset Peculiarities \begin_inset Quotes erd \end_inset of the Kluwer package \begin_inset LatexCommand \label{subsec:kluwer_peculiarities} \end_inset \layout Standard The Kluwer package has the following \begin_inset Quotes eld \end_inset peculiarities \begin_inset Quotes erd \end_inset . \layout Enumerate It is possible to write multiple articles in the same LaTeX file \begin_inset Foot collapsed true \layout Standard I can't imagine any good reason to do this. \end_inset . Each article must be included in the environment \begin_inset Quotes eld \end_inset article \begin_inset Quotes erd \end_inset . Unfortunately, this environment cannot be omitted, even if you write just one article. Therefore, each article starts with the command \family typewriter \backslash begin{article} \family default and, obviously, ends with the command \family typewriter \backslash end{article} \family default . Although this can be implemented in LyX, I didn't included it, since it looks ugly and can confuse the novice user. Therefore, you need to enter them directly and mark them as LaTeX code (the well-known \begin_inset Quotes eld \end_inset ERT \begin_inset Quotes erd \end_inset ). \layout Enumerate Information given at the beginning of the article (i.e., title, subtitle, author, institution, running title, running author, abstract and keywords) must be included in an environment called \begin_inset Quotes eld \end_inset opening \begin_inset Quotes erd \end_inset . This is not implemented in LyX, so you must enter title, subtitle etc. between two ERT lines ( \family typewriter \backslash begin{opening} \family default and \family typewriter \backslash end{opening} \family default ). \layout Enumerate According to the user manual, the label of each bibliography item must be written as \family typewriter \backslash protect \backslash citeauthoryear{ \family default \emph on author(s) \family typewriter \emph default }{ \family default \emph on year \family typewriter \emph default } \family default . \layout Standard The \family typewriter kluwer.lyx \family default template takes care of all these \begin_inset Quotes eld \end_inset peculiarities \begin_inset Quotes erd \end_inset . If you start a new paper using this template you don't need to do anything special. Just \layout Enumerate don't delete the ERT included in the template, and \layout Enumerate copy the example bibliography item included in the template and modify it as necessary to enter new bibliography items. \layout Section Koma-Script \layout Standard by \noun on Bernd Rellermeyer \layout Subsection Overview \layout Standard The LyX document classes \emph on article (koma-script) \emph default , \emph on report (koma-script) \emph default , \emph on book \emph default \emph on (koma-script) \emph default , and \emph on letter \emph default \emph on (koma-script) \emph default correspond to the LaTeX document classes \family typewriter scrartcl.cls \family default , \family typewriter scrreprt.cls \family default , \family typewriter scrbook.cls \family default , and \family typewriter scrlettr.cls \family default , resp. of the Koma-Script family. They are replacements for the standard document classes \family typewriter article.cls \family default , \family typewriter report.cls \family default , \family typewriter book.cls \family default and \family typewriter letter.cls \family default , resp., and fit better to European typography conventions in a number of points. \layout Itemize Standard character size is 11pt in \emph on article (koma-script) \emph default , \emph on report (koma-script) \emph default , and \emph on book (koma-script) \emph default , and 12pt in \emph on letter (koma-script) \emph default . \layout Itemize Headings, labels of the description environment, and a number of elements of the \emph on letter (koma-script) \emph default document class are set in a bold sans serif font. \begin_inset Foot collapsed true \layout Standard There is a big difference between the bold sans serif old cm fonts and new ec fonts, especially in the appearance of headings. In comparison, the ec bold sans serif fonts look a bit thin. Here the LaTeX package \family typewriter cmsd.sty by \family default \shape smallcaps Walter Schmidt \shape default helps to produce the \begin_inset Quotes eld \end_inset usual \begin_inset Quotes erd \end_inset appearance when using the ec fonts. \end_inset The numbering of chapter headings is made in the same way as the numbering of section headings, that is without the extra line \begin_inset Quotes eld \end_inset Chapter\SpecialChar \ldots{} \begin_inset Quotes erd \end_inset . In addition, the appearance of the headings can be modified by using a number of options (in LyX to be entered in the field \family sans E \bar under x \bar default tra\SpecialChar ~ Options \family default of the dialog \family sans \bar under L \bar default ayout\SpecialChar \menuseparator \bar under D \bar default ocument \family default ). A detailed German description of these options can be found in the Koma-Script documentation \emph on scrguide \emph default . \layout Itemize The main means in the Koma-Script document classes to design the type area are the options \family sans BCOR \family default and \family sans DIV \family default (in LyX to be entered in the field \family sans E \bar under x \bar default tra\SpecialChar ~ Options \family default of the dialog \family sans \bar under L \bar default ayout\SpecialChar \menuseparator \bar under D \bar default ocument \family default ). They make a clearer modification of page margins possible as do the options of the dialog \family sans \bar under L \bar default ayout\SpecialChar \menuseparator \bar under D \bar default ocument \family default . A detailed German description of these and other type area options can be found in the Koma-Script documentation \emph on scrguide \emph default . \layout Itemize The LaTeX document classes of the Koma-Script family define a number of additional commands. Those part of it which makes sense in LyX is implemented in corresponding paragraph types. \layout Standard A