% ------------------------------------------------------------------------
% LaTeX Demo:
% ===========
%
%  Graphics Inclusion
%  Color Package Example
%  TeX and International Characters
%  Translation Tables
%  Rotated tables examples
%  Useful TeX-ing Hints
%
% ------------------------------------------------------------------------
% PDFLaTeX this document and view or print it from Acrobat Reader!
% ------------------------------------------------------------------------
% Preamble Starts here:
% ------------------------------------------------------------------------

\documentclass[reqno]{article}
\usepackage{ae} % or {zefonts}
\usepackage[T1]{fontenc}
\usepackage[ansinew]{inputenc}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{graphicx}
\usepackage{color}
\usepackage[colorlinks]{hyperref}

% WinEdt's Bullets ----------------------------------
% Allow WinEdt's Bullets (placeholders) in TeX Files!
% The bullets (eg. in automatically generated tables)
% should be replaced by actual data. In WinEdt you can
% use Ctrl+Space (Tools Menu -> Next Bullet) to navigate
% through bullets and replace them with "real" entries...
\catcode`\=13
\def{$\bowtie$}

% EURO ---------------------------------------
%\usepackage{textcomp} %\texteuro: poor design
%
% Get it from CTAN if it is not included in your TEX distribution
%\usepackage{europs}
%\DeclareInputText{128}{\EUR} % ANSI code for euro: €
%     \EURhv     selects EuroSans
%     \EURtm     selects EuroSerif
%     \EURcr     selects EuroMono
%     \EUR       selects one of the three above, depending on the current
%                context
%
%     \EURofc    selects EuroSans Regular independent of context
%                N.B.: This is the only "official" Euro symbol. If you
%                      want to conform with the rules of the EU (or
%                      whoever), you may only use this symbol.
%
% HINT: Use MiKTeX's Package Manger to install eurosym package!
\usepackage{eurosym}
\DeclareInputText{128}{\euro} % ANSI code for euro: € \usepackage{eurosym}
\DeclareInputText{165}{\yen}  % ANSI code for yen:  ¥ \usepackage{amssymb}

\usepackage{lscape} %landcape pages support
% Your previewer may not support rotated boxes...
% Rotated boxes are properly displayed in GSView
% and in Adobe's Acrobat Reader

% ------------------------------------------------------------------------
% Document Starts here:
% ------------------------------------------------------------------------

\begin{document}

\section{Graphics Inclusion}

\emph{Graphic inclusion in TeX Documents is not a WinEdt-related
issue. You should consult the documentation that comes with your
TeX System (eg. graphicx package). Below are a few examples that
show that it can be done! It works with my (default) version of
MiKTeX 2.3 and Ghostscript 8.00. However, these examples come with
no guarantee and no support from The WinEdt Team...}

\bigskip

\noindent\textbf{Example 1:} WinEdt.eps (27 KB) (jpeg2eps
wrapper). Bitmap graphics does not scale well. Quality is further
reduced when jpeg file is formatted in order to reduce its size.

\medskip

\noindent\emph{PDFLaTeX uses a WinEdt.png (6 KB) when present. It
gives superior result compared to dvi2pdf or ps2pdf which (when
properly configured) use Ghostscript to convert eps images to pdf
during the compilation.}

\begin{center}
  \includegraphics[width=2.5583in]{WinEdt}\\
\end{center}

\noindent \emph{Preparing two sets of graphic files (eps for dvi
and ps formats and pdf, png or jpg for pdf files) makes PDF
TeX-ing easier!}

\bigskip

\noindent \textbf{Example 2 (next page):}

\bigskip

\noindent The examples on the next page are based on a ``proper''
eps file \texttt{golpher.eps} (a sample that comes with
Ghostscript). The second instance \texttt{golpher1.eps} represents
the same wrapped image (jpeg2eps) after jpg was compressed to a
size (almost) comparable with the size of the original eps file.
PDFLaTeX uses png and jpg versions of images. You can compare the
quality (vector vs. bitmap graphics) depending on your favorite
method of compiling pdf files...

\medskip

\begin{verbatim}
    golfer.eps     (27 KB)
    golfer.png     (10 KB)
    golfer1.eps    (48 KB)
    golfer1.jpg    (37 KB)
\end{verbatim}

\newpage

\begin{center}
  \includegraphics[width=3in]{golfer}\\
\end{center}

\begin{center}
  \includegraphics[width=3in]{golfer1}\\
\end{center}

\newpage

% ----------------------------------------------------------------------

\section{Color Package Example}

\emph{This section is ``borrowed'' from MiKTeX's Samples folder.
You should definitely consult more documentation and examples that
come with your TeX System...}

\bigskip

{\color{green} Text starts off in green \textcolor{red}{ a little
red} {\color{blue}nested blue text} returning to green}

\begin{enumerate}
\item \textcolor[cmyk]
   {0,1,0,0}{magenta cmyk}  black
\item \color[gray]{0.5}
  \textcolor{blue}{predefined blue}
   gray text
\end{enumerate}

\definecolor{Light}{gray}{.80}
\definecolor{Dark}{gray}{.20}
\colorbox{red}{Black text on red background}
\par\colorbox{Light}{%
  \textcolor{Dark}{Light background}}
\par\colorbox{Dark}{%
  \textcolor{white}{Dark background}}

\fcolorbox{red}{blue}{Black text,
      blue background, red frame}

\fcolorbox{red}{blue}{\color{white}%
  White text, blue background, red frame}

\bigskip

\bigskip

\noindent \emph{This is how it is done:}

\medskip

\begin{verbatim}
  \usepackage{color}

    ...

      \begin{enumerate}
      \item \textcolor[cmyk]
         {0,1,0,0}{magenta cmyk}  black
      \item \color[gray]{0.5}
        \textcolor{blue}{predefined blue}
         gray text
      \end{enumerate}

      \definecolor{Light}{gray}{.80}
      \definecolor{Dark}{gray}{.20}
      \colorbox{red}{Black text on red background}
      \par\colorbox{Light}{%
        \textcolor{Dark}{Light background}}
      \par\colorbox{Dark}{%
        \textcolor{white}{Dark background}}

      \fcolorbox{red}{blue}{Black text,
            blue background, red frame}

      \fcolorbox{red}{blue}{\color{white}%
        White text, blue background, red frame}
\end{verbatim}

\newpage

% ----------------------------------------------------------------------

\section{TeX and International Characters}

Putting
\begin{verbatim}
  \usepackage{ae} % or {zefonts}
  \usepackage[T1]{fontenc}
  \usepackage[ansinew]{inputenc}
\end{verbatim}
enables you to use standard Windows 8-bit international characters
(Western Script). You see the same characters in WinEdt as in your
compiled document:

\bigskip

 \noindent \texttt{À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ñ Ò Ó Ô Õ Ö Ø Œ Ù Ú Û Ü Ý Ÿ Š ß ¡}

 \noindent \texttt{à á â ã ä å æ ç è é ê ë ì í î ï ñ ò ó ô õ ö ø œ ù ú û ü ý ÿ š € ¿}

 \noindent \texttt{}

\bigskip

 \noindent {À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ñ Ò Ó Ô Õ Ö Ø Œ Ù Ú Û Ü Ý Ÿ Š ß ¡}

 \noindent {à á â ã ä å æ ç è é ê ë ì í î ï ñ ò ó ô õ ö ø œ ù ú û ü ý ÿ š € ¿}

 \noindent {†‡§¶©®}

\bigskip

\emph{T1-encoding will use the ec-fonts which are Type 3 fonts.
These are rendered badly on screen (but print OK). That's why in
the preamble one should load the package ae which uses T1 encoding
\emph{and} Type 1 fonts. Package ae is shipped with MiKTeX and
fpTeX.}
\bigskip

\noindent For more see:

\medskip

\url{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=type1T1}

\bigskip

\noindent For more Euro (€) related-issues visit:

\medskip

\url{http://www.tex.ac.uk/cgi-bin/texfaq2html?label=euro}

\bigskip

{\color{red} \emph{Note that these are not really WinEdt-related
issues. It is up to your TeX System to properly encode and
interpret characters and generate the required fonts.}}

\bigskip

\noindent Our preamble contains:

\begin{verbatim}
  \catcode`\=13
  \def{$\bowtie$}
\end{verbatim}

\noindent This allows \TeX\ to process an ``empty'' Tabular
Environment from WinEdt's Insert Menu. Bullets are represented by
:

\begin{center}
  \begin{tabular}{|c|c|c|c|c|}
    \hline
    % after \\: \hline or \cline{col1-col2} \cline{col3-col4} ...
     &  &  &  &  \\
    \hline
     &  &  &  &  \\
     &  &  &  &  \\
     &  &  &  &  \\
    \hline
  \end{tabular}
\end{center}

\noindent \emph{In WinEdt you can use Ctrl+Space (Tools: Next
Bullet) to move through placeholders and fill-in the actual data.}

\newpage

% ----------------------------------------------------------------------

\section{Translation Tables}

If you prefer your documents to contain plain \TeX\ notation for
international characters (eg. \verb"\`{A}" stands for \texttt{À})
then you should consider applying WinEdt's Read and Write
translation tables. This will make working with WinEdt more
comfortable and it is required if you want to take advantage of
WinEdt's Spell-checking ability with international dictionaries.

\medskip

\emph{WinEdt can convert certain strings into their ANSI
equivalents when the file is being read and then translate these
characters back to the original strings representing international
characters in \TeX\ notation.}

\medskip

Suitable translation tables for \TeX\ mode are already defined
(but not enabled) in the default settings: see Options/ Settings/
Translations Dialog. The help in this dialog provides the details.

\bigskip

For example, the default \verb"TeX_Read" and \verb"TeX_Write"
translation table contain definitions like:

\begin{verbatim}
          "{\ss}" -> "ß"               "ß" -> "{\ss}"
          "{\AA}" -> "Å"               "Å" -> "{\AA}"
          "{\AE}" -> "Æ"               "Æ" -> "{\AE}"
          "{\aa}" -> "å"               "å" -> "{\aa}"
          "{\ae}" -> "æ"               "æ" -> "{\ae}"
          "{\OE}" -> "Œ"               "Œ" -> "{\OE}"
          "{\oe}" -> "œ"               "œ" -> "{\oe}"
          "{\O}" -> "Ø"                "Ø" -> "{\O}"
          "{\o}" -> "ø"                "ø" -> "{\o}"
          "\c{C}" -> "Ç"               "Ç" -> "\c{C}"
          "\c{c}" -> "ç"               "ç" -> "\c{c}"
          "\^{A}" -> "Â"               "Â" -> "\^{A}"
          "\~{A}" -> "Ã"               "Ã" -> "\~{A}"
          "\""{A}" -> "Ä"              "Ä" -> "\""{A}"

          etc...

\end{verbatim}

\emph{Note that the last item is not a ``typo''! To specify double
quotes inside a double-quoted string they have to be repeated
twice! Failing to observe this convention may completely corrupt
WinEdt's translation table.}

\bigskip

The read translation table supports two notations (eg.
\verb"\^{A}" and \verb"{\^A}"). The write translation table
\verb"TeX_Write" is the inverse of the Read Translation Table
(except that it uses the first, preferable, notation where
applicable). You should use translation tables with some care:
make a backup copy of your documents until you verify that the
tables are set up correctly. Careless application of translation
tables may irreversibly corrupt your documents (just like a global
replace)!!!

\newpage

% ----------------------------------------------------------------------

\section{Rotated tables examples}

These are rotated tables (they may not be properly displayed in a
DVI Viewer such as YAP or WinDvi - \emph{GSView and Acrobat Reader
display them correctly}):

\bigskip

\begin{center}

\rotatebox{0}{
\begin{tabular}{|c|c|c|c|c|c|}
  % after \\: \hline or \cline{col1-col2} \cline{col3-col4} ...
  xx & yy & zz & a & b & c \\
  xx & yy & zz & a & b & c \\
  xx & yy & zz & a & b & c \\
\end{tabular}
}

\bigskip

\rotatebox{30}{
\begin{tabular}{|c|c|c|c|c|c|}
  % after \\: \hline or \cline{col1-col2} \cline{col3-col4} ...
  xx & yy & zz & a & b & c \\
  xx & yy & zz & a & b & c \\
  xx & yy & zz & a & b & c \\
\end{tabular}
}

\bigskip

\rotatebox{45}{
\begin{tabular}{|c|c|c|c|c|c|}
  % after \\: \hline or \cline{col1-col2} \cline{col3-col4} ...
  xx & yy & zz & a & b & c \\
  xx & yy & zz & a & b & c \\
  xx & yy & zz & a & b & c \\
\end{tabular}
}

\bigskip

\rotatebox{90}{
\begin{tabular}{|c|c|c|c|c|c|}
  % after \\: \hline or \cline{col1-col2} \cline{col3-col4} ...
  xx & yy & zz & a & b & c \\
  xx & yy & zz & a & b & c \\
  xx & yy & zz & a & b & c \\
\end{tabular}
}

\bigskip

\rotatebox{180}{
\begin{tabular}{|c|c|c|c|c|c|}
  % after \\: \hline or \cline{col1-col2} \cline{col3-col4} ...
  xx & yy & zz & a & b & c \\
  xx & yy & zz & a & b & c \\
  xx & yy & zz & a & b & c \\
\end{tabular}
}

\end{center}

% ----------------------------------------------------------------------

\newpage

\landscape

\begin{center}

\textbf{\large This page is displayed in landscape mode...}

\vskip 1cm

\begin{tabular}{|c|c|c|c|c|c|}
  % after \\: \hline or \cline{col1-col2} \cline{col3-col4} ...
  xx & yy & zz & a & b & c \\
  xx & yy & zz & a & b & c \\
  xx & yy & zz & a & b & c \\
  xx & yy & zz & a & b & c \\
  xx & yy & zz & a & b & c \\
  xx & yy & zz & a & b & c \\
  xx & yy & zz & a & b & c \\
  xx & yy & zz & a & b & c \\
  xx & yy & zz & a & b & c \\
  xx & yy & zz & a & b & c \\
  xx & yy & zz & a & b & c \\
\end{tabular}

\vskip 2cm

\emph{\textbf{Rotated Table}}

\end{center}

\endlandscape

\newpage

% ----------------------------------------------------------------------

\section{Useful \TeX\-ing Hints}


\noindent \emph{Check the source code of this document in WinEdt.
Pay attention to comments included in the preamble...}

\bigskip

\noindent For author-year references use:

\begin{verbatim}
    \usepackage{natbib}
\end{verbatim}

\bigskip

\noindent Specify bibliography database in a different folder:

\begin{verbatim}
    \bibliography{Biblio/articles.bib}
\end{verbatim}

Note that you have to specify the path in UNIX-style (using
forward instead of backward slash as folder separator). Avoid
spaces in filenames (some TeX accessories may not work properly
with spaces in filename specification).

\emph{Most TeX Systems allow you to place your bib files in a
separate folder on your localtexmf tree. For details consult the
documentation that comes with your TeX System. MiKTeX Users can
create a bibtex folder in their local texmf tree, place their bib
files there, and refresh the FNDB in MiKTeX's Options Interface.}

\bigskip

\noindent For fancy pdf files Use:

\begin{verbatim}
    \usepackage{hyperref}
    \hypersetup{
       pdftitle={Shown in AR File Information},
       pdfstartview=FitH,   % Fit the page horizontally
       bookmarks=true,      % Open Bookmarks in AR
    }
    % more options can be found in
    % TEXMF/doc/latex/hyperref/manual.pdf
\end{verbatim}

\bigskip

\noindent To manually correct hyphenation of a word that was not
properly handled by TeX (eg. Weltauffassung) put the following in
the preamble:

\begin{verbatim}
    \hyphenation{Welt-auf-fas-sung}
\end{verbatim}

\bigskip

\noindent To prevent long titles in your Table of Contents
(generated by \LaTeX) use alternative Short Title:

\begin{verbatim}
    \section[Short Title for TOC]{Long long long title}
\end{verbatim}

\bigskip

\noindent \emph{You can find everything about \TeX\ and \LaTeX\
on:} \url{http://www.tug.org}...

\end{document}
