]> git.lyx.org Git - lyx.git/blob - lib/examples/multicol.lyx
Revert the last part of ectaart.cls as requested by Uwe.
[lyx.git] / lib / examples / multicol.lyx
1 #LyX 1.6.0 created this file. For more info see http://www.lyx.org/
2 \lyxformat 345
3 \begin_document
4 \begin_header
5 \use_default_options false
6 \textclass article
7 \begin_preamble
8 \usepackage{multicol}
9 \end_preamble
10 \language english
11 \inputencoding default
12 \font_roman default
13 \font_sans default
14 \font_typewriter default
15 \font_default_family default
16 \font_sc false
17 \font_osf false
18 \font_sf_scale 100
19 \font_tt_scale 100
20 \graphics default
21 \paperfontsize default
22 \spacing single
23 \use_hyperref false
24 \papersize default
25 \use_geometry false
26 \use_amsmath 0
27 \use_esint 0
28 \cite_engine basic
29 \use_bibtopic false
30 \paperorientation portrait
31 \secnumdepth 3
32 \tocdepth 3
33 \paragraph_separation indent
34 \defskip medskip
35 \quotes_language english
36 \papercolumns 1
37 \papersides 1
38 \paperpagestyle default
39 \tracking_changes false
40 \output_changes false
41 \author ""
42 \end_header
43
44 \begin_body
45
46 \begin_layout Title
47 Multiple Columns
48 \end_layout
49
50 \begin_layout Author
51 by 
52 \noun on
53 Lars Gullik Bjønnes
54 \end_layout
55
56 \begin_layout Section
57 Purpose
58 \end_layout
59
60 \begin_layout Standard
61 The aim for this chapter is to show how the LaTeX package 
62 \family typewriter
63 multicol
64 \family default
65  can be used in a LyX document.
66  As LyX doesn't support the 
67 \family typewriter
68 multicol
69 \family default
70  package natively yet, we have to use some small hacks.
71  By reading this section it should be obvious how to do this.
72 \end_layout
73
74 \begin_layout Subsection
75 Limitations 
76 \end_layout
77
78 \begin_layout Standard
79 The 
80 \family typewriter
81 multicol
82 \family default
83  package allows switching between one and multicolumn format on the same
84  page.
85  Footnotes are handled correctly (for the most part), but will be placed
86  at the bottom of the page and not under each column.
87  LaTeX's float mechanism, however, is partly disabled in the current implementat
88 ion.
89  At the moment only page-wide floats can be used within the scope of the
90  environment.
91 \end_layout
92
93 \begin_layout Subsection
94 Examples
95 \end_layout
96
97 \begin_layout Subsubsection
98 Two columns
99 \end_layout
100
101 \begin_layout Standard
102 If you want to have two columns in your text, you have use LaTeX mode to
103  insert 
104 \family typewriter
105
106 \backslash
107 begin{multicols}{2}
108 \family default
109  at the point where you want the two column layout to start, and then 
110 \family typewriter
111
112 \backslash
113 end{multicols}
114 \family default
115  where you want it to end.
116  Like this:
117 \end_layout
118
119 \begin_layout Standard
120 \begin_inset VSpace -2ex
121 \end_inset
122
123
124 \end_layout
125
126 \begin_layout Standard
127 \begin_inset ERT
128 status collapsed
129
130 \begin_layout Plain Layout
131
132
133 \backslash
134 begin{multicols}{2}
135 \end_layout
136
137 \end_inset
138
139
140 \end_layout
141
142 \begin_layout Standard
143 \noindent
144
145 \series bold
146 \size small
147 The Adventure of the Empty House
148 \series default
149
150 \begin_inset Newline newline
151 \end_inset
152
153 by 
154 \noun on
155 Sir Arthur Conan Doyle
156 \end_layout
157
158 \begin_layout Standard
159
160 \size small
161 It was in the spring of the year 1894 that all London was interested, and
162  the fashionable world dismayed, by the murder of the Honourable Ronald
163  Adair under most unusual and inexplicable circumstances.
164  The public has already learned those particulars of the crime which came
165  out in the police investigation, but a good deal was suppressed upon that
166  occasion, since the case for the prosecution was so overwhelmingly strong
167  that it was not necessary to bring forward all the facts.
168  Only now, at the end of nearly ten years, am I allowed to supply those
169  missing links which make up the whole of that remarkable chain.
170  The crime was of interest in itself, but that interest was as nothing to
171  me compared to the inconceivable sequel, which afforded me the greatest
172  shock and surprise of any event in my adventurous life.
173  Even now, after this long interval, I find myself thrilling as I think
174  of it, and feeling once more that sudden flood of joy, amazement, and increduli
175 ty which utterly submerged my mind.
176  Let me say to that public, which has shown some interest in those glimpses
177  which I have occasionally given them of the thoughts and actions of a very
178  remarkable man, that they are not to blame me if I have not shared my knowledge
179  with them, for I should have considered it my first duty to do so, had
180  I not been barred by a positive prohibition from his own lips, which was
181  only withdrawn upon the third of last month.
182 \end_layout
183
184 \begin_layout Standard
185 \begin_inset ERT
186 status collapsed
187
188 \begin_layout Plain Layout
189
190
191 \backslash
192 end{multicols}
193 \end_layout
194
195 \end_inset
196
197
198 \end_layout
199
200 \begin_layout Subsubsection
201 Multiple columns
202 \end_layout
203
204 \begin_layout Standard
205 The same pattern is used when you want more than two columns.
206  (You can have more than 3 columns if you want , but that might not be very
207  pleasant for the eye.)
208 \end_layout
209
210 \begin_layout Standard
211 \begin_inset VSpace -2ex
212 \end_inset
213
214
215 \end_layout
216
217 \begin_layout Standard
218 \begin_inset ERT
219 status collapsed
220
221 \begin_layout Plain Layout
222
223
224 \backslash
225 begin{multicols}{3}
226 \end_layout
227
228 \end_inset
229
230
231 \end_layout
232
233 \begin_layout Standard
234
235 \size footnotesize
236 It can be imagined that my close intimacy with Sherlock Holmes had interested
237  me deeply in crime, and that after his disappearance I never failed to
238  read with care the various problems which came before the public.
239  And I even attempted, more than once, for my own private satisfaction,
240  to employ his methods in their solution, though with indifferent success.
241  There was none, however, which appealed to me like this tragedy of Ronald
242  Adair.
243  As I read the evidence at the inquest, which led up to a verdict of willful
244  murder against some person or persons unknown, I realized more clearly
245  than I had ever done the loss which the community had sustained by the
246  death of Sherlock Holmes.
247  There were points about this strange business which would, I was sure,
248  have specially appealed to him, and the efforts of the police would have
249  been supplemented, or more probably anticipated, by the trained observation
250  and the alert mind of the first criminal agent in Europe.
251  All day, as I drove upon my round, I turned over the case in my mind and
252  found no explanation which appeared to me to be adequate.
253  At the risk of telling a twice-told tale, I will recapitulate the facts
254  as they were known to the public at the conclusion of the inquest.
255 \end_layout
256
257 \begin_layout Standard
258 \begin_inset ERT
259 status collapsed
260
261 \begin_layout Plain Layout
262
263
264 \backslash
265 end{multicols}
266 \end_layout
267
268 \end_inset
269
270
271 \end_layout
272
273 \begin_layout Subsubsection
274 Columns inside columns
275 \end_layout
276
277 \begin_layout Standard
278 You can even have columns inside columns:
279 \end_layout
280
281 \begin_layout Standard
282 \begin_inset VSpace -2ex
283 \end_inset
284
285
286 \end_layout
287
288 \begin_layout Standard
289 \begin_inset ERT
290 status collapsed
291
292 \begin_layout Plain Layout
293
294
295 \backslash
296 begin{multicols}{2}
297 \end_layout
298
299 \end_inset
300
301
302 \end_layout
303
304 \begin_layout Standard
305
306 \size footnotesize
307 The Honourable Ronald Adair was the second son of the Earl of Maynooth,
308  at that time governor of one of the Australian colonies.
309  Adair's mother had returned from Australia to undergo the operation for
310  cataract, and she, her son Ronald, and her daughter Hilda were living together
311  at 427 Park Lane.
312 \end_layout
313
314 \begin_layout Standard
315 \begin_inset VSpace -2ex
316 \end_inset
317
318
319 \end_layout
320
321 \begin_layout Standard
322 \begin_inset ERT
323 status collapsed
324
325 \begin_layout Plain Layout
326
327
328 \backslash
329 begin{multicols}{2}
330 \end_layout
331
332 \end_inset
333
334
335 \end_layout
336
337 \begin_layout Standard
338
339 \size footnotesize
340 The youth moved in the best society--had, so far as was known, no enemies
341  and no particular vices.
342  He had been engaged to Miss Edith Woodley, of Carstairs, but the engagement
343  had been broken off by mutual consent some months before, and there was
344  no sign that it had left any very profound feeling behind it.
345  For the rest {sic} the man's life moved in a narrow and conventional circle,
346  for his habits were quiet and his nature unemotional.
347  Yet it was upon this easy-going young aristocrat that death came, in most
348  strange and unexpected form, between the hours of ten and eleven-twenty
349  on the night of March 30, 1894.
350 \end_layout
351
352 \begin_layout Standard
353 \begin_inset ERT
354 status collapsed
355
356 \begin_layout Plain Layout
357
358
359 \backslash
360 end{multicols}
361 \end_layout
362
363 \end_inset
364
365
366 \end_layout
367
368 \begin_layout Standard
369
370 \size footnotesize
371 Ronald Adair was fond of cards--playing continually, but never for such
372  stakes as would hurt him.
373  He was a member of the Baldwin, the Cavendish, and the Bagatelle card clubs.
374  It was shown that, after dinner on the day of his death, he had played
375  a rubber of whist at the latter club.
376  He had also played there in the afternoon.
377
378 \size default
379  
380 \size footnotesize
381 The evidence of those who had played with him-- Mr.
382  Murray, Sir John Hardy, and Colonel Moran--showed that the game was whist,
383  and that there was a fairly equal fall of the cards.
384  Adair might have lost five pounds, but not more.
385  His fortune was a considerable one, and such a loss could not in any way
386  affect him.
387  He had played nearly every day at one club or other, but he was a cautious
388  player, and usually rose a winner.
389  It came out in evidence that, in partnership with Colonel Moran, he had
390  actually won as much as four hundred and twenty pounds in a sitting, some
391  weeks before, from Godfrey Milner and Lord Balmoral.
392  So much for his recent history as it came out at the inquest.
393 \end_layout
394
395 \begin_layout Standard
396 \begin_inset ERT
397 status collapsed
398
399 \begin_layout Plain Layout
400
401
402 \backslash
403 end{multicols}
404 \end_layout
405
406 \end_inset
407
408
409 \end_layout
410
411 \begin_layout Subsection
412 Advanced Examples
413 \end_layout
414
415 \begin_layout Standard
416 As you probably know 
417 \family typewriter
418 multicol
419 \family default
420  has several customizing variables.
421  The following examples shows how these can be used from LyX.
422 \end_layout
423
424 \begin_layout Subsubsection
425 Preface and Skip
426 \end_layout
427
428 \begin_layout Standard
429 If there is less than 5cm left on the page, a page break will be inserted
430  before this bit, which has a preface text above the two columns: 
431 \end_layout
432
433 \begin_layout Standard
434 \begin_inset ERT
435 status collapsed
436
437 \begin_layout Plain Layout
438
439
440 \backslash
441 begin{multicols}{2}[
442 \end_layout
443
444 \end_inset
445
446 And the story continues and continues and continues and continues\SpecialChar \ldots{}
447
448 \begin_inset ERT
449 status collapsed
450
451 \begin_layout Plain Layout
452
453 ][5cm]
454 \end_layout
455
456 \end_inset
457
458
459 \end_layout
460
461 \begin_layout Standard
462
463 \size small
464 On the evening of the crime, he returned from the club exactly at ten.
465  His mother and sister were out spending the evening with a relation.
466  The servant deposed that she heard him enter the front room on the second
467  floor, generally used as his sitting-room.
468  She had lit a fire there, and as it smoked she had opened the window.
469  No sound was heard from the room until eleven-twenty, the hour of the return
470  of Lady Maynooth and her daughter.
471  Desiring to say good-night, she attempted to enter her son's room.
472  The door was locked on the inside, and no answer could be got to their
473  cries and knocking.
474  Help was obtained, and the door forced.
475  The unfortunate young man was found lying near the table.
476  His head had been horribly mutilated by an expanding revolver bullet, but
477  no weapon of any sort was to be found in the room.
478  On the table lay two bank notes for ten pounds each and seventeen pounds
479  ten in silver and gold, the money arranged in little piles of varying amount.
480  There were some figures also upon a sheet of paper, with the names of some
481  club friends opposite to them, from which it was conjectured that before
482  his death he was endeavouring to make out his losses or winnings at cards.
483 \end_layout
484
485 \begin_layout Standard
486 \begin_inset ERT
487 status collapsed
488
489 \begin_layout Plain Layout
490
491
492 \backslash
493 end{multicols}
494 \end_layout
495
496 \end_inset
497
498
499 \end_layout
500
501 \begin_layout Subsubsection
502 Preface and sections
503 \end_layout
504
505 \begin_layout Standard
506 What if you want the preface to be a sectioning command? That can be done,
507  but only through LaTeX commands inside the parameters for the 
508 \family typewriter
509 multicols
510 \family default
511  command.
512  Because of this, the section command cannot be provided by LyX:
513 \end_layout
514
515 \begin_layout Standard
516 \begin_inset ERT
517 status collapsed
518
519 \begin_layout Plain Layout
520
521
522 \backslash
523 begin{multicols}{2}[
524 \backslash
525 subsubsection{
526 \end_layout
527
528 \end_inset
529
530 This is the sectioning command as a preface
531 \begin_inset ERT
532 status collapsed
533
534 \begin_layout Plain Layout
535
536 }][5cm]
537 \end_layout
538
539 \end_inset
540
541
542 \end_layout
543
544 \begin_layout Standard
545
546 \size small
547 A minute examination of the circumstances served only to make the case more
548  complex.
549  In the first place, no reason could be given why the young man should have
550  fastened the door upon the inside.
551  There was the possibility that the murderer had done this, and had afterwards
552  escaped by the window.
553  The drop was at least twenty feet, however, and a bed of crocuses in full
554  bloom lay beneath.
555  Neither the flowers nor the earth showed any sign of having been disturbed,
556  nor were there any marks upon the narrow strip of grass which separated
557  the house from the road.
558  Apparently, therefore, it was the young man himself who had fastened the
559  door.
560  But how did he come by his death? No one could have climbed up to the window
561  without leaving traces.
562  Suppose a man had fired through the window, he would indeed be a remarkable
563  shot who could with a revolver inflict so deadly a wound.
564  Again, Park Lane is a frequented thoroughfare; there is a cab stand within
565  a hundred yards of the house.
566  No one had heard a shot.
567  And yet there was the dead man and there the revolver bullet, which had
568  mushroomed out, as soft-nosed bullets will, and so inflicted a wound which
569  must have caused instantaneous death.
570  Such were the circumstances of the Park Lane Mystery, which were further
571  complicated by entire absence of motive, since, as I have said, young Adair
572  was not known to have any enemy, and no attempt had been made to remove
573  the money or valuables in the room.
574 \end_layout
575
576 \begin_layout Standard
577 \begin_inset ERT
578 status collapsed
579
580 \begin_layout Plain Layout
581
582
583 \backslash
584 end{multicols}
585 \end_layout
586
587 \end_inset
588
589
590 \end_layout
591
592 \begin_layout Subsubsection
593 Free Space
594 \end_layout
595
596 \begin_layout Standard
597 The 
598 \family typewriter
599 multicol
600 \family default
601  package demands that a certain amount of space is available before and
602  after a multicolumn section.
603  In addition 
604 \family typewriter
605 multicol
606 \family default
607  inserts a given space in front of and after the multicol section.
608  The commands to change the default settings for this must be given just
609  before the 
610 \family typewriter
611
612 \backslash
613 begin{multicols}
614 \family default
615 .
616  This example puts a space of 3 cm in front of and after the multicolumn
617  text:
618 \end_layout
619
620 \begin_layout Standard
621 \begin_inset ERT
622 status collapsed
623
624 \begin_layout Plain Layout
625
626
627 \backslash
628 setlength{
629 \backslash
630 multicolsep}{3cm}
631 \backslash
632 begin{multicols}{2}
633 \end_layout
634
635 \end_inset
636
637
638 \end_layout
639
640 \begin_layout Standard
641
642 \size small
643 All day I turned these facts over in my mind, endeavouring to hit upon some
644  theory which could reconcile them all, and to find that line of least resistanc
645 e which my poor friend had declared to be the starting-point of every investigat
646 ion.
647  I confess that I made little progress.
648  In the evening I strolled across the Park, and found myself about six o'clock
649  at the Oxford Street end of Park Lane.
650  A group of loafers upon the pavements, all staring up at a particular window,
651  directed me to the house which I had come to see.
652  A tall, thin man with coloured glasses, whom I strongly suspected of being
653  a plain-clothes detective, was pointing out some theory of his own, while
654  the others crowded round to listen to what he said.
655  I got as near him as I could, but his observations seemed to me to be absurd,
656  so I withdrew again in some disgust.
657  As I did so I struck against an elderly, deformed man, who had been behind
658  me, and I knocked down several books which he was carrying.
659  I remember that as I picked them up, I observed the title of one of them,
660  THE ORIGIN OF TREE WORSHIP, and it struck me that the fellow must be some
661  poor bibliophile, who, either as a trade or as a hobby, was a collector
662  of obscure volumes.
663  I endeavoured to apologize for the accident, but it was evident that these
664  books which I had so unfortunately maltreated were very precious objects
665  in the eyes of their owner.
666  With a snarl of contempt he turned upon his heel, and I saw his curved
667  back and white side-whiskers disappear among the throng.
668 \end_layout
669
670 \begin_layout Standard
671 \begin_inset ERT
672 status collapsed
673
674 \begin_layout Plain Layout
675
676
677 \backslash
678 end{multicols}
679 \end_layout
680
681 \end_inset
682
683
684 \end_layout
685
686 \begin_layout Paragraph
687 Note:
688 \end_layout
689
690 \begin_layout Standard
691 The values you set with 
692 \family typewriter
693
694 \backslash
695 setlength
696 \family default
697  must be reset to default after use, or you will get the modified value
698  in the rest of your document.
699 \end_layout
700
701 \begin_layout Standard
702 \begin_inset ERT
703 status collapsed
704
705 \begin_layout Plain Layout
706
707
708 \backslash
709 setlength{
710 \backslash
711 multicolsep}{13pt}
712 \end_layout
713
714 \end_inset
715
716
717 \end_layout
718
719 \begin_layout Subsubsection
720 Column Width and Separation
721 \end_layout
722
723 \begin_layout Standard
724 The width of the columns inside the 
725 \family sans
726 multicols
727 \family default
728  environment is automatically calculated, but you can modify the space between
729  two columns explicitly.
730  The space between the following two columns is 3 cm wide:
731 \end_layout
732
733 \begin_layout Standard
734 \begin_inset ERT
735 status collapsed
736
737 \begin_layout Plain Layout
738
739
740 \backslash
741 setlength{
742 \backslash
743 columnsep}{3cm}
744 \backslash
745 begin{multicols}{2}
746 \end_layout
747
748 \end_inset
749
750
751 \end_layout
752
753 \begin_layout Standard
754
755 \size small
756 My observations of No.
757  427 Park Lane did little to clear up the problem in which I was interested.
758  The house was separated from the street by a low wall and railing, the
759  whole not more than five feet high.
760  It was perfectly easy, therefore, for anyone to get into the garden, but
761  the window was entirely inaccessible, since there was no water pipe or
762  anything which could help the most active man to climb it.
763  More puzzled than ever, I retraced my steps to Kensington.
764  I had not been in my study five minutes when the maid entered to say that
765  a person desired to see me.
766  To my astonishment it was none other than my strange old book collector,
767  his sharp, wizened face peering out from a frame of white hair, and his
768  precious volumes, a dozen of them at least, wedged under his right arm.
769 \end_layout
770
771 \begin_layout Standard
772 \begin_inset ERT
773 status collapsed
774
775 \begin_layout Plain Layout
776
777
778 \backslash
779 end{multicols}
780 \end_layout
781
782 \end_inset
783
784
785 \end_layout
786
787 \begin_layout Standard
788 Once again, we have to reset the value after use to avoid using it in the
789  rest of the document.
790 \end_layout
791
792 \begin_layout Standard
793 \begin_inset ERT
794 status collapsed
795
796 \begin_layout Plain Layout
797
798
799 \backslash
800 setlength{
801 \backslash
802 columnsep}{10pt}
803 \end_layout
804
805 \end_inset
806
807
808 \end_layout
809
810 \begin_layout Subsubsection
811 Vertical Lines
812 \end_layout
813
814 \begin_layout Standard
815 Between every two columns, a rule of width 
816 \family typewriter
817
818 \backslash
819 columnseprule
820 \family default
821  is placed.
822  If this rule is set to 0 pt, the rule is suppressed.
823  In the following example, the line separating the two columns is 2 pt wide.
824 \end_layout
825
826 \begin_layout Standard
827 \begin_inset ERT
828 status collapsed
829
830 \begin_layout Plain Layout
831
832
833 \backslash
834 setlength{
835 \backslash
836 columnseprule}{2pt}
837 \backslash
838 begin{multicols}{2}
839 \end_layout
840
841 \end_inset
842
843
844 \end_layout
845
846 \begin_layout Standard
847
848 \size small
849 \begin_inset Quotes eld
850 \end_inset
851
852 You're surprised to see me, sir,
853 \begin_inset Quotes erd
854 \end_inset
855
856  said he, in a strange, croaking voice.
857 \end_layout
858
859 \begin_layout Standard
860
861 \size small
862 I acknowledged that I was.
863 \end_layout
864
865 \begin_layout Standard
866
867 \size small
868 \begin_inset Quotes eld
869 \end_inset
870
871 Well, I've a conscience, sir, and when I chanced to see you go into this
872  house, as I came hobbling after you, I thought to myself, I'll just step
873  in and see that kind gentleman, and tell him that if I was a bit gruff
874  in my manner there was not any harm meant, and that I am much obliged to
875  him for picking up my books.
876 \begin_inset Quotes erd
877 \end_inset
878
879
880 \end_layout
881
882 \begin_layout Standard
883
884 \size small
885 \begin_inset Quotes eld
886 \end_inset
887
888 You make too much of a trifle,
889 \begin_inset Quotes erd
890 \end_inset
891
892  said I.
893  
894 \begin_inset Quotes eld
895 \end_inset
896
897 May I ask how you knew who I was?
898 \begin_inset Quotes erd
899 \end_inset
900
901
902 \end_layout
903
904 \begin_layout Standard
905
906 \size small
907 \begin_inset Quotes eld
908 \end_inset
909
910 Well, sir, if it isn't too great a liberty, I am a neighbour of yours, for
911  you'll find my little bookshop at the corner of Church Street, and very
912  happy to see you, I am sure.
913  Maybe you collect yourself, sir.
914  Here's 
915 \noun on
916 British
917 \begin_inset space ~
918 \end_inset
919
920 Birds
921 \noun default
922 , and 
923 \noun on
924 Catullus
925 \noun default
926 , and 
927 \noun on
928 The Holy War
929 \noun default
930 --a bargain, every one of them.
931  With five volumes you could just fill that gap on that second shelf.
932  It looks untidy, does it not, sir?
933 \begin_inset Quotes erd
934 \end_inset
935
936
937 \end_layout
938
939 \begin_layout Standard
940 \begin_inset ERT
941 status collapsed
942
943 \begin_layout Plain Layout
944
945
946 \backslash
947 end{multicols}
948 \end_layout
949
950 \end_inset
951
952
953 \end_layout
954
955 \begin_layout Standard
956 As usual, we reset the value after use.
957 \end_layout
958
959 \begin_layout Standard
960 \begin_inset ERT
961 status collapsed
962
963 \begin_layout Plain Layout
964
965
966 \backslash
967 setlength{
968 \backslash
969 columnseprule}{0pt}
970 \end_layout
971
972 \end_inset
973
974
975 \end_layout
976
977 \begin_layout Standard
978 You'll have to go to the library to read the rest of the story.
979 \begin_inset Foot
980 status collapsed
981
982 \begin_layout Plain Layout
983 \SpecialChar \ldots{}
984 or cheat like we did and find it at the Gutenberg project somewhere on the
985  Web.
986 \end_layout
987
988 \end_inset
989
990  Believe it or not, but it's actually a bit of a cliff-hanger at this point
991  in the story\SpecialChar \ldots{}
992
993 \end_layout
994
995 \end_body
996 \end_document