% Reference Card for AUCTeX version 12.1
%**start of header
\newcount\columnsperpage

% This file has only been checked with 3 columns per page.  But it
% should print fine either via DVI or PDFTeX.

\columnsperpage=3

% Papersize stuff.  Use default paper size for PDF, but switch
% orientation.  Use papersize special for dvips.

\ifx\pdfoutput\undefined
  \csname newcount\endcsname\pdfoutput
  \pdfoutput=0
\fi

\ifnum\pdfoutput=0
%    \special{papersize 8.5in,11in}%
     \special{papersize 297mm,210mm}%
\else
      \dimen0\pdfpagewidth
      \pdfpagewidth\pdfpageheight
      \pdfpageheight\dimen0
\fi


% This file is intended to be processed by plain TeX (TeX82).
% compile-command: "tex tex-ref" or "pdftex tex-ref"
%
% Original author of Auc-TeX Reference Card:
%
%       Terrence Brannon, PO Box 5027, Bethlehem, PA 18015 , USA
%  internet: tb06@pl118f.cc.lehigh.edu  (215) 758-1720 (215) 758-2104
%
% Kresten Krab Thorup updated the reference card to 6.
% Per Abrahamsen updated the reference card to 7, 8, and 9.
% Ralf Angeli updated it to 11.50.
% And David Kastrup messed around with it, too, merging the math reference.
%
% Thanks to Stephen Gildea
% Paul Rubin, Bob Chassell, Len Tower, and Richard Mlynarik
% for creating the GNU Emacs Reference Card from which this was mutated

\def\versionnumber{12.1}
\def\year{2017}
\def\version{December \year\ v\versionnumber}

\def\shortcopyrightnotice{\vskip 1ex plus 2 fill
  \centerline{\small \copyright\ \year\ Free Software Foundation, Inc.
  Permissions on back.  v\versionnumber}}

\def\copyrightnotice{%
\vskip 1ex plus 2 fill\begingroup\small
\centerline{Copyright \copyright\ 1987, 1992-1994, 2004-2006, 2008, 2010,}
\centerline{2012, 2014-2017 Free Software Foundation, Inc.}
\centerline{for AUC\TeX\ version \versionnumber}

Permission is granted to make and distribute copies of
this card provided the copyright notice and this permission notice
are preserved on all copies.


\endgroup}

% make \bye not \outer so that the \def\bye in the \else clause below
% can be scanned without complaint.
\def\bye{\par\vfill\supereject\end}

\newdimen\intercolumnskip
\newbox\columna
\newbox\columnb

\edef\ncolumns{\the\columnsperpage}

\message{[\ncolumns\space
  column\if 1\ncolumns\else s\fi\space per page]}

\def\scaledmag#1{ scaled \magstep #1}

% This multi-way format was designed by Stephen Gildea
% October 1986.
\if 1\ncolumns
  \hsize 4in
  \vsize 10in
  \voffset -.7in
  \font\titlefont=\fontname\tenbf \scaledmag3
  \font\headingfont=\fontname\tenbf \scaledmag2
  \font\smallfont=\fontname\sevenrm
  \font\smallsy=\fontname\sevensy

  \footline{\hss\folio}
  \def\makefootline{\baselineskip10pt\hsize6.5in\line{\the\footline}}
\else
  \hsize 3.2in
  \vsize 7.6in
  \hoffset -.75in
  \voffset -.8in
  \font\titlefont=cmbx10 \scaledmag2
  \font\headingfont=cmbx10 \scaledmag1
  \font\smallfont=cmr6
  \font\smallsy=cmsy6
  \font\eightrm=cmr8
  \font\eightbf=cmbx8
  \font\eightit=cmti8
  \font\eighttt=cmtt8
  \font\eightsl=cmsl8
  \font\eightsc=cmcsc8
  \font\eightsy=cmsy8
  \textfont0=\eightrm
  \textfont2=\eightsy
  \def\rm{\fam0 \eightrm}
  \def\bf{\eightbf}
  \def\it{\eightit}
  \def\tt{\eighttt}
  \def\sl{\eightsl}
  \def\sc{\eightsc}
  \normalbaselineskip=.8\normalbaselineskip
  \ht\strutbox.8\ht\strutbox
  \dp\strutbox.8\dp\strutbox
  \normallineskip=.8\normallineskip
  \normallineskiplimit=.8\normallineskiplimit
  \normalbaselines\rm           %make definitions take effect

  \if 2\ncolumns
    \let\maxcolumn=b
    \footline{\hss\rm\folio\hss}
    \def\makefootline{\vskip 2in \hsize=6.86in\line{\the\footline}}
  \else \if 3\ncolumns
    \let\maxcolumn=c
    \nopagenumbers
  \else
    \errhelp{You must set \columnsperpage equal to 1, 2, or 3.}
    \errmessage{Illegal number of columns per page}
  \fi\fi

  \intercolumnskip=.46in
  \def\abc{a}
  \output={%
      % This next line is useful when designing the layout.
      %\immediate\write16{Column \folio\abc\space starts with \firstmark}
      \if \maxcolumn\abc \multicolumnformat \global\def\abc{a}
      \else\if a\abc
        \global\setbox\columna\columnbox \global\def\abc{b}
        %% in case we never use \columnb (two-column mode)
        \global\setbox\columnb\hbox to -\intercolumnskip{}
      \else
        \global\setbox\columnb\columnbox \global\def\abc{c}\fi\fi}
  \def\multicolumnformat{\shipout\vbox{\makeheadline
      \hbox{\box\columna\hskip\intercolumnskip
        \box\columnb\hskip\intercolumnskip\columnbox}
      \makefootline}\advancepageno}
  \def\columnbox{\leftline{\pagebody}}

  \def\bye{\par\vfill\supereject
    \if a\abc \else\null\vfill\eject\fi
    \if a\abc \else\null\vfill\eject\fi
    \end}
\fi

% we won't be using math mode much, so redefine some of the characters
% we might want to talk about
\catcode`\^=12
\catcode`\_=12

\chardef\\=`\\
\chardef\{=`\{
\chardef\}=`\}

\hyphenation{mini-buf-fer}

\parindent 0pt
\parskip 1ex plus .5ex minus .5ex

\def\small{\smallfont\textfont2=\smallsy\baselineskip=.8\baselineskip}

\def\newcolumn{\vfill\eject}

\def\title#1{{\titlefont\centerline{#1}}\vskip 1ex plus .5ex}

\def\section#1{\par\vskip 0pt plus 0.2\vsize \penalty-3000
         \vskip 0pt plus -0.2\vsize
  \vskip 3ex plus 2ex minus 2ex {\headingfont #1}\mark{#1}%
  \vskip 2ex plus 1ex minus 1.5ex}

\newdimen\keyindent

\def\beginindentedkeys{\keyindent=1em}
\def\endindentedkeys{\keyindent=0em}
\endindentedkeys

\def\paralign{\vskip\parskip\halign}

\def\<#1>{$\langle${\rm #1}$\rangle$}

\def\kbd#1{{\tt#1}\null}        %\null so not an abbrev even if period follows

\def\beginexample{\par\leavevmode\begingroup
  \obeylines\obeyspaces\parskip0pt\tt}
{\obeyspaces\global\let =\ }
\def\endexample{\endgroup}

\def\key#1#2{\leavevmode\hbox to \hsize{\vtop
  {\hsize=.68\hsize\rightskip=1em
  \hskip\keyindent\relax#1}\kbd{#2}\hfil}}

\newbox\metaxbox
\setbox\metaxbox\hbox{\kbd{M-x }}
\newdimen\metaxwidth
\metaxwidth=\wd\metaxbox

\def\metax#1#2{\leavevmode\hbox to \hsize{\hbox to .75\hsize
  {\hskip\keyindent\relax#1\hfil}%
  \hskip -\metaxwidth minus 1fil
  \kbd{#2}\hfil}}

\def\threecol#1#2#3{\hskip\keyindent\relax#1\hfil&\kbd{#2}\quad
  &\kbd{#3}\quad\cr}

\def\LaTeX{%
    L\kern-.36em\raise.3ex\hbox{\sc{a}}\kern-.15em\TeX}

%**end of header

\title{AUC\TeX\ Reference Card}

\centerline{(for version \versionnumber)}

\section{Conventions Used}

\key{Carriage Return or \kbd{C-m}}{RET}
\key{Tabular or \kbd{C-i}}{TAB}
\key{Linefeed or \kbd{C-j}}{LFD}

\section{Shell Interaction}

\key{Run a command on the master file}{C-c C-c}
\key{Run a command on the buffer}{C-c C-b}
\key{Run a command on the region}{C-c C-r}
\key{Fix the region}{C-c C-t C-r}
\key{Kill job}{C-c C-k}
\key{Recenter output buffer}{C-c C-l}
\key{Next error in \TeX/\LaTeX\ session}{C-c `}
\key{Previous error in \TeX/\LaTeX\ session}{M-g p}
\key{Toggle debug of bad boxes}{C-c C-t C-b}
\key{Toggle debug of warnings}{C-c C-t C-w}
\key{View output file}{C-c C-v}
\key{Compile all and view output file}{C-c C-a}

Commands you can run on the master file (with \kbd{C-c C-c}) or the
region (with \kbd{C-c C-r}) include the following (starred versions
are not available in all modes):

\def\star{\llap{\rm*}}
\key{\TeX}{\star TeX}
\key{\LaTeX}{\star LaTeX}
\key{Con\TeX{}t (once)}{\star ConTeXt}
\key{Con\TeX{}t Full}{\star ConTeXt Full}
\key{Makeinfo}{\star Makeinfo}
\key{Makeinfo with HTML output}{\star Makeinfo HTML}
\key{Appropriate previewer}{View}
\key{Print the output}{Print}
\key{Bib\TeX}{BibTeX}
\key{Biber}{Biber}
\key{MakeIndex}{Index}
\key{LaCheck}{Check}
\key{Make (PostScript) File}{File}
\key{Ispell}{Spell}
\key{Delete intermediate files}{Clean}
\key{Delete all output files}{Clean All}

\section{\TeX ing options}
\TeX\ runs can come in various types, which may be toggled and are
indicated in the mode line.

\key{PDF/DVI mode}{C-c C-t C-p}
\key{Stop on errors (Interactive mode)}{C-c C-t C-i}
\key{I/O correlation (S. Specials, Sync\TeX)}{C-c C-t C-s}

\section{Miscellaneous}

\key{Read AUC\TeX\ manual}{C-c TAB}
\key{Find documentation}{C-c ?}
\key{Math Mode}{C-c \string~}
\key{Reset Buffer}{C-c C-n}
\key{Reset AUC\TeX}{C-u C-c C-n}

\section{Multifile Handling}

\key{Save Document}{C-c C-d}
\key{Switch to master file or active buffer}{C-c ^}
\key{Query for a master file}{C-c \_}

\section{Command Insertion}

\key{Insert Section}{C-c C-s}
\key{Insert \LaTeX\ environment}{C-c C-e}
\key{Insert item}{C-c LFD}
\key{Insert item (alias)}{M-RET}
\key{Close \LaTeX\ environment}{C-c ]}
\key{Insert \TeX\ macro \kbd{\{\}} }{C-c C-m}
\key{Insert double brace}{C-c \{}
\key{Complete \TeX\ macro}{M-TAB}
\key{Smart ``quote''}{"}
\key{Smart ``dollar''}{\$}

\section{Font Selection}

\key{Insert {\bf bold\/} text}{C-c C-f C-b}
\key{Insert {\it italics\/} text}{C-c C-f C-i}
\key{Insert {\rm roman} text}{C-c C-f C-r}
\key{Insert {\it emphasized\/} text}{C-c C-f C-e}
\key{Insert {\tt typewriter\/} text}{C-c C-f C-t}
\key{Insert {\sl slanted\/} text}{C-c C-f C-s}
\key{Insert {\sc Small Caps\/} text}{C-c C-f C-c}
\key{Delete font}{C-c C-f C-d}
\key{Replace font}{C-u C-c C-f \<key>}

\section{Source Formatting}

\key{Indent current line}{TAB}
\key{Indent next line}{LFD}

\key{Format a paragraph}{M-q}
\key{Format a region}{C-c C-q C-r}
\key{Format a section}{C-c C-q C-s}
\key{Format an environment}{C-c C-q C-e}

\key{Mark an environment}{C-c .}
\key{Mark a section}{C-c *}

\key{Comment or uncomment region}{C-c ;}
\key{Comment or uncomment paragraph}{C-c \%}

\copyrightnotice

\newcolumn

\title{Math Mode}

\section{Variables}

All math mode commands are under the prefix key specified by
LaTeX-math-abbrev-prefix, default is "`".

You can define your own math mode commands by setting the variable
LaTeX-math-list before loading LaTeX-math-mode.

\section{Greek Letters}

\def\disp#1{\hbox to 6ex{$#1$\hfill}}
\def\twocol#1\par{{%
  \def\key##1##2{##1&##2\cr}%
  \setbox0\vbox{\halign to 0.45\hsize{\tabskip0ptplus1fil\relax
    ##\hfil&\kbd{##}\hfil\cr\vrule width0ptheight\ht\strutbox#1}}%
  \line{%
  \splittopskip=\ht\strutbox
  \dimen0\ht0
  \advance\dimen0\baselineskip
  \setbox2\vsplit0to0.5\dimen0
  \vtop{\unvbox2}\hfill\raise \ht\strutbox \vtop {\unvbox0}}}}
\def\keycs#1#2#{\keycsii#1{#2}}
\def\keycsii#1#2#3{\key{\disp{#1#2} ({\tt\string#1})}{#3}}

\twocol
\keycs\alpha{a}
\keycs\beta{b}
\keycs\gamma{g}
\keycs\delta{d}
\keycs\epsilon{e}
\keycs\zeta{z}
\keycs\eta{h}
\keycs\theta{j}
\keycs\kappa{k}
\keycs\lambda{l}
\keycs\mu{m}
\keycs\nu{n}
\keycs\xi{x}
\keycs\pi{p}
\keycs\rho{r}
\keycs\sigma{s}
\keycs\tau{t}
\keycs\upsilon{u}
\keycs\phi{f}
\keycs\chi{q}
\keycs\psi{y}
\keycs\omega{w}
\keycs\Delta{D}
\keycs\Gamma{G}
\keycs\Theta{J}
\keycs\Lambda{L}
\keycs\Xi{X}
\keycs\Pi{P}
\keycs\Sigma{S}
\keycs\Upsilon{U}
\keycs\Phi{F}
\keycs\Psi{Y}
\keycs\Omega{W}

\section{Symbols}

\twocol
\keycs\rightarrow{C-f}
\keycs\leftarrow{C-b}
\keycs\uparrow{C-p}
\keycs\downarrow{C-n}
\keycs\leq{<}
\keycs\geq{>}
\keycs\tilde x{\string~}
\keycs\hat x{^}
\keycs\nabla{N}
\keycs\infty{I}
\keycs\forall{A}
\keycs\exists{E}
\keycs\not \ {/}
\keycs\in{i}
\keycs\times{*}
\keycs\cdot{.}
\keycs\colon{:}
\keycs\subset{\{}
\keycs\supset{\}}
\keycs\subseteq{[}
\keycs\supseteq{]}
\keycs\emptyset{0}
\keycs\setminus{\\}
\keycs\cup{+}
\keycs\cap{-}
\keycs\langle{(}
\keycs\rangle{)}
\keycs\exp{C-e}
\keycs\sin{C-s}
\keycs\cos{C-c}
\keycs\sup{C-^}
\keycs\inf{C-_}
\keycs\det{C-d}
\keycs\lim{C-l}
\keycs\tan{C-t}
\keycs\vee{|}
\keycs\wedge{\&}

\section{Miscellaneous}

\key{cal letters}{c \<letter>}

\newcolumn

\def\previewlatex{{preview-latex}}
\title{\previewlatex}
\section{Activation}
\previewlatex\ is part of AUC\TeX.  If it is active, you should see an
entry ``Preview'' in the menu bar when editing \LaTeX{} files.  If you
have a ``LaTeX'', but no ``Preview'' menu, add the following to your
{\tt .emacs} file:
\beginexample
(load "preview-latex.el" nil t t)
\endexample

\section{Usage and keybindings}
\previewlatex\ operation only affects the display of the buffer, not
its contents.  It runs only on demand, using the target {\sc dvi} or
{\sc PDF} files in the process.  The first command in the following
list (also on the toolbar button) will (as applicable) repreview an
active region or a single modified preview, toggle the visibility of
an unmodified preview or generate previews for a surrounding buffer
area up to the next preview.

\key{Preview at point}{C-c C-p C-p}
\key{Preview environment}{C-c C-p C-e}
\key{Preview region}{C-c C-p C-r}
\key{Preview buffer}{C-c C-p C-b}
\key{Preview document}{C-c C-p C-d}
\key{Remove previews at point}{C-c C-p C-c C-p}
\key{Remove previews from region}{C-c C-p C-c C-r}
\key{Remove previews from buffer}{C-c C-p C-c C-b}
\key{Remove previews from document}{C-c C-p C-c C-d}
\key{Cache preamble}{C-c C-p C-f}
\key{Switch off preamble cache}{C-c C-p C-c C-f}
\key{Read Texinfo manual}{C-c C-p TAB}
\key{Copy region as MML}{C-c C-p C-w}

The last keysequence will copy a region with previews into the kill
buffer in a form fit for sending in Emacs' message-mode.

\section{Customization within Emacs}

You can use \kbd{M-x customize-variable RET} or the ``Preview\slash
Customize'' menu for customization.  Worthwhile settings:

\halign to \hsize{\tabskip=1ptplus1fil\relax#\hfil&\hfil\kbd{#}\tabskip0pt\cr
\noalign{\medskip If you have dvipng available:}
Set to \kbd{dvipng}&preview-image-type\cr
\noalign{\medskip \vbox{Keep counter values when regenerating
  single previews:}}
Set to \kbd{t}&preview-preserve-counters\cr
\noalign{\medskip \vbox{Cache/Don't cache preamble without query
(preamble caching is done using {\tt mylatex.ltx} and might not always
work.  Use the appropriate key sequences for overriding the following
setting):}}
Set to \kbd{t}/\kbd{nil}&preview-auto-cache-preamble\cr}

\section{Customization from \LaTeX{}}
Customization is done in the document preamble (you need to load {\tt
preview.sty} explicitly) or in {\tt prauctex.cfg} (which should load
the system {prauctex.cfg} first).  Commands:

\halign to \hsize{\tabskip=1ptplus1fil\relax#\hfil&\hfil\kbd{#}\tabskip0pt\cr
Preview macro&\string\PreviewMacro[\{\<args>\}]\{\<macro>\}\cr
Preview env&\string\PreviewEnvironment[\{\<args>\}]\{\<env>\}\cr
Skip macro&\string\PreviewMacro*[\{\<args>\}]\{\<macro>\}\cr
Skip env&\string\PreviewEnvironment*[\{\<args>\}]\{\<env>\}\cr
\noalign{\smallskip Diverting material from float environments}
Snarf stuff&\string\PreviewSnarfEnvironment[\{\<args>\}]\{\<env>\}\cr
}

Values to be used within \<args>:
\halign to
\hsize{\tabskip=1ptplus1fil\relax#\hfil&\hfil\kbd{#}\tabskip0pt\cr
Optional argument&[]\cr
Mandatory argument&\{\}\cr
Optional star&*\cr
Conditionals&?\<token>\{\<if found>\}\{\<if not found>\}\cr
Skip next token&-\cr
Transformation&\#\{\<macro args>\}\{\<replacement>\}\cr
}

More options and explanations can be found in {\tt preview.dvi} or the
Texinfo manual.

\vskip 5ex plus 6ex minus 1ex

\title{Folding Source Display}

\key{Toggle folding mode}{C-c C-o C-f}
\key{Hide all items in buffer}{C-c C-o C-b}
\key{Hide all items in region}{C-c C-o C-r}
\key{Hide all items in paragraph}{C-c C-o C-p}
\key{Hide current macro}{C-c C-o C-m}
\key{Hide current environment}{C-c C-o C-e}
\key{Show all items in buffer}{C-c C-o b}
\key{Show all items in region}{C-c C-o r}
\key{Show all items in paragraph}{C-c C-o p}
\key{Show current item}{C-c C-o i}
\key{Hide or show current item}{C-c C-o C-o}

\vskip 5ex plus 6ex minus 1ex

\title{Outlining \TeX\ Documents}

AUC\TeX\ supports outline mode by defining section, subsection,
etc. as heading levels. You can use \kbd{M-x outline-minor-mode RET}
to toggle outline minor mode. All outline minor mode commands are
under the prefix key specified by outline-minor-mode-prefix, default
is ``C-c @''.

\key{Hide all of buffer except headings}{C-c @ C-t}
\key{Show all text in buffer}{C-c @ C-a}
\key{Hide body following this heading}{C-c @ C-c}
\key{Show body following this heading}{C-c @ C-e}
\key{Hide subtree}{C-c @ C-d}
\key{Show subtree}{C-c @ C-s}
\key{All subheadings visible}{C-c @ C-k}

\key{next visible heading}{C-c @ C-n}
\key{previous visible heading}{C-c @ C-p}
\key{forward to next subheading}{C-c @ C-f}
\key{backward to next subheading}{C-c @ C-b}
\key{up one heading level}{C-c @ C-u}

\newcolumn

\iftrue % RefTeX long version

\title{RefTeX}

\section{Activation}

RefTeX is part of [X]Emacs.  To activate and make it interact with
AUCTeX, insert the following lines in .emacs.
\vskip-3mm
\beginexample
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
(setq reftex-plug-into-AUCTeX t)
\endexample

\section{Table of Contents}
The table of contents is a structured view of the entire document.  It
contains the sections, and optionally labels, index entries, and file
boundaries.

\key{Show the table of contents$\sp1$}{C-c =}
\key{Recenter *toc* buffer to here$\sp1$}{C-c -}

\section{Crossreferences, Citations, Index}

\key{Insert unique label$\sp1$}{C-c (}
\key{Reference a label$\sp1$}{C-c )}
\key{Insert citation with key selection}{C-c [}
\key{\dots\ prompt for optional arguments}{C-u C-c [}
\key{Index  word at point with default macro}{C-c /}
\key{Insert an index entry}{C-c <}
\key{Add word to index phrases}{C-c \\}
\key{Visit index phrases buffer}{C-c |}
\key{Compile and display index}{C-c >}
\key{View cross reference$\sp1$}{C-c \&}
\key{View cross reference with mouse}{S-mouse-2}
\key{View cross reference from BibTeX file}{C-c \&}

\section{Standard keys in special buffers}
RefTeX's special buffers have many active keys.  The common ones are:

\key{Display summary of active keys}{?}
\key{Select this item}{RET}
\key{Rescan the document}{r}
\key{Display location in other window}{SPC}
\key{Follow mode}{f}

\section{Multifile actions}
Since RefTeX scans the entire (multifile) document, it can provide
commands that act on all files of a document.  Check the {\tt
Ref->Global Actions} menu for these commands.

\section{Variables}

To tell reftex about your own macro definitions, customize the
variables
\vskip-3mm
\beginexample
reftex-label-alist
reftex-section-levels
reftex-index-macros
reftex-cite-format
\endexample

\vskip2mm\hrule
$\sp1$ An argument of \kbd{C-u} triggers a document scan first.  This can
be necessary if file content and RefTeX's knowledge are no longer
consistent.

\else % RefTeX compact version

\csname title\endcsname{RefTeX}

\section{Activation in .emacs}

\vskip-4mm
\beginexample
(add-hook 'LaTeX-mode-hook 'turn-on-reftex)
(setq reftex-plug-into-auctex t)
\endexample

\section{Table of Contents}

\key{Show the table of contents$\sp1$}{C-c =}
\key{Recenter *toc* buffer to here$\sp1$}{C-c -}

\section{Crossreferences, Citations, Index}

\key{Insert unique label$\sp1$}{C-c (}
\key{Reference a label$\sp1$}{C-c )}
\key{Insert citation with key selection}{C-c [}
\key{... prompt for optional arguments}{C-u C-c [}
\key{Index  word at point with default macro}{C-c /}
\key{Insert an index entry}{C-c <}
\key{Add word to index phrases}{C-c \\}
\key{Visit index phrases buffer}{C-c |}
\key{Compile and display index}{C-c >}
\key{View cross reference$\sp1$}{C-c \&}
\key{View cross reference with mouse}{S-mouse-2}
\key{View cross reference from BibTeX file}{C-c \&}

\vskip2mm\hrule
$\sp1$ An argument of \kbd{C-u} triggers a document scan first.

\fi

\bye

%%% Local Variables:
%%% mode: plain-TeX
%%% TeX-master: t
%%% End:
