-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathLyXInstallation.lyx
727 lines (530 loc) · 15.4 KB
/
LyXInstallation.lyx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
#LyX 2.0 created this file. For more info see http://www.lyx.org/
\lyxformat 413
\begin_document
\begin_header
\textclass article
\use_default_options true
\begin_modules
sweave
\end_modules
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman default
\font_sans default
\font_typewriter default
\font_default_family default
\use_non_tex_fonts false
\font_sc false
\font_osf false
\font_sf_scale 100
\font_tt_scale 100
\graphics default
\default_output_format default
\output_sync 0
\bibtex_command default
\index_command default
\paperfontsize default
\spacing single
\use_hyperref false
\papersize default
\use_geometry false
\use_amsmath 1
\use_esint 1
\use_mhchem 1
\use_mathdots 1
\cite_engine basic
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date false
\use_refstyle 1
\index Index
\shortcut idx
\color #008000
\end_index
\secnumdepth 3
\tocdepth 3
\paragraph_separation indent
\paragraph_indentation default
\quotes_language english
\papercolumns 1
\papersides 1
\paperpagestyle default
\tracking_changes false
\output_changes false
\html_math_output 0
\html_css_as_file 0
\html_be_strict false
\end_header
\begin_body
\begin_layout Title
Instructions for LyX Installation
\end_layout
\begin_layout Author
Jeff Laake
\end_layout
\begin_layout Section
Installation
\end_layout
\begin_layout Enumerate
Make sure you have R on your computer and that the directory specification
to the bin sub-directory of R is in your path.
For example, my path contains C:
\backslash
Program Files
\backslash
R
\backslash
R-2.15.0
\backslash
bin.
If you don't know what a path is, get help from your IT folks.
It is set with Control Panel/System & Security/ System/Advanced/Environment
Variables.
You may need Admin privilege to set it.
Make sure to add/modify the path under system variables rather than user
variables.
Figure
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:Setting-your-path"
\end_inset
shows the screens for setting your path on a Windows 7 machine.
\begin_inset Float figure
wide false
sideways false
status open
\begin_layout Plain Layout
\begin_inset Graphics
filename settingPath.png
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Caption
\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "fig:Setting-your-path"
\end_inset
Setting your path on a Windows 7 machine.
\end_layout
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Enumerate
Before installation of LyX it is best to close all programs and not do anything
else on the computer as this is a time consuming process and it requires
a good internet connection because it will access the internet throughout
the installation.
At the end it will look like it is nearly done and there is a note that
it will take some time -- trust it -- it will take some time.
Be patient and don't assume your machine has hung.
\end_layout
\begin_layout Enumerate
\begin_inset Flex URL
status open
\begin_layout Plain Layout
ftp://ftp.lyx.org/pub/lyx/bin/
\end_layout
\end_inset
click on the link and then select the most current version (2.0.3 at time
of writing) and then download the appropriate file.
For windows to get the file that will install all necessary software, click
on the file Lyx-2.0.3-2-Alt-Bundle.exe and save it somewhere.
For the Mac, use LyX-2.0.3+qt4-carbon.dmg.
Alternatively, you can get to these files from
\begin_inset Flex URL
status collapsed
\begin_layout Plain Layout
http://www.lyx.org/Download
\end_layout
\end_inset
.
\end_layout
\begin_layout Enumerate
Right click on the above file where you saved it and use Run as Administrator
-- You'll need a local Administrator account.
It will setup Lyx and then MikTex and Jabref if you want.
\end_layout
\begin_layout Enumerate
When asked, make sure you set up LyX and MikTex for all users (the default)
this is especially important if you are using a separate Admin account
to install the software.
Also makes sense to use the default locations to store the files unless
you have a good reason for doing otherwise.
You may want to change the paper size from A4 to Letter.
Also, answer yes to install packages on the fly under the MikTex setup.
\end_layout
\begin_layout Enumerate
Once it is completed, start LyX (with regular non-admin account) and open
(File/Open) the sweave.lyx file under Resources sub-directory of the LyX
directory.
If you get an error message that about missing package sweave->latex, click
on Tools/Reconfigure.
When it is done, close LyX and restart it.
Repeat this step to see if you can open the file without that error.
If you cannot then you do not have your path to R setup correctly.
You can test that by Start/AllPrograms/Accessories/Command Window.
Type Rscript.
If it gives some help messages then your path is fine.
If it gives an error that the command is unknown or bad then your path
is not setup correctly.
\end_layout
\begin_layout Enumerate
Once you get past step 5, click on the icon with the two eyeballs on the
far left.
If a pdf document appears you are good to go.
If it doesn't, click on View/View messages and click on the eyeballs again
and copy the material in the view window and see what error it is giving.
\end_layout
\begin_layout Standard
Other errors may occur if your installation did not complete.
If that happens then you should probably uninstall (Control Panel/Uninstall
Programs) both LyX and MikTeX and start over.
If it is simply missing package, style or class file for a document, use
this next section to add the missing files into the LaTeX (MikTeX) configuratio
n.
\end_layout
\begin_layout Section
Adding missing LaTeX files
\end_layout
\begin_layout Standard
Even though MikTeX is supposed to add packages on the fly, LyX will produce
an error when it cannot find a class, style or package (not to be confused
with R packages).
When this happens or when you want to use one of those that are not installed
then you need to add it with the MikTeX Admin programs.
You can find them in Start/Program Files/MikTeX/Maintenance.
First you use Package Manager to locate and install the necessary file(s).
It will show a list of all the files alphabetically and when they were
installed, if they are installed.
You can select one from the list manually or by entering a name, keyword
or file name and select Filter.
\end_layout
\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open
\begin_layout Plain Layout
\begin_inset Graphics
filename Add package.PNG
\end_inset
\begin_inset Caption
\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "fig:Adding-a-missing-file"
\end_inset
Adding a missing package, class or style file with MikTeX/Maintenance/Package
Manager.
\end_layout
\end_inset
\end_layout
\begin_layout Plain Layout
\end_layout
\end_inset
\end_layout
\begin_layout Standard
In Figure
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:Adding-a-missing-file"
\end_inset
I selected fancyvrb because this is one that you may encounter.
However, on my computer it is already installed, so I'll select another
and show how it is installed in Figure
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:Installing-a-missing"
\end_inset
.
\end_layout
\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open
\begin_layout Plain Layout
\begin_inset Graphics
filename Installing a package.PNG
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Caption
\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "fig:Installing-a-missing"
\end_inset
Installing a missing package.
\end_layout
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Standard
Click on okay and it will install it if you can access the internet.
After it has completed, click on the close and if you look on the package
list it will show the current date under installed.
Next you need to use MikTeX/Maintenance/Settings program to refresh the
package database.
As shown in Figure
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:MikTeX-settings-program."
\end_inset
, you click on refresh FNDB and then Update Formats.
Once both are completed click on ok.
\end_layout
\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open
\begin_layout Plain Layout
\begin_inset Graphics
filename MikTex Settings Refresh.PNG
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Caption
\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "fig:MikTeX-settings-program."
\end_inset
MikTeX settings program.
Refreshing database and updating formats after adding a package, class
or style file.
\end_layout
\end_inset
\end_layout
\begin_layout Plain Layout
\end_layout
\end_inset
\end_layout
\begin_layout Standard
The final step is to start LyX, and select from the menu Tools/Reconfigure.
Once it has completed the reconfiguration it will ask you to close and
restart LyX.
If everything has worked, when you restart LyX, the package,class or style
file should be available for use.
\end_layout
\begin_layout Section
More LyX options and setup
\end_layout
\begin_layout Standard
When you use Sweave with LyX, Sweave is run in R and the working directory
for R is the directory that contains the .LyX file that you are Sweaving.
However, the .Rnw, .Tex and other files that it creates for the pdf creation
are contained in a temporary directory that is removed upon closing LyX.
By default, this temporary directory is stored in a hidden directory (appdata)
under the user directory (e.g., C:
\backslash
Users
\backslash
JLaake
\backslash
AppData
\backslash
Local
\backslash
Temp).
This location is not particularly easy to access, so I recommend changing
the path with the Tools/Preferences, to a location that you can easily
access as shown in Figure
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:Changing-the-location"
\end_inset
.
Usually you need not bother with those files but if there is a problem
with either your R code or your Tex, it can be useful to examine the .Rnw
or .Tex text files in the directory.
\end_layout
\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open
\begin_layout Plain Layout
\begin_inset Graphics
filename Changing Temporary path.PNG
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Caption
\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "fig:Changing-the-location"
\end_inset
Changing the location of the temporary directory for the Sweave temporary
files.
As shown mine is setup to be C:
\backslash
Users
\backslash
JLaake
\backslash
Lyx.
\end_layout
\end_inset
\end_layout
\begin_layout Plain Layout
\end_layout
\end_inset
\end_layout
\begin_layout Standard
Another way to track down errors is to select View/View Messages from the
LyX menu.
It will open a window at the bottom of the screen and as you process the
pdf document it will show what is being done and any errors that occur.
Look through the entire window as the R coding error may be shown prior
to the last error message.
This window also shows other LyX errors/messages.
For example, in Figure
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:View-messages-window"
\end_inset
it keeps showing messages that I should stop trying to put 2 spaces at
the end of a sentence which is an unnecessary habit from using Word.
LaTex takes care of all that formatting for you.
\end_layout
\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open
\begin_layout Plain Layout
\begin_inset Graphics
filename View Messages.PNG
\end_inset
\begin_inset Caption
\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "fig:View-messages-window"
\end_inset
View messages window in LyX which is useful for tracking down R coding errors
and other LyX problems.
\end_layout
\end_inset
\end_layout
\begin_layout Plain Layout
\end_layout
\end_inset
\end_layout
\begin_layout Standard
Another useful window is the View/View Source window which shows all of
the LaTeX in the document that LyX is creating for you.
Click on the box complete source to see all of the LaTeX (Figure
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:Viewing-LaTeX-source"
\end_inset
).
This is similar to Reveal Codes in other word processors.
\end_layout
\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open
\begin_layout Plain Layout
\begin_inset Graphics
filename View Latex Source.PNG
\end_inset
\begin_inset Caption
\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "fig:Viewing-LaTeX-source"
\end_inset
Viewing LaTeX source with the View/View Source option.
\end_layout
\end_inset
\end_layout
\begin_layout Plain Layout
\end_layout
\end_inset
\end_layout
\begin_layout Section
HELP!
\end_layout
\begin_layout Standard
LyX is a very capable word processor like Word and others but it works very
differently from Word.
Thus, it is important to spend some time with the help and tutorials that
accompany LyX (Figure
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:Accessing-LyX-help"
\end_inset
).
If you open one of these files, it will appear in LyX format but if you
want to read it in the more polished form, click on the two-eyeball icon
and it will convert it to pdf (Figure
\begin_inset CommandInset ref
LatexCommand ref
reference "fig:Viewing-help-files"
\end_inset
).
The tutorial is nicely done and will take you through all the steps needed
to create a LyX document and use its features.
I will follow up with a tutorial of sorts that focuses on Sweave documents.
\end_layout
\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open
\begin_layout Plain Layout
\begin_inset Graphics
filename LyX Help.PNG
\end_inset
\begin_inset Caption
\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "fig:Accessing-LyX-help"
\end_inset
Accessing LyX help files.
\end_layout
\end_inset
\end_layout
\begin_layout Plain Layout
\end_layout
\end_inset
\end_layout
\begin_layout Standard
\begin_inset Float figure
wide false
sideways false
status open
\begin_layout Plain Layout
\begin_inset Graphics
filename Help as pdf.PNG
\end_inset
\begin_inset Caption
\begin_layout Plain Layout
\begin_inset CommandInset label
LatexCommand label
name "fig:Viewing-help-files"
\end_inset
Viewing help files in pdf format.
\end_layout
\end_inset
\end_layout
\begin_layout Plain Layout
\end_layout
\end_inset
\end_layout
\end_body
\end_document