PukiWiki contents have been moved into SONOTS Plugin (20070703)



Table of Contents


$$ $$



\pi &=& \left[
.4 \\
.3 \\
.2 \\
\right] \\
A &=& \left[
0.50 & 0.10 & 0.40 \\
0.00 & 0.70 & 0.30 \\
0.00 & 0.00 & 1.00 \\

括弧が左にしかいらない場合は \left[ \right. のようにドットを使う



lscape で紙を横向きにしたかんじになる。
tarticle で縦書きできる。

Tex インストール

Windows ネイティブなら MiKTex をいれればコンパイラ系と dvi ビューワがついてくる。 ps は gsview.


/usr/local/share/texmf/tex/latex/ 内に .cls をコピーすればスタイル使える。 /latex/ 内のどのディレクトリでもいい。





.bib 内でも使える。


\usepackage[colorlinks=true,linkcolor=red]{hyperref} % Hyperlink capabilities

This makes llinks for \ref{}, \cite{}, too.


emacs books.bib
C-c C-e C-a:学術論文
C-c C-e b :単行本
C-c C-e C-b:単行本の中の一章
C-c C-e C-i:学会や会議の発表論文
C-c C-e C-u:公刊されていない文献
C-c C-e i :単行本に収録されている独立した論文
C-c C-e P :博士論文
C-c C-e M :その他

必要な項目を記入し終わったら C-c C-c


latex、bibtex、latex、latex (prefix のみ指定)

複数 bib は



Ghostscript (PostScript Viewer) for Windows

Latex style


$ x $
$$ x $$
x \nonumber
\textbf{y} &=& x \\
z &=& x
           a x +  b y & = & p \\
     (a + b) x + ab y & = & q


    f(x) = 
         \begin{array}{c c l}
           x & = & rx'+sy' \\
           y & = & ts'+uy'



Start up






は $>$ と一時的に数式モードで出すのが一番楽かも


\Num & Error ratio for 1 & Error ratio for 2 \\
8 & 0.0880 & 0.1120  \\
12 & 0.0720 & 0.0560  \\
14 & 0.0240 & 0.0320  \\
16 & 0.0160 & 0.0080 \\

Image Table

    \begin{tabular}{@{} cc @{}}

          (a) ResampledSample1.wav
      \end{minipage}    &
          (b) ResampledSample2.wav
      \end{minipage}    \\
          (c) ResampledSample3.wav
      \end{minipage}    &
          (d) ResampledSample4.wav
      \end{minipage}    \\
          (e) ResampledSample5.wav
      \end{minipage}    &
      The magnitude frequency responses of the resampled input signals


  \caption{This is a pen}
Figure [\cite{pen}]

paper margin











If you want to put a figure exactly







a buncha





\setlength{\oddsidemargin}{ 20pt}
\setlength{\topmargin}{ 0pt}

\title {TITLE}
\author{Naotoshi Seo, sonots(at)}
\date{February 28, 2007}



a buncha


% This document has designed to be read through as a PDF first.
% Click on the ``Typeset'' button in the toolbar to generate the PDF
% if it is not already visible.

%%% PREAMBLE %%%
% You probably want to skip to \begin{document} if this is your first time.

% This command goes at the beginning of every document
% [oneside,article] are two of many options that can be chosen
%   oneside makes each page have the same layout, for printing on only one side 
%     of the paper (change it to twoside to see the difference)
%   article means we're writing a short document only and won't be using special 
%     chapter headings
%   a4paper changes the page dimensions for A4 sized paper 

%%% PACKAGES %%%

\usepackage{graphicx} % Add graphics capabilities
\usepackage{booktabs} % ``Proper'' table layout
\usepackage{amsmath}  % Better maths support
\usepackage[colorlinks=true,linkcolor=red]{hyperref} % Hyperlink capabilities

\usepackage{memhfixc} % This package is required to resolve incompatibilities
                      % with the memoir class & the hyperref package
% This package is used to tell TeXShop where things are in the PDF file.
% Command-click at any spot in the PDF and it will jump to the corresponding
% location in the source file.

%%% COMMANDS %%%

% These are two examples of how you can define your own commands.
% These two are used to save on typing.
\newcommand{\lshort}{\href{}{The Not So Short Introduction to \LaTeX{}}}

% Define the title, author and date of the document.
% If the date is undefined, the current date is substituted.
\title {\LaTeX\ on Mac OS X beginner's guide}
\author{Will Robertson}


% Generates a title based on the \title, \author, and \date commands in the preamble.


This is a simple example \LaTeX{} document written to very briefly introduce a new user to the main features of \LaTeX{} on Mac OS X. It will demonstrate the bare necessities of a basic document. It is designed to be first read as PDF; afterwards the new user should then read through the source code.
% \LaTeX{} is a command that typesets the word ``LaTeX'' in a special way.
% Unless you know what you're doing, the curly brackets are required even though it has no arguments.

The document \lshort{} should be used for technical help. The \href{}{Mac TeX} website should be used for further reference. The \href{}{\TeX{} FAQ} is invaluable --- if you have a question, it's almost definitely answered there.
% \lshort is a command defined by me in the preamble (see line 27) to print: 
% ``The Not So Short Introduction to LaTeX'' with a hyperlink to the document on the web.
% Sure saves on typing!
% \href{<link>}{<text>} is a command for inserting PDF hyperlinks (provided by hyperref)


\TeX{} is a program language for typesetting. \LaTeX{} is built upon \TeX{} and provides very high level access to the structure of your documents. You write plain text \LaTeX{} source files and feed them to the \LaTeX{} program, which outputs a beautifully typeset file\footnote{You may consider the chain analogous to programming (source code to compiler to binary application) or writing HTML (html file to browser to webpage).}. For new users, the most simple program for writing their \LaTeX{} documents (in Mac OS X) and typesetting them is TeXShop. Many people use more complex programs as they become more proficient, such as iTeXMac, Alpha, and Emacs.
% The \footnote command should be fairly self-explanatory.
The default on Mac OS X is to use a variant of \LaTeX{} called pdf\LaTeX{}, which means that the typeset output file is PDF. All this means for now is that in TeXShop, ``pdfTeX'' should be ticked in the Typeset menu.
% To quote in LaTeX, use backticks (`) for left quotation marks and straight quote (') for right quotation marks. Double them up (as above) to get ``66's and 99's''


If you are reading this document to learn about TeX on Mac OS X, then hopefully you're reading it in TeXShop. In the toolbar of the source window is a ``Templates'' menu; you should use this when constructing your document from scratch so you don't have to remember all of the commands.

When you typeset your document, \LaTeX{} creates a few other files in the same directory, for various purposes such as error reporting and information about the document. These files will have the same name as your document, but with extensions such as \texttt{.aux} and \texttt{.log}. It is safe to almost always ignore them.


This is going to be very brief. A \LaTeX{} document is built up of two main components: the \emph{preamble} at the beginning which sets up what features you are going to use in the document; and the \emph{body} where you write the content of your document. What you type into a \LaTeX{} document can be classified into two types: commands and text. A command is prefixed with a backslash and arguments are contained within curly braces; an example is \verb#\emph{emphasised text}# which, when typeset, looks like \emph{emphasised text}. Optional arguments in a command are surrounded with square brackets.
% \verb is a special command that prints out EXACTLY what's inside its delimiters.
% The delimiter itself can be a character that doesn't appear inside the argument (some characters are excluded). For example, \verb/hello/ is the same as \verb.hello. .

% \section{} is next down on the heirachy of document structure. Below this is \subsection and \subsubsection

The preamble is where you set up your file with various options. Most of the stuff in the preamble looks, for example, like \verb#\usepackage{graphicx}#. All this means in this case is that you are telling \LaTeX{} to use the \pkg{graphicx} package, which lets you insert pictures into your document.
% \pkg is a command I defined in the preamble (see line 39 - CMD+L in TeXShop) to style the text I use when referring to packages. If I ever want my packages to look differently (maybe bold instead, for example) all I need to do is change my initial definition.

For now it's okay to ignore the preamble and simply concentrate on getting words onto the page.


The body is the content of your document. Use structural commands like \verb|\chapter{Basics}| and \verb#\section{Preamble}# to organise your document, and commands like \verb~\emph{meaning}~ to convey the \emph{meaning} of the content. See \lshort{} for information regarding anything and everything that might possibly go in your document: ordered and unordered lists, footnotes, margin notes, quoting environments, code listings, headers,...
% Remember you can use almost any character for \verb delimiters

To customise the way \LaTeX{} actually displays your content (for example, changing the font of the section titles), read the \href{}{memoir class manual}. The first half of the document refers to actual typesetting technicalities and terminology; the actual \LaTeX{} stuff is in the second half.
% The \href command is used to create a hyperlink: the first argument is the file path and the second is the displayed name. In this case, the link points to a pdf file on the internet


If you use \LaTeX{} to write maths, then you want to use the \pkg{amsmath} package. \LaTeX{} can do maths by itself, but the \pkg{amsmath} package will do it better. Brief examples:

In matrix form $M\ddot X +D\dot X + KX = [0]$, where
% To typeset maths in a paragraph, surround it with dollar signs.

  K = \left[\,\begin{matrix}
    k_1+k_2 & -k_2 & 0\\
    -k_2 & k_2+k_3+k_4 & -k_3\\
    0 & -k_3 & k_3+k_4
% Use the equation environment to type single lines of maths

  m_1{\ddot x_1} & = -k_1x_1+k_2(x_2-x_1),\\
  m_2{\ddot x_2} & = -k_2(x_2-x_1)-k_4x_2+k_3(x_3-x_2),\\
  m_3{\ddot x_3} & = -k_3(x_3-x_2)-k_5x_3.
% Use the align environment as above to align multiple lines of maths

Maths is logical but there is a huge amount you can do with it. Probably Herbert Voss's \href{}{mathmode.pdf} gives the most complete introduction to the topic.


Using pdf\LaTeX{} gives us more flexibility with image formats. Any image format may be used, as long as it's one of PDF, JPG or PNG. If you are using regular \LaTeX{} (in this case, ``TeX and Ghostscript'' would be ticked in the Typeset menu in TeXShop) you would \emph{only} be able to use EPS files. A brief description of the file types:

% This is one of the list environments. Swap ``enumerate'' with ``itemize'' and see the difference...

\item{PDF graphics are used for vector diagrams---see Figure~\ref{fig:pdf} for an example;}
% \ref is a command that is used in conjuction with the \label command to reference objects in your document. It works out what the numbers are supposed to be when the document is compiled.

\item{PNG graphics are lossless raster images used for precise bitmap images---see Figure~\ref{fig:png} for an example.}

\item{JPG graphics are compressed bitmaps usually used for photos---see Figure~\ref{fig:jpg} for an example;}


% Notice that the figures in the document are not where they are specified in this file. That is because they are wrapped in the figure environment (  \begin{figure}...\end{figure}  ) which means that the figures ``float'' into the best position they can in the document.

  % The placing argument [hbtp] can have up to four specifications: this time we're saying we want the figure placed with the following preference: `h'ere first, if not then the `b'ottom of a page, if not again then the `t'op of a page, and if all else fails put it on a `p'age by itself with other floats with nowhere to go.

  \centering % This command centres the figure.
  % If you want to centre regular text, use the center environment (wrap your text with \begin{center}...\end{center} )
  % This is the command that places the image. [width=...] is optional {./fig/pdf-example} is the path to the image. The extension isn't required because LaTeX is clever.
  \caption{An example PDF diagram. It can be infinitely re-scaled without loss of quality while retaining a small file size (try it and see!).}

  % This is the all important \label command. Use it with \ref to refer to objects in your document and have LaTeX keep track of all the details for you.

See the document \href{}{Using imported graphics in \LaTeX{}} for more information. It refers only to EPS files, but the information it has is still accurate. It was written before pdf\TeX{} but the techniques it covers are still 100\% relevant.

  \caption{An example PNG image. Useful for bitmap pictures with exact output required.}

  % In this case we want this figure at the `t'op of a page, or on a `p'age by itself
  \caption{An example JPG picture. This format is good for photos because the compression is efficient but lossy.}
% It is sometimes tricky to get figures where you would like. The only way to get a feel for it all is to practice! Read the document below.


To typeset tables you really want the \pkg{booktabs} package. This package has been designed with the goal of book-quality output---the manual contains an excellent introduction on the technicalities of table layout. First and foremost is the mantra ``never use vertical lines in tables''. See Table~\ref{tab:booktabs} for an example, and \href{}{the \pkg{booktabs} manual} for full details.

  \begin{tabular}{ @{} lcr @{} }
    % lcr means to align the first column to the left, the second column to the centered, and the right column to the right.
    % The @{} are a shorthand way of telling booktabs to cut off the extra space around the table.
    \multicolumn{2}{c}{Item}             \\ % \\ means ``newline'', used to separate columns
    \cmidrule{1-2} % Draw a line from the first column to the second column
    Animal    & Description & Price (\$) \\
    % Ampersands (&) are used to separate rows.
    % Because the dollar sign is used for maths mode, if you want to use it in your text it must be _escaped_ by preceeding it with a backslash.
    Gnat            & per gram    & 13.65      \\
                    & each        &  0.01      \\
    Gnu             & stuffed     & 92.50      \\
    Emu             & stuffed     & 33.33      \\
    Armadillo       & frozen      &  8.99      \\
  \caption{An example table, adapted from the \pkg{booktabs} package}


There are many different text fonts that you may choose to use in \LaTeX{}. See the
\href{}{postscript font guide} for some of the details. Note that it is technically possible to convert \emph{any} font for use in \LaTeX{}---it can however be a laborious process. See Bruno Voisin's tutorial \href{}{Installing Fonts for \LaTeX\ on OS~X} (Definitely an advanced topic, only included here for completeness.)

% I should probably mention: the tilde character ~ is used as a space that is not ever broken across lines.