#LyX 2.1 created this file. For more info see http://www.lyx.org/
\lyxformat 474
\begin_document
\begin_header
\textclass scrartcl
\begin_preamble
\usepackage{multicol}
\usepackage{graphbox}
\usepackage{graphicx}
\usepackage{listings}
\usepackage{color}
\lstset{tabsize=2, breaklines=true,
breakatwhitespace=true,
language=R,
captionpos=b,
frame=single,
framerule=0.2pt,
framesep=1pt,
numbers=left,
numberstyle=\tiny,
numbersep=5pt,
showstringspaces=false,
basicstyle=\footnotesize,
identifierstyle=\color{magenta},
keywordstyle=\bfseries,
commentstyle=\color{darkgreen},
stringstyle=\color{red},
backgroundcolor=\color[gray]{0.97}
}
\usepackage{caption}
\usepackage{fancyhdr}
\usepackage{lastpage}
\fancypagestyle{firststyle}
{
\cfoot{{Page }\thepage { of} \pageref{LastPage}}
\renewcommand{\headrulewidth}{0pt}
\fancyfoot[L]{1425 Jayhawk Blvd.\\470 Watson Library\\ Lawrence, KS 66045-7555}
\fancyfoot[R]{{\includegraphics[align=c, width=1.4cm, trim=0 0 0 0]{./images/CClicense.png}} This work is licensed under\\ a Creative Commons Attribution\\ 4.0 International License.}
\renewcommand{\footrulewidth}{.4pt}
}
\thispagestyle{firststyle}
\end_preamble
\use_default_options true
\begin_modules
logicalmkup
\end_modules
\maintain_unincluded_children false
\language english
\language_package default
\inputencoding auto
\fontencoding global
\font_roman lmodern
\font_sans lmss
\font_typewriter lmtt
\font_math auto
\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 10
\spacing single
\use_hyperref false
\papersize letterpaper
\use_geometry true
\use_package amsmath 1
\use_package amssymb 1
\use_package cancel 1
\use_package esint 1
\use_package mathdots 1
\use_package mathtools 1
\use_package mhchem 1
\use_package stackrel 1
\use_package stmaryrd 1
\use_package undertilde 1
\cite_engine natbib
\cite_engine_type authoryear
\biblio_style plainnat
\use_bibtopic false
\use_indices false
\paperorientation portrait
\suppress_date true
\justification true
\use_refstyle 0
\index Index
\shortcut idx
\color #008000
\end_index
\leftmargin 1in
\topmargin 1in
\rightmargin 1in
\bottommargin 1in
\secnumdepth 3
\tocdepth 3
\paragraph_separation skip
\defskip medskip
\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 Standard
\begin_inset ERT
status open
\begin_layout Plain Layout
\backslash
title{}
\end_layout
\end_inset
\end_layout
\begin_layout Standard
\noindent
\begin_inset Tabular
\begin_inset Text
\begin_layout Plain Layout
\begin_inset Box Frameless
position "c"
hor_pos "c"
has_inner_box 1
inner_pos "c"
use_parbox 0
use_makebox 0
width "1in"
special "none"
height "1in"
height_special "totalheight"
status open
\begin_layout Plain Layout
\noindent
\align center
\shape smallcaps
\size giant
\begin_inset Graphics
filename images/jayhawk.pdf
lyxscale 40
width 1in
\end_inset
\end_layout
\end_inset
\end_layout
\end_inset
|
\begin_inset Text
\begin_layout Plain Layout
\begin_inset Box Frameless
position "c"
hor_pos "c"
has_inner_box 1
inner_pos "c"
use_parbox 0
use_makebox 0
width "3in"
special "none"
height "1in"
height_special "totalheight"
status open
\begin_layout Plain Layout
\noindent
\align center
\shape smallcaps
\size giant
\begin_inset Box Frameless
position "t"
hor_pos "c"
has_inner_box 1
inner_pos "t"
use_parbox 0
use_makebox 0
width "100col%"
special "none"
height "1in"
height_special "totalheight"
status open
\begin_layout Plain Layout
\noindent
\align center
\size huge
How Users can Install LaTeX packages without Help from System Administrators
\end_layout
\begin_layout Plain Layout
\noindent
\begin_inset CommandInset line
LatexCommand rule
offset "0.5ex"
width "100line%"
height "1pt"
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Box Frameless
position "t"
hor_pos "c"
has_inner_box 1
inner_pos "t"
use_parbox 0
use_makebox 0
width "100col%"
special "none"
height "1in"
height_special "totalheight"
status open
\begin_layout Plain Layout
\noindent
\align center
\size large
Paul E.
Johnson
\size default
\end_layout
\begin_layout Plain Layout
\noindent
\align center
\size large
Kenna Whitley
\size default
\end_layout
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset VSpace bigskip
\end_inset
\end_layout
\end_inset
\end_layout
\end_inset
|
\begin_inset Text
\begin_layout Plain Layout
\begin_inset Box Frameless
position "c"
hor_pos "c"
has_inner_box 1
inner_pos "c"
use_parbox 0
use_makebox 0
width "2in"
special "none"
height "1in"
height_special "totalheight"
status open
\begin_layout Plain Layout
\noindent
\align center
\shape smallcaps
\size giant
\begin_inset Graphics
filename images/CRMDA_1PMS293_UnitHorz.pdf
lyxscale 40
width 2in
\end_inset
\end_layout
\begin_layout Plain Layout
\noindent
\align center
\size larger
http://crmda.ku.edu
\end_layout
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Box Frameless
position "c"
hor_pos "c"
has_inner_box 1
inner_pos "c"
use_parbox 0
use_makebox 0
width "2in"
special "none"
height "1in"
height_special "totalheight"
status open
\begin_layout Plain Layout
\noindent
\align center
\shape smallcaps
\size large
Guide No:
\shape default
32
\end_layout
\begin_layout Plain Layout
\begin_inset VSpace bigskip
\end_inset
\end_layout
\end_inset
\end_layout
\end_inset
|
\end_inset
\end_layout
\begin_layout Abstract
The Center for Research Methods and Data Analysis at the University of Kansas
endorses LaTeX as a document preparation framework.
This document is about what users can do when the system administrator
is not around to install LaTeX packages.
\end_layout
\begin_layout Standard
\begin_inset CommandInset toc
LatexCommand tableofcontents
\end_inset
\end_layout
\begin_layout Section
Overview
\end_layout
\begin_layout Standard
When a user wants to use a LaTeX style or class file that the system administrat
or has not installed, it is still possible to install the package into the
user's workspace and get the project done.
A system administrator can always install the package later.
\end_layout
\begin_layout Standard
There will be a 2 step process
\end_layout
\begin_layout Standard
1.
Put the package or the style file in
\begin_inset Quotes eld
\end_inset
the right place
\begin_inset Quotes erd
\end_inset
(somewhere in the user's HOME folder)
\end_layout
\begin_layout Standard
2.
Tell the LaTeX distribution to use the new package or style files.
\end_layout
\begin_layout Standard
There are some operating systems, or some LaTeX distributions, where step
2 is not required.
However, in our testing we find step 2 is actually needed on some systems--the
LaTeX compile fails because the packages are not found.
As a result, we run the re-configure step, even if it might not strictly
be necessary.
\end_layout
\begin_layout Standard
There are operating system-specific ways to update the package data base,
but, so far as we know, the following should work on every system that
has a command line interface or terminal:
\end_layout
\begin_layout Standard
\begin_inset Flex Code
status open
\begin_layout Plain Layout
$ texhash
\end_layout
\end_inset
\end_layout
\begin_layout Standard
If the user has a graphical interface for preparing LaTeX documents, it
might be necessary to tell that program about the new packages.
In LyX, for example, it is necessary to open LyX and run
\begin_inset Quotes eld
\end_inset
Settings
\begin_inset Quotes erd
\end_inset
->
\begin_inset Quotes eld
\end_inset
Reconfigure
\begin_inset Quotes erd
\end_inset
.
\end_layout
\begin_layout Section
Microsoft Windows with the MikTeX Distribution
\end_layout
\begin_layout Standard
With Windows, there are two ways to perform package installs: manually,
or using the Package Manager.
\end_layout
\begin_layout Subsection
Using the MiKTeX Package Manager
\end_layout
\begin_layout Standard
If a package exists in CTAN, use the MiKTeX Package Manager, but not in
the (Admin) mode.
Click Start -> MiKTeX -> Maintenance -> Package Manager.
\end_layout
\begin_layout Standard
\begin_inset Float figure
placement H
wide false
sideways false
status open
\begin_layout Plain Layout
\align center
\begin_inset Graphics
filename images/Expanded.png
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Caption Standard
\begin_layout Plain Layout
Choose Package Manager, not Package Manager (Admin)
\end_layout
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Subsubsection
Installing Packages
\end_layout
\begin_layout Standard
Once the Package Manager is opened, you'll have access to every package
available on CTAN.
Choose one, press the
\begin_inset Graphics
filename images/add.png
scale 75
\end_inset
located in the top left corner.
\end_layout
\begin_layout Standard
\begin_inset Float figure
placement H
wide false
sideways false
status open
\begin_layout Plain Layout
\align center
\begin_inset Graphics
filename images/mpm.png
\end_inset
\begin_inset Caption Standard
\begin_layout Plain Layout
List of Packages
\end_layout
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Standard
\noindent
MiKTeX will verify the number of packages to be installed.
Click
\begin_inset Quotes eld
\end_inset
OK
\begin_inset Quotes erd
\end_inset
, and the package manager will take care of the rest.
\end_layout
\begin_layout Standard
\noindent
Congratulations! You're package is now installed.
\end_layout
\begin_layout Subsubsection
Where did those packages go?
\end_layout
\begin_layout Standard
This is a bit mysterious.
The default on Windows is to put the packages into a
\emph on
hidden folder
\emph default
(not visible by default).
That's a little bit unfortunate because we'd like to put other files in
there.
Usually, that folder has a name like
\begin_inset Quotes eld
\end_inset
\begin_inset Flex Code
status open
\begin_layout Plain Layout
C:
\backslash
Users
\backslash
your-name-here
\backslash
AppData
\backslash
Roaming
\backslash
MikTeX
\backslash
2.9
\backslash
tex
\backslash
latex
\end_layout
\end_inset
\begin_inset Quotes erd
\end_inset
.
\end_layout
\begin_layout Standard
From here, lets use the symbol ~ to refer to
\begin_inset Quotes eld
\end_inset
\begin_inset Flex Code
status open
\begin_layout Plain Layout
C:
\backslash
Users
\backslash
your-name-here
\end_layout
\end_inset
.
\begin_inset Quotes erd
\end_inset
\end_layout
\begin_layout Standard
At this stage, it does not matter to you where those files are, as long
a LaTeX works.
However, it will be important in the next step.
\end_layout
\begin_layout Subsection
Installing Packages or Style Files that are not in CTAN or where MikTeX
fails
\end_layout
\begin_layout Standard
Suppose some body sends you a LaTeX class in a Zip (or tar.gz, or 7zip) package.
Extract that.
Then what?
\end_layout
\begin_layout Standard
Put the new LaTeX files in the same place where MikTeX installed the new
user package in the previous section.
Figuring out where that is will be the most frustrating thing for most
Windows users.
\end_layout
\begin_layout Standard
Step 1.
Find out where your LaTeX distribution will look for user-installed packages.
\end_layout
\begin_layout Standard
To find out, we used the Package Manager to install something that we would
never otherwise use.
Then we searched for the result.
For example, after installing the package
\begin_inset Quotes eld
\end_inset
gchords
\begin_inset Quotes erd
\end_inset
, search inside the user's home folder for the word
\begin_inset Quotes eld
\end_inset
gchord*
\begin_inset Quotes erd
\end_inset
.
That leads us to this directory for the user
\begin_inset Quotes eld
\end_inset
paultest
\begin_inset Quotes erd
\end_inset
:
\end_layout
\begin_layout Standard
\begin_inset Flex Code
status open
\begin_layout Plain Layout
\begin_inset Quotes eld
\end_inset
~
\backslash
AppData
\backslash
Roaming
\backslash
MikTeX
\backslash
2.9
\backslash
tex
\backslash
latex
\backslash
gchords
\end_layout
\end_inset
\begin_inset Quotes erd
\end_inset
\end_layout
\begin_layout Standard
This is a hidden folder, unfortunately.
Every version of Windows Explorer (so far) has a configuration to make
hidden
\begin_inset Quotes eld
\end_inset
protected files visible
\begin_inset Quotes erd
\end_inset
.
Run an Internet search for
\begin_inset Quotes eld
\end_inset
Find AppData Roaming
\begin_inset Quotes erd
\end_inset
on Windows, you'll find thousands of angry users saying
\begin_inset Quotes eld
\end_inset
I need my AppData! Why did they hide it?
\begin_inset Quotes erd
\end_inset
.
Reveal your AppData folder, then continue.
\end_layout
\begin_layout Standard
Step 2.
Copy the LaTeX files into that area.
\end_layout
\begin_layout Standard
If a LaTeX project requires a style file, such as
\begin_inset Quotes eld
\end_inset
Sweavel.sty
\begin_inset Quotes erd
\end_inset
, which we use for R reports, copy the file in
\begin_inset Quotes eld
\end_inset
\begin_inset Flex Code
status open
\begin_layout Plain Layout
C:
\backslash
Users
\backslash
paultest
\backslash
AppData
\backslash
Roaming
\backslash
MikTeX
\backslash
2.9
\backslash
tex
\backslash
latex
\end_layout
\end_inset
.
\begin_inset Quotes erd
\end_inset
\end_layout
\begin_layout Standard
It is OK to copy the file there, or to create a subdirectory within that,
such as
\begin_inset Quotes eld
\end_inset
\begin_inset Flex Code
status open
\begin_layout Plain Layout
C:
\backslash
Users
\backslash
\begin_inset Formula $\ldots$
\end_inset
\backslash
latex
\backslash
local
\end_layout
\end_inset
\begin_inset Quotes erd
\end_inset
.
We chose
\begin_inset Quotes eld
\end_inset
local
\begin_inset Quotes erd
\end_inset
as a subdirectory name, that is fairly common.
\end_layout
\begin_layout Standard
If the LaTeX files are a whole directory, as many packages are, place the
folder in
\begin_inset Quotes eld
\end_inset
\begin_inset Flex Code
status open
\begin_layout Plain Layout
C:
\backslash
Users
\backslash
\begin_inset Formula $\ldots$
\end_inset
\backslash
latex
\end_layout
\end_inset
\begin_inset Quotes erd
\end_inset
.
It can be on the same level as local.
\end_layout
\begin_layout Standard
Step 3.
Tell the MikTeX system to take note of the new style.
Click Windows Start menu MikTeX -> Maintenance -> Settings, then that choose
\end_layout
\begin_layout Standard
Refresh FNDB
\end_layout
\begin_layout Standard
and
\end_layout
\begin_layout Standard
Update Formats
\end_layout
\begin_layout Standard
While you are there, look below under Package Installation.
The
\begin_inset Quotes eld
\end_inset
Install missing packages on the fly
\begin_inset Quotes erd
\end_inset
should be YES.
\end_layout
\begin_layout Standard
It should also work to run
\begin_inset Quotes eld
\end_inset
texhash
\begin_inset Quotes erd
\end_inset
in a command line mode.
Here is is running in Windows Command Box:
\end_layout
\begin_layout Standard
\begin_inset listings
inline false
status open
\begin_layout Plain Layout
C:
\backslash
Users
\backslash
paultest>texhash
\end_layout
\begin_layout Plain Layout
Creating fndb for user root directory (C:
\backslash
Users
\backslash
paultest
\backslash
AppData
\backslash
Roaming
\backslash
MiKTeX
\backslash
2.9)...
\end_layout
\begin_layout Plain Layout
Creating fndb for user root directory (C:
\backslash
Users
\backslash
paultest
\backslash
AppData
\backslash
Local
\backslash
MiKTeX
\backslash
2.
9)...
\end_layout
\begin_layout Plain Layout
Skipping common root directory (C:
\backslash
ProgramData
\backslash
MiKTeX
\backslash
2.9)...
\end_layout
\begin_layout Plain Layout
Skipping common root directory ("C:
\backslash
Program Files (x86)
\backslash
MiKTeX 2.9")...
\end_layout
\end_inset
\end_layout
\begin_layout Subsubsection
Updating Packages
\end_layout
\begin_layout Standard
\begin_inset Float figure
placement H
wide false
sideways false
status open
\begin_layout Plain Layout
\align center
\begin_inset Graphics
filename images/Expanded.png
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Caption Standard
\begin_layout Plain Layout
Do not select the (Admin) version.
\end_layout
\end_inset
\end_layout
\end_inset
To update packages, simply select
\begin_inset Quotes eld
\end_inset
Update
\begin_inset Quotes erd
\end_inset
.
Once you select
\begin_inset Quotes eld
\end_inset
Update
\begin_inset Quotes erd
\end_inset
, you will be prompted to select a package repository.
Choose the nearest package repository.
\end_layout
\begin_layout Standard
\begin_inset Float figure
placement H
wide false
sideways false
status open
\begin_layout Plain Layout
\align center
\begin_inset Graphics
filename images/remote.png
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Caption Standard
\begin_layout Plain Layout
Specify a remote package repository
\end_layout
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Standard
\noindent
Once a package repository is chosen, click
\begin_inset Graphics
filename images/next.png
scale 75
\end_inset
.
MiKTeX finds updates.
Want to install them?
\end_layout
\begin_layout Standard
\begin_inset Float figure
placement H
wide false
sideways false
status open
\begin_layout Plain Layout
\align center
\begin_inset Graphics
filename images/update.png
scale 80
\end_inset
\end_layout
\begin_layout Plain Layout
\begin_inset Caption Standard
\begin_layout Plain Layout
List of updateable packages
\end_layout
\end_inset
\end_layout
\end_inset
\end_layout
\begin_layout Standard
\noindent
Select the packages you wish to update, and select
\begin_inset Graphics
filename images/next.png
scale 75
\end_inset
.
The update will begin, click
\begin_inset Graphics
filename images/next.png
scale 75
\end_inset
, and then
\begin_inset Graphics
filename images/finish.png
scale 75
\end_inset
to complete the process.
\end_layout
\begin_layout Section
Linux
\end_layout
\begin_layout Standard
The user home folder, suppose it is /home/paultest, is the starting point.
It is very likely that the LaTeX configuration will assume that user packages
are to be installed here
\end_layout
\begin_layout Standard
\begin_inset Flex Code
status open
\begin_layout Plain Layout
~/texmf/tex/latex
\end_layout
\end_inset
\end_layout
\begin_layout Standard
\begin_inset Flex Code
status open
\begin_layout Plain Layout
~
\end_layout
\end_inset
is shorthand for
\begin_inset Quotes eld
\end_inset
/home/your-name-here
\begin_inset Quotes erd
\end_inset
.
\end_layout
\begin_layout Standard
That is the equivalent of the hidden user folder
\begin_inset Flex Code
status open
\begin_layout Plain Layout
AppData
\backslash
Roaming
\backslash
MikTeX
\backslash
2.9
\backslash
tex
\backslash
latex
\end_layout
\end_inset
for the Windows user.
Drop the class or style or whole packages in
\begin_inset Flex Code
status open
\begin_layout Plain Layout
~/texmf/tex/latex
\end_layout
\end_inset
.
\end_layout
\begin_layout Standard
Occasionally, packages will not have a .sty file, but will contain a .ins
file.
In order to obtain the .sty file, run the following command:
\end_layout
\begin_layout Standard
$ latex .ins
\end_layout
\begin_layout Standard
After you have your .sty file, run the following in the command prompt
\end_layout
\begin_layout Standard
$ texhash
\end_layout
\begin_layout Standard
texhash is the equivalent of the MikTeX
\begin_inset Quotes eld
\end_inset
Refresh RNDB
\begin_inset Quotes erd
\end_inset
.
There will be a sequence of errors because a non-administrator tried to
do an administrative chore.
The system will refuse to update /usr/local/share/texmf, but it will get
to the end of the directories and it will agree to update the package list
for the user's area.
\end_layout
\begin_layout Section
Macintosh
\end_layout
\begin_layout Standard
The same basic idea also works on a Macintosh computer.
We've just done it.
In the user home folder, create a subdirectory.
\end_layout
\begin_layout Standard
\begin_inset Flex Code
status open
\begin_layout Plain Layout
~/Library/texmf/tex/latex
\end_layout
\end_inset
\end_layout
\begin_layout Standard
~ is shorthand for
\begin_inset Quotes eld
\end_inset
/Users/your-name-here
\begin_inset Quotes erd
\end_inset
.
Copy the desired style or class files and directories in there.
\end_layout
\begin_layout Standard
After that, open a terminal and run
\end_layout
\begin_layout Standard
$ texhash
\end_layout
\begin_layout Standard
As far as we can see, that does nothing and it is not necessary, but it
is not harmful either.
There will be a sequence of messages about folders where the the LaTeX
distribution looks for packages.
\end_layout
\begin_layout Section
After installing the New Packages
\end_layout
\begin_layout Standard
After installing new packages, and causing a
\begin_inset Quotes eld
\end_inset
reconfigure
\begin_inset Quotes erd
\end_inset
cycle, then a LaTeX compiler like
\begin_inset Flex Code
status open
\begin_layout Plain Layout
pdflatex
\end_layout
\end_inset
will be able to make use of them.
Compiling a LaTeX document should
\begin_inset Quotes eld
\end_inset
just work.
\begin_inset Quotes erd
\end_inset
\end_layout
\begin_layout Standard
If one is using LyX, there will be required another step.
LyX must be told to take notice of the new packages.
The user must start LyX, run Tools -> Reconfigure, then when finished,
close LyX and restart.
If the new packages were found, then all is well.
\end_layout
\begin_layout Standard
If LyX still does not find the required packages, then we need to back-track
and figure out why LyX and LaTeX are not able to get this done.
\end_layout
\begin_layout Section
Troubleshooting
\end_layout
\begin_layout Standard
By far, the biggest problem we have run into so far is that users have a
copies of various style and class files in various locations and an old
one is found first, and makes the compile fail.
A search of the files system can usually reveal that problem.
\end_layout
\begin_layout Standard
If there are errors when compiling, say in LyX or TeXWorks, then why not
change gears and open the file in a different editor, say TeXMaker or TeXStudio
? LyX has a nice menu
\begin_inset Quotes eld
\end_inset
File -> Export -> LaTeX (pdflatex)
\begin_inset Quotes erd
\end_inset
.
That creates a *.tex file.
Open that in TeXMaker and you might be surprised how much easier it is
to see what's wrong.
\end_layout
\begin_layout Standard
If it turns out that the tex document will compile in TeXMaker but not in
LyX, that means the LyX configuration is sick.
Usually, the solution is in LyX, do
\begin_inset Quotes eld
\end_inset
Tools -> Reconfigure
\begin_inset Quotes erd
\end_inset
.
Maybe we try that again.
In newer versions of LyX, there's a very handy feature.
In the pull down menus, choose
\begin_inset Quotes eld
\end_inset
View -> Messages Pane
\begin_inset Quotes erd
\end_inset
.
The benefit of this is that every package's availability will be revealed.
\end_layout
\end_body
\end_document