X-Git-Url: https://git.lyx.org/gitweb/?a=blobdiff_plain;f=lib%2Fexamples%2Fmulticol.lyx;h=23336fa7f0f07e69b271205f3f019b45a9a2cdb2;hb=096de939a2e96f726d6232faa23a717e50ba6400;hp=8d239e3e51178040b4e61e931774959c47dce719;hpb=1e341fda014f8cfc47651f8d5a02fd43c924ca9b;p=lyx.git diff --git a/lib/examples/multicol.lyx b/lib/examples/multicol.lyx index 8d239e3e51..23336fa7f0 100644 --- a/lib/examples/multicol.lyx +++ b/lib/examples/multicol.lyx @@ -1,6 +1,7 @@ -#This file was created by Tue Jan 25 11:50:08 2000 -#LyX 1.0 (C) 1995-1999 Matthias Ettrich and the LyX Team -\lyxformat 2.15 +#LyX 1.4.0cvs created this file. For more info see http://www.lyx.org/ +\lyxformat 243 +\begin_document +\begin_header \textclass article \begin_preamble \usepackage{multicol} @@ -10,11 +11,12 @@ \fontscheme default \graphics default \paperfontsize default -\spacing single -\papersize Default -\paperpackage a4 -\use_geometry 0 +\spacing single +\papersize default +\use_geometry false \use_amsmath 0 +\cite_engine basic +\use_bibtopic false \paperorientation portrait \secnumdepth 3 \tocdepth 3 @@ -25,40 +27,55 @@ \papercolumns 1 \papersides 1 \paperpagestyle default +\tracking_changes false +\output_changes true +\end_header -\layout Title +\begin_body + +\begin_layout Title Multiple Columns -\layout Author +\end_layout + +\begin_layout Author by -\noun on +\noun on Lars Gullik Bjønnes -\layout Section +\end_layout + +\begin_layout Section Purpose -\layout Standard +\end_layout + +\begin_layout Standard The aim for this chapter is to show how the LaTeX package -\family typewriter +\family typewriter multicol -\family default +\family default can be used in a LyX document. As LyX doesn't support the -\family typewriter +\family typewriter multicol -\family default +\family default package natively yet, we have to use some small hacks. By reading this section it should be obvious how to do this. -\layout Subsection +\end_layout + +\begin_layout Subsection Limitations -\layout Standard +\end_layout + +\begin_layout Standard The -\family typewriter +\family typewriter multicol -\family default +\family default package allows switching between one and multicolumn format on the same page. Footnotes are handled correctly (for the most part), but will be placed @@ -67,52 +84,82 @@ multicol ion. At the moment only page-wide floats can be used within the scope of the environment. -\layout Subsection +\end_layout + +\begin_layout Subsection Examples -\layout Subsubsection +\end_layout + +\begin_layout Subsubsection Two columns -\layout Standard -\added_space_bottom -2ex +\end_layout + +\begin_layout Standard + If you want to have two columns in your text, you have use LaTeX mode to insert -\family typewriter +\family typewriter -\backslash +\backslash begin{multicols}{2} -\family default +\family default at the point where you want the two column layout to start, and then -\family typewriter +\family typewriter -\backslash +\backslash end{multicols} -\family default +\family default where you want it to end. Like this: -\layout Standard +\end_layout + +\begin_layout Standard + +\begin_inset VSpace -2ex +\end_inset -\latex latex -\backslash +\end_layout + + +\begin_layout Standard + + +\begin_inset ERT +status collapsed + +\begin_layout Standard + +\backslash begin{multicols}{2} -\layout Standard -\noindent +\end_layout -\series bold -\size small +\end_inset + + +\end_layout + +\begin_layout Standard +\noindent + +\series bold +\size small The Adventure of the Empty House -\series default +\series default -\newline +\newline by -\noun on +\noun on Sir Arthur Conan Doyle -\layout Standard +\end_layout + +\begin_layout Standard -\size small +\size small It was in the spring of the year 1894 that all London was interested, and the fashionable world dismayed, by the murder of the Honourable Ronald Adair under most unusual and inexplicable circumstances. @@ -134,32 +181,68 @@ ty which utterly submerged my mind. with them, for I should have considered it my first duty to do so, had I not been barred by a positive prohibition from his own lips, which was only withdrawn upon the third of last month. -\layout Standard +\end_layout + +\begin_layout Standard -\latex latex +\begin_inset ERT +status collapsed -\backslash +\begin_layout Standard + +\backslash end{multicols} -\layout Subsubsection +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Subsubsection Multiple columns -\layout Standard -\added_space_bottom -2ex +\end_layout + +\begin_layout Standard + The same pattern is used when you want more than two columns. (You can have more than 3 columns if you want , but that might not be very pleasant for the eye.) -\layout Standard +\end_layout + +\begin_layout Standard + + +\begin_inset VSpace -2ex +\end_inset + + +\end_layout -\latex latex +\begin_layout Standard -\backslash + +\begin_inset ERT +status collapsed + +\begin_layout Standard + +\backslash begin{multicols}{3} -\layout Standard +\end_layout + +\end_inset + + +\end_layout +\begin_layout Standard -\size footnotesize + +\size footnotesize It can be imagined that my close intimacy with Sherlock Holmes had interested me deeply in crime, and that after his disappearance I never failed to read with care the various problems which came before the public. @@ -179,46 +262,104 @@ It can be imagined that my close intimacy with Sherlock Holmes had interested found no explanation which appeared to me to be adequate. At the risk of telling a twice-told tale, I will recapitulate the facts as they were known to the public at the conclusion of the inquest. -\layout Standard +\end_layout + +\begin_layout Standard + +\begin_inset ERT +status collapsed -\latex latex +\begin_layout Standard -\backslash +\backslash end{multicols} -\layout Subsubsection +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Subsubsection Columns inside columns -\layout Standard -\added_space_bottom -2ex +\end_layout + +\begin_layout Standard + You can even have columns inside columns: -\layout Standard +\end_layout + +\begin_layout Standard + + +\begin_inset VSpace -2ex +\end_inset + + +\end_layout + + +\begin_layout Standard + +\begin_inset ERT +status collapsed -\latex latex +\begin_layout Standard -\backslash +\backslash begin{multicols}{2} -\layout Standard -\added_space_bottom -2ex +\end_layout -\size footnotesize +\end_inset + + +\end_layout + +\begin_layout Standard + + +\size footnotesize The Honourable Ronald Adair was the second son of the Earl of Maynooth, at that time governor of one of the Australian colonies. Adair's mother had returned from Australia to undergo the operation for cataract, and she, her son Ronald, and her daughter Hilda were living together at 427 Park Lane. -\layout Standard +\end_layout + +\begin_layout Standard + + +\begin_inset VSpace -2ex +\end_inset + + +\end_layout + + +\begin_layout Standard -\latex latex +\begin_inset ERT +status collapsed -\backslash +\begin_layout Standard + +\backslash begin{multicols}{2} -\layout Standard +\end_layout + +\end_inset + +\end_layout -\size footnotesize +\begin_layout Standard + + +\size footnotesize The youth moved in the best society--had, so far as was known, no enemies and no particular vices. He had been engaged to Miss Edith Woodley, of Carstairs, but the engagement @@ -229,17 +370,29 @@ The youth moved in the best society--had, so far as was known, no enemies Yet it was upon this easy-going young aristocrat that death came, in most strange and unexpected form, between the hours of ten and eleven-twenty on the night of March 30, 1894. -\layout Standard +\end_layout + +\begin_layout Standard -\latex latex +\begin_inset ERT +status collapsed -\backslash +\begin_layout Standard + +\backslash end{multicols} -\layout Standard +\end_layout + +\end_inset + +\end_layout -\size footnotesize +\begin_layout Standard + + +\size footnotesize Ronald Adair was fond of cards--playing continually, but never for such stakes as would hurt him. He was a member of the Baldwin, the Cavendish, and the Bagatelle card clubs. @@ -247,9 +400,9 @@ Ronald Adair was fond of cards--playing continually, but never for such a rubber of whist at the latter club. He had also played there in the afternoon. -\size default +\size default -\size footnotesize +\size footnotesize The evidence of those who had played with him-- Mr. Murray, Sir John Hardy, and Colonel Moran--showed that the game was whist, and that there was a fairly equal fall of the cards. @@ -262,47 +415,83 @@ The evidence of those who had played with him-- Mr. actually won as much as four hundred and twenty pounds in a sitting, some weeks before, from Godfrey Milner and Lord Balmoral. So much for his recent history as it came out at the inquest. -\layout Standard +\end_layout + +\begin_layout Standard -\latex latex +\begin_inset ERT +status collapsed -\backslash +\begin_layout Standard + +\backslash end{multicols} -\layout Subsection +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Subsection Advanced Examples -\layout Standard +\end_layout + +\begin_layout Standard As you probably know -\family typewriter +\family typewriter multicol -\family default +\family default has several customizing variables. The following examples shows how these can be used from LyX. -\layout Subsubsection +\end_layout + +\begin_layout Subsubsection Preface and Skip -\layout Standard +\end_layout + +\begin_layout Standard If there is less than 5cm left on the page, a page break will be inserted before this bit, which has a preface text above the two columns: -\layout Standard +\end_layout + +\begin_layout Standard -\latex latex +\begin_inset ERT +status collapsed -\backslash +\begin_layout Standard + +\backslash begin{multicols}{2}[ -\latex default +\end_layout + +\end_inset + And the story continues and continues and continues and continues\SpecialChar \ldots{} -\latex latex +\begin_inset ERT +status collapsed + +\begin_layout Standard ][5cm] -\layout Standard +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard -\size small +\size small On the evening of the crime, he returned from the club exactly at ten. His mother and sister were out spending the evening with a relation. The servant deposed that she heard him enter the front room on the second @@ -322,42 +511,74 @@ On the evening of the crime, he returned from the club exactly at ten. There were some figures also upon a sheet of paper, with the names of some club friends opposite to them, from which it was conjectured that before his death he was endeavouring to make out his losses or winnings at cards. -\layout Standard +\end_layout +\begin_layout Standard -\latex latex -\backslash +\begin_inset ERT +status collapsed + +\begin_layout Standard + +\backslash end{multicols} -\layout Subsubsection +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Subsubsection Preface and sections -\layout Standard +\end_layout + +\begin_layout Standard What if you want the preface to be a sectioning command? That can be done, but only through LaTeX commands inside the parameters for the -\family typewriter +\family typewriter multicols -\family default +\family default command. Because of this, the section command can not be provided by LyX: -\layout Standard +\end_layout + +\begin_layout Standard + +\begin_inset ERT +status collapsed -\latex latex +\begin_layout Standard -\backslash +\backslash begin{multicols}{2}[ -\backslash +\backslash subsubsection{ -\latex default +\end_layout + +\end_inset + This is the sectioning command as a preface -\latex latex +\begin_inset ERT +status collapsed + +\begin_layout Standard }][5cm] -\layout Standard +\end_layout +\end_inset -\size small + +\end_layout + +\begin_layout Standard + + +\size small A minute examination of the circumstances served only to make the case more complex. In the first place, no reason could be given why the young man should have @@ -385,54 +606,80 @@ A minute examination of the circumstances served only to make the case more complicated by entire absence of motive, since, as I have said, young Adair was not known to have any enemy, and no attempt had been made to remove the money or valuables in the room. -\layout Standard +\end_layout + +\begin_layout Standard + +\begin_inset ERT +status collapsed -\latex latex +\begin_layout Standard -\backslash +\backslash end{multicols} -\layout Subsubsection +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Subsubsection Free Space -\layout Standard +\end_layout + +\begin_layout Standard The -\family typewriter +\family typewriter multicol -\family default +\family default package demands that a certain amount of space is available before and after a multicolumn section. In addition -\family typewriter +\family typewriter multicol -\family default +\family default inserts a given space in front of and after the multicol section. The commands to change the default settings for this must be given just before the -\family typewriter +\family typewriter -\backslash +\backslash begin{multicols} -\family default +\family default . This example puts a space of 3 cm in front of and after the multicolumn text: -\layout Standard +\end_layout + +\begin_layout Standard -\latex latex +\begin_inset ERT +status collapsed -\backslash +\begin_layout Standard + +\backslash setlength{ -\backslash +\backslash multicolsep}{3cm} -\backslash +\backslash begin{multicols}{2} -\layout Standard +\end_layout + +\end_inset + +\end_layout -\size small +\begin_layout Standard + + +\size small All day I turned these facts over in my mind, endeavouring to hit upon some theory which could reconcile them all, and to find that line of least resistanc e which my poor friend had declared to be the starting-point of every investigat @@ -458,62 +705,102 @@ ion. in the eyes of their owner. With a snarl of contempt he turned upon his heel, and I saw his curved back and white side-whiskers disappear among the throng. -\layout Standard +\end_layout + +\begin_layout Standard -\latex latex +\begin_inset ERT +status collapsed -\backslash +\begin_layout Standard + +\backslash end{multicols} -\layout Paragraph +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Paragraph Note: -\layout Standard +\end_layout + +\begin_layout Standard The values you set with -\family typewriter +\family typewriter -\backslash +\backslash setlength -\family default +\family default must be reset to default after use, or you will get the modified value in the rest of your document. -\layout Standard +\end_layout +\begin_layout Standard -\latex latex -\backslash +\begin_inset ERT +status collapsed + +\begin_layout Standard + +\backslash setlength{ -\backslash +\backslash multicolsep}{13pt} -\layout Subsubsection +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Subsubsection Column Width and Separation -\layout Standard +\end_layout + +\begin_layout Standard The width of the columns inside the -\family sans +\family sans multicols -\family default +\family default environment is automatically calculated, but you can modify the space between two columns explicitly. The space between the following two columns is 3 cm wide: -\layout Standard +\end_layout + +\begin_layout Standard -\latex latex +\begin_inset ERT +status collapsed -\backslash +\begin_layout Standard + +\backslash setlength{ -\backslash +\backslash columnsep}{3cm} -\backslash +\backslash begin{multicols}{2} -\layout Standard +\end_layout + +\end_inset + +\end_layout -\size small +\begin_layout Standard + + +\size small My observations of No. 427 Park Lane did little to clear up the problem in which I was interested. The house was separated from the street by a low wall and railing, the @@ -527,76 +814,118 @@ My observations of No. To my astonishment it was none other than my strange old book collector, his sharp, wizened face peering out from a frame of white hair, and his precious volumes, a dozen of them at least, wedged under his right arm. -\layout Standard +\end_layout + +\begin_layout Standard -\latex latex +\begin_inset ERT +status collapsed -\backslash +\begin_layout Standard + +\backslash end{multicols} -\layout Standard +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard Once again, we have to reset the value after use to avoid using it in the rest of the document. -\layout Standard +\end_layout + +\begin_layout Standard -\latex latex +\begin_inset ERT +status collapsed -\backslash +\begin_layout Standard + +\backslash setlength{ -\backslash +\backslash columnsep}{10pt} -\layout Subsubsection +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Subsubsection Vertical Lines -\layout Standard +\end_layout + +\begin_layout Standard Between every two columns, a rule of width -\family typewriter +\family typewriter -\backslash +\backslash columnseprule -\family default +\family default is placed. If this rule is set to 0 pt, the rule is suppressed. In the following example, the line separating the two columns is 2 pt wide. -\layout Standard +\end_layout +\begin_layout Standard -\latex latex -\backslash +\begin_inset ERT +status collapsed + +\begin_layout Standard + +\backslash setlength{ -\backslash +\backslash columnseprule}{2pt} -\backslash +\backslash begin{multicols}{2} -\layout Standard +\end_layout + +\end_inset -\size small +\end_layout + +\begin_layout Standard + + +\size small \begin_inset Quotes eld -\end_inset +\end_inset You're surprised to see me, sir, \begin_inset Quotes erd -\end_inset +\end_inset said he, in a strange, croaking voice. -\layout Standard +\end_layout +\begin_layout Standard -\size small + +\size small I acknowledged that I was. -\layout Standard +\end_layout + +\begin_layout Standard -\size small +\size small \begin_inset Quotes eld -\end_inset +\end_inset Well, I've a conscience, sir, and when I chanced to see you go into this house, as I came hobbling after you, I thought to myself, I'll just step @@ -604,94 +933,129 @@ Well, I've a conscience, sir, and when I chanced to see you go into this in my manner there was not any harm meant, and that I am much obliged to him for picking up my books. \begin_inset Quotes erd -\end_inset +\end_inset + +\end_layout -\layout Standard +\begin_layout Standard -\size small +\size small \begin_inset Quotes eld -\end_inset +\end_inset You make too much of a trifle, \begin_inset Quotes erd -\end_inset +\end_inset said I. \begin_inset Quotes eld -\end_inset +\end_inset May I ask how you knew who I was? \begin_inset Quotes erd -\end_inset +\end_inset -\layout Standard +\end_layout +\begin_layout Standard -\size small + +\size small \begin_inset Quotes eld -\end_inset +\end_inset Well, sir, if it isn't too great a liberty, I am a neighbour of yours, for you'll find my little bookshop at the corner of Church Street, and very happy to see you, I am sure. Maybe you collect yourself, sir. Here's -\noun on -British -\protected_separator +\noun on +British\InsetSpace ~ Birds -\noun default +\noun default , and -\noun on +\noun on Catullus -\noun default +\noun default , and -\noun on +\noun on The Holy War -\noun default +\noun default --a bargain, every one of them. With five volumes you could just fill that gap on that second shelf. It looks untidy, does it not, sir? \begin_inset Quotes erd -\end_inset +\end_inset + + +\end_layout +\begin_layout Standard -\layout Standard +\begin_inset ERT +status collapsed -\latex latex +\begin_layout Standard -\backslash +\backslash end{multicols} -\layout Standard +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard As usual, we reset the value after use. -\layout Standard +\end_layout + +\begin_layout Standard + +\begin_inset ERT +status collapsed -\latex latex +\begin_layout Standard -\backslash +\backslash setlength{ -\backslash +\backslash columnseprule}{0pt} -\layout Standard +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard You'll have to go to the library to read the rest of the story. -\begin_float footnote -\layout Standard +\begin_inset Foot +status collapsed + +\begin_layout Standard \SpecialChar \ldots{} or cheat like we did and find it at the Gutenberg project somewhere on the Web. -\end_float +\end_layout + +\end_inset + Believe it or not, but it's actually a bit of a cliff-hanger at this point in the story\SpecialChar \ldots{} -\the_end +\end_layout + +\end_body +\end_document