Auctex pdf mode




















To make sure that everyone has such rights, we have to forbid you to deprive anyone else of these rights. For example, if you distribute copies of parts of AUCTeX, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. Also, for our own protection, we must make certain that everyone finds out that there is no warranty for AUCTeX.

If any parts are modified by someone else and passed on, we want their recipients to know that what they have is not what we distributed, so that any problems introduced by others will not reflect on our reputation. The precise conditions of the licenses for the files currently being distributed as part of AUCTeX are found in the General Public Licenses that accompany them.

It supports you in the insertion of macros, environments, and sectioning commands by providing completion alternatives and prompting for parameters. It automatically indents your text as you type it and lets you format a whole file at once. The outlining and folding facilities provide you with a focused and clean view of your text. AUCTeX lets you process your source files by running TeX and related tools such as output filters, post processors for generating indices and bibliographies, and viewers from inside Emacs.

AUCTeX lets you browse through the errors TeX reported, while it moves the cursor directly to the reported error, and displays some documentation for that particular error.

This will even work when the document is spread over several files. More detailed information about the features and usage of AUCTeX can be found in the remainder of this manual. If you want to discuss AUCTeX with other users or its developers, there are several mailing lists you can use.

Articles should be sent to auctex gnu. In a similar way, you can subscribe to the info-auctex gnu. The list bug-auctex gnu. If you want to address the developers of AUCTeX themselves with technical issues, they can be found on the discussion list auctex-devel gnu. Simply do M-x list-packages RET , mark the auctex package for installation with i , and hit x to execute the installation procedure. This installation procedure has several advantages.

Once the installation is completed, you can skip the rest of this section and proceed to Quick Start. On many systems, this will already activate the package, making its modes the default instead of the built-in modes of Emacs.

If this is not the case, consult Loading the package. Please read through this document fully before installing anything. The installation procedure has changed as compared to earlier versions. Compiling Emacs yourself requires a C compiler and a number of tools and development libraries. Details are beyond the scope of this manual. Most versions of Ghostscript nowadays in use should work fine version 7. At least version 4. The first step is to configure the source code, telling it where various files will be.

To do so, run. Only if no workable placement can be found there, in some cases an alternative search will be made in a prefix deduced from a suitable binary. See Advice for package providers for detail. If you are planning to install the package as a single non-priviledged user, you will typically set prefix to your home directory. Consult Advice for non-privileged users for addtional instructions. This is the name of the respective startup files. Please be aware that you must not move the start files after installation since other files are found relative to them.

This is the directory where the bulk of the package gets located. The startfile adds this into load-path. You can use this option to specify the directory containing automatically generated information. A number of standard options to configure exist, and we do not have the room to describe them here; a short description of each is available, using --help.

This disables configuration and installation of preview-latex. This option is not actually recommended. If your Emacs does not support images, you should really upgrade to a newer version.

Distributors should, if possible, refrain from distributing AUCTeX and preview-latex separately in order to avoid confusion and upgrade hassles if users install partial packages on their own. This option is used for specifying a TDS -compliant directory hierarchy. This option may be used to specify where the TeX documentation goes. To install the files into the locations chosen earlier, type. Should you want to completely remove the installed package, in the same directory you built AUCTeX run.

In that case they should be automatically loaded on startup and nothing else needs to be done. If not, they should at least have been placed somewhere in your load-path. You can then load them by placing the lines. If you want to change the modes for which it is operative instead of the default, use.

As a package provider, you should make sure that your users will be served best according to their intentions, and keep in mind that a system might be used by more than one user, with different preferences.

There are people that prefer the built-in Emacs modes for editing TeX files, in particular plain TeX users. The --without-texmf-dir option can be convenient for systems that are intended to support more than a single TeX distribution. Since more often than not TeX packages for operating system distributions are either much more outdated or much less complete than separately provided systems like TeX Live, this method may be generally preferable when providing packages.

The following package structure would be adequate for a typical fully supported Unix-like installation:. If there are other commonly used TeX system packages, it might be appropriate to provide separate packages for those. It is also a good idea to run. If your users might want to work with a different TeX distribution nowadays pretty common , instead consider the following:. Often people without system administration privileges want to install software for their private use.

In that case you need to pass more options to the configure script. See Configure for detail of these options. Now here is another thing to ponder: perhaps you want to make it easy for other users to share parts of your personal Emacs configuration. But if people will be copying just Elisp files, their copies will not work. The rest of the package should be found relative from there without further ado. The following are brief installation instructions for the impatient.

The commands above is example for common usage. More on configuration options can be found in the detailed installation instructions below. If the configuration script failed to find all required programs, make sure that these programs are in your system path and add directories containing the programs to the PATH environment variable if necessary.

However, meeting the prerequisites might require more work than on some other platforms, and feel less natural. If you are experiencing any problems, even if you think they are of your own making, be sure to report them to auctex-devel gnu.

Windows is a problematic platform for installation scripts. The main problem is that the installation procedure requires consistent file names in order to find its way in the directory hierarchy, and Windows path names are a mess. The installation procedure tries finding stuff in system search paths and in Emacs paths.

It is quite unlikely that the scripts will be able to identify the actual file names involved. File names containing shell-special characters like spaces or backslashes if you prefer that syntax need to get properly quoted to the shell: the above example used single quotes for that.

Line endings are a problem under Windows. The distribution contains only text files, and theoretically most of the involved tools should get along with that. However, the files are processed by various utilities, and it is conceivable that not all of them will use the same line ending conventions. If you encounter problems, it might help if you try unpacking or checking out the files in binary mode, if your tools allow that. All automatic detection of files and directories restricts itself to directories below the prefix or in the same hierarchy as the program accessing the files.

If you have a central directory hierarchy not untypical with Cygwin for such stuff, you might want to specify its root here. This option tells a place in load-path below which the files are situated. If you think that you need a different setup, please refer to the full installation instructions in Configure.

Directory containing automatically generated information. This will specify the directory where your TeX installation sits. If your TeX installation does not conform to the TDS TeX directory standard , you may need to specify more options to get everything in place. For more information about any of the above and additional options, see Configure. Some executables might not be found in your path.

This is especially a good idea if Emacs has trouble finding the respective programs later during normal operation. You might want to add. Adding support for an image format usually involves the installation of a library, e.

A different image format can be chosen by setting the variable preview-image-type. Any further customization can be done with customization buffers directly in Emacs. You might check some variables with a special significance.

If you issue the M-x TeX-auto-generate-global command after loading AUCTeX, you will be able to complete on all macros available in the standard style files used by your document. To do this, you must set this variable to a list of directories where the standard style files are located. The directories will be searched recursively, so there is no reason to list subdirectories explicitly.

AUCTeX is a powerful program offering many features and configuration options. Fortunately you do not have to learn everything at once. These installation instructions are available in this manual as well, Installation. We also assume that you are familiar with the way keystrokes are written in Emacs manuals. If not, have a look at the Emacs Tutorial in the Help menu.

Note that this also applies if you have the following line in your init file. In order to get support for many of the LaTeX packages you will use in your documents, you should enable document parsing as well, which can be achieved by putting. You can do this by inserting. AUCTeX can do syntax highlighting of your source code, that means commands will get special colors or fonts. You can enable it locally by typing M-x font-lock-mode RET.

If you want to have font locking activated generally, enable global-font-lock-mode , e. AUCTeX will indent new lines to indicate their syntactical relationship to the surrounding text. You will be asked for the section level. Next, you will be asked for the printed title of the section, and last you will be asked for a label to be associated with the section.

If you use a couple of environments frequently, you can use the up and down arrow keys or M-p and M-n in the minibuffer to get back to the previously inserted commands. Some environments need additional arguments. It even can differentiate between mandatory and optional arguments—for details, see Completion.

An additional help for inserting macros is provided by the possibility to complete macros right in the buffer. With point at the end of a partially written macro, you can complete it by typing M-TAB. AUCTeX provides convenient keyboard shortcuts for inserting macros which specify the font to be used for typesetting certain parts of the text. If you want to change font attributes of existing text, mark it as an active region, and then invoke the commands.

If no region is selected, the command will be inserted with empty braces, and you can start typing the changed text. With TeX-fold-mode , you can hide certain parts like footnotes, references etc.

If applicable, you will be asked whether you want to save changes, and which program you want to invoke. In many cases, the choice that AUCTeX suggests will be just what you want: first latex , then a viewer.

If a latex run produces or changes input files for makeindex , the next suggestion will be to run that program, and AUCTeX knows that you need to run latex again afterwards—the same holds for BibTeX. When no processor invocation is necessary anymore, AUCTeX will suggest to run a viewer, or you can chose to create a PostScript file using dvips , or to directly print it.

Actually, there is another command which comes in handy to compile documents: type C-c C-a TeX-command-run-all and AUCTeX will compile the document for you until it is ready and then run the viewer. At this place, a warning needs to be given: First, although AUCTeX is really good in detecting the standard situations when an additional latex run is necessary, it cannot detect it always.

There is also another possibility: compile the document with tex or latex and then convert the resulting DVI file to PDF using dvips — ps2pdf sequence. For details, see Processor Options. When AUCTeX runs a program, it creates an output buffer in which it displays the output of the command.

If there is a syntactical error in your file, latex will not complete successfully. The view will be split in two windows, the output will be displayed in the lower buffer, and both buffers will be centered around the place where the error ocurred.

You can then try to fix it in the document buffer, and use the same keystrokes to get to the next error. This procedure may be repeated until all errors have been dealt with. Similar to C-l , which centers the buffer you are in around your current position, C-c C-l centers the output buffer so that the last lines added at the bottom become visible.

If you want to check how some part of your text looks like, and do not want to wait until the whole document has been typeset, then mark it as a region and use C-c C-r. It behaves just like C-c C-c , but it only uses the document preamble and the region you marked. It will run latex only on the current buffer, using the preamble from the master file. Apart from that this chapter contains a description of some features for entering more specialized sorts of text, for formatting the source by indenting and filling and for navigating through the document.

To help you insert these efficiently, AUCTeX allows you to continue to press " to insert two single quotes. To get a literal double quote, press " twice. String inserted by typing " to open a quotation. See European , for language-specific quotation mark insertion. String inserted by typing " to close a quotation. Determines the behavior of ". If it is non-nil, typing " will insert a literal double quote.

The respective values of TeX-open-quote and TeX-close-quote will be inserted after typing " once again. If you use this package, either directly or by loading a language-specific style file, you should also use the special commands for quote insertion instead of the standard quotes shown above.

AUCTeX is able to recognize several of these languages and will change quote insertion accordingly. See European , for details about this feature and how to control it. The quotation characters will only be used if both variables— LaTeX-csquotes-open-quote and LaTeX-csquotes-close-quote —are non-empty strings.

This has been partially implemented, we assume dollar signs always match within a paragraph. This will be indicated by moving the cursor temporarily over the first dollar sign. The opening symbol will blink when blink-matching-paren is non-nil. Note that you should not use double dollar signs in LaTeX because this practice can lead to wrong spacing in typeset documents.

To avoid unbalanced braces, it is useful to insert them pairwise. If there is an active region, put braces around it and leave point after the closing brace. In both cases, active region is honored. The point is left after the opening brace. If there is an active region, braces are put around it. This auto completion feature may be a bit annoying when editing an already existing LaTeX document. Then no completion is done and just a single left brace is inserted.

In fact, with optional prefix arg , just that many open braces are inserted without any completion. Perhaps the most used keyboard commands of AUCTeX are the short-cuts available for easy insertion of font changing macros. If you give an argument that is, type C-u to the font command, the innermost font will be replaced, i.

If replace is not nil, replace current font. Each entry is a list with three elements. The first element is the key to activate the font. The second element is the string to insert before point, and the third element is the string to insert after point. An optional fourth element means always replace if not nil. It has the same structure as TeX-font-list. This command is highly customizable, the following describes the default behavior.

When invoking you will be asked for a section macro to insert. An appropriate default is automatically selected by AUCTeX, that is either: at the top of the document; the top level sectioning for that document style, and any other place: The same as the last occurring sectioning command. Next, you will be asked for the actual name of that section, and last you will be asked for a label to be associated with that section. The label will be prefixed by the value specified in LaTeX-section-hook.

A number of hooks are already defined. Most likely, you will be able to get the desired functionality by choosing from these hooks.

Query the user about the name of the sectioning command. Modifies level and name. Insert LaTeX section command according to name , title , and toc. If toc is nil, no toc entry is inserted. If toc or title are empty strings, done-mark will be placed at the point they should be inserted. Insert a label after the section command. Controlled by the variable LaTeX-section-label. If it is a string, it is used unchanged for all kinds of sections. If it is nil, no label is inserted.

If it is a list, the list is searched for a member whose car is equal to the name of the sectioning command being inserted. The cdr is then used as the prefix. If the name is not found, or if the cdr is nil, no label is inserted. Labels are not automatically inserted for other types of sections. AUCTeX is aware of most of the actual environments available in a specific document. Most of these are described further in the following sections, and you may easily specify more.

See Customizing Environments. You insert an environment with C-c C-e , and select an environment type. Depending on the environment, AUCTeX may ask more questions about the optional parts of the selected environment type. With C-u C-c C-e you will change the current environment. If the optional argument arg is not-nil i. You can select the prefix to be used for such environments with the LaTeX-label-alist variable.

This is an alist whose car is the environment name, and the cdr either the prefix or a symbol referring to one. If the name is not found, or if the cdr is nil, no label is automatically inserted for that environment. If you want to automatically insert a label for a environment but with an empty prefix, use the empty string "" as the cdr of the corresponding entry.

It is intended to be used in LaTeX class style files. You will be prompted for a new package until you enter nothing. AUCTeX distinguishes normal and expert environments. By default, it will offer completion only for normal environments. This behavior is controlled by the user option TeX-complete-expert-commands. You can close the current environment with C-c ] , but we suggest that you use C-c C-e to insert complete environments instead.

AUCTeX offers keyboard shortcuts for moving point to the beginning and to the end of the current environment. If this command is called inside a comment and LaTeX-syntactic-comments is enabled, try to find the environment in commented regions with the same comment prefix.

Prefix to use for amsmath equation labels. Figures and tables i. This is the optional argument of float environments that controls how they are placed in the final document. The value will default to the value of LaTeX-float. This is the caption of the float. The default is to insert the caption at the bottom of the float. You can specify floats where the caption should be placed at the top with LaTeX-top-caption-list. The length that a caption needs to be before prompting for a short version is controlled by LaTeX-short-caption-prompt-length.

The label of this float. Moreover, you will be asked if you want the contents of the float environment to be horizontally centered. In an itemize-like environment, nodes i.

If non-nil, you will always be asked for optional label in items. Otherwise, you will be asked only in description environments. Related variables:.

Default position string for array and tabular environments. AUCTeX calculates the number of columns from the format string and inserts the suitable number of ampersands. It recognizes the current environment and does the appropriate job depending on the context. See Adding Environments , for how to customize the list of known environments. TeX is written by a mathematician, and has always contained good support for formatting mathematical text. AUCTeX supports this tradition, by offering a special minor mode for entering text with many mathematical symbols.

This is a minor mode rebinding the key LaTeX-math-abbrev-prefix to allow easy typing of mathematical symbols. If given a prefix argument, the symbol will be surrounded by dollar signs.

The string has to be a key or key sequence in a format understood by the kbd macro. This corresponds to the syntax usually used in the manuals for Emacs Emacs Lisp. A list containing user-defined keys and commands to be used in LaTeX Math mode.

Each entry should be a list of two to four elements. First, the key to be used after LaTeX-math-abbrev-prefix for macro insertion. If it is nil, the symbol has no associated keystroke it is available in the menu, though. Third, a string representing the name of a submenu the command should be added to.

Use a list of strings in case of nested menus. Fourth, the position of a Unicode character to be displayed in the menu alongside the macro name.

This is an integer value. Whether the LaTeX menu should try using Unicode for effect. Your Emacs built must be able to display include Unicode characters in menus for this feature. In order to enable this feature, set the variable TeX-electric-sub-and-superscript to a non-nil value. You can automatically turn off input methods, used to input non-ascii characters, when you begin to enter math constructs.

Users of the wonderful ispell mode know and love the ispell-complete-word command from that package. In order to use TeX-complete-symbol , you should write a backslash and the start of the macro. This is controlled by TeX-complete-list. More recent Emacs versions have a new completion mechanism. Modern completion UIs like company-mode support this completion-at-point facility. It has the advantage over completion that it knows about the argument of most standard LaTeX macros, and will prompt for them.

Some examples are listed below. As a default selection, AUCTeX will suggest the macro last inserted or, as the first choice the value of the variable TeX-default-macro. If set to the symbol show-optional-args , TeX-insert-macro asks for optional arguments of TeX marcos, unless the previous optional argument has been rejected.

If set to show-all-optional-args , TeX-insert-macro asks for all optional arguments. Note that for some macros, there are special mechanisms, e. LaTeX-includegraphics-options-alist and TeX-arg-cite-note-p. The difference between TeX-insert-macro and TeX-electric-macro is that space will complete and exit from the minibuffer in TeX-electric-macro. Space will complete and exit. This is suppressed inside math mode and can be disabled totally by setting TeX-insert-braces to nil.

This variable is an alist. Each element is a cons cell, whose car is the macro name, and the cdr is non-nil or nil, depending on whether a pair of braces should be, respectively, appended or not to the macro. If a macro has an element in this variable, TeX-parse-macro will use its value to decide what to do, whatever the value of the variable TeX-insert-braces.

See Automatic , for more information. AUCTeX distinguishes normal and expert macros. By default, it will offer completion only for normal commands. This behavior can be controlled using the user option TeX-complete-expert-commands. For this kind of completion to work, parsing must be enabled as described in see Parsing Files.

You can mark the current environment by typing C-c. With a non-nil prefix argument, mark only the region from the current section start to the next sectioning command.

Thereby subsections are not being marked. Otherwise, any included subsections are also marked along with current section. Set mark to the end of the current environment and point to the matching beginning. If a prefix argument is given, mark the respective number of enclosing environments.

The command will not work properly if there are unbalanced begin-end pairs in comments and verbatim environments. The current section is detected as starting by any of the structuring commands matched by the regular expression in the variable outline-regexp which in turn is a regular expression matching any element of the variable texinfo-section-list. Otherwise, any included subsections are also marked.

Note that when the current section is starting immediately after a node command, then the node command is also marked as part of the section. M-C-h Mark the current node. This is the node in which point is located. It is starting at the previous occurrence of the keyword node and ending at next occurrence of the keywords node or bye. Uncommenting works only if the region encloses solely commented lines. If AUCTeX should not try to guess if the region should be commented or uncommented the commands TeX-comment-region and TeX-uncomment-region can be used to explicitly comment or uncomment the region in concern.

Indentation means the addition of whitespace at the beginning of lines to reflect special syntactical constructs. This makes it easier to see the structure of the document, and to catch errors such as a missing closing brace.

Thus, the indentation is done for precisely the same reasons that you would indent ordinary computer programs. Indentation is done by LaTeX environments and by TeX groups, that is the body of an environment is indented by the value of LaTeX-indent-level default 2. Items are identified with the help of LaTeX-item-regexp. If you have auto-fill-mode enabled and a line is broken while you type it, Emacs automatically cares about the indentation in the following line.

Those environments may be specified in the variable LaTeX-indent-environment-list together with their special indentation functions. There are environments in LaTeX-indent-environment-list which do not bring a special indentation function with them. This is due to the fact that first the respective functions are not implemented yet and second that filling will be disabled for the specified environments. This shall prevent the source code from being messed up by accidently filling those environments with the standard filling routine.

If you think that providing special filling routines for such environments would be an appropriate and challenging task for you, you are invited to contribute. See Filling , for further information about the filling functionality. The check for the indentation function may be enabled or disabled by customizing the variable LaTeX-indent-environment-check. AUCTeX is able to format commented parts of your code just as any other part.

If you disable it, comments will be filled like normal text and no syntactic indentation will be done. Following you will find a list of most commands and variables related to indenting with a small summary in each case:. Most keyboards nowadays lack a linefeed key and C-j may be tedious to type. The respective option is called TeX-newline-function. List of environments with special indentation. The second element in each entry is the function to calculate the indentation level in columns.

The filling code currently cannot handle tabular-like environments which will be completely messed-up if you try to format them. This is why most of these environments are included in this customization option without a special indentation function. This will prevent that they get filled. If non-nil comments will be filled and indented according to LaTeX syntax. Otherwise they will be filled like normal text. This will normally be newline which simply inserts a new line.

The former inserts a new line and indents the following line, i. The latter function additionally indents the current line. Filling deals with the insertion of line breaks to prevent lines from becoming wider than what is specified in fill-column. The linebreaks will be inserted automatically if auto-fill-mode is enabled. In this case the source is not only filled but also indented automatically as you write it.

See Modes and Hooks. As an example, if you want to enable auto-fill-mode in LaTeX-mode , put the following into your init file:. You can manually fill explicitely marked regions, paragraphs, environments, complete sections, or the whole buffer. Note that manual filling in AUCTeX will indent the start of the region to be filled in contrast to many other Emacs modes.

There are some syntactical constructs which are handled specially with regard to filling. These are so-called code comments and paragraph commands. Code comments are comments preceded by code or text in the same line. Upon filling a region, code comments themselves will not get filled. Filling is done from the start of the region to the line with the code comment and continues after it.

In order to prevent overfull lines in the source code, a linebreak will be inserted before the last non-comment word by default. Active 2 years, 5 months ago. Viewed 14k times. Evince is launched but Emacs freezes and I have an error Couldn't find the Evince instance for file XXX I don't have the time to debug it and, moreover, I don't need the sync feature.

I still have the problematic command TeX-evince-sync-view as default command. Improve this question. I have already a very up-to-date version of Emacs What works for you? Did you successfuly change the viewing command in pdf mode? Using emacs -q is a way to see if the local configuration is the reason for the problem as it disables. See here: lists. Show 12 more comments. Active Oldest Votes. Improve this answer. Suzanne Soy 2, 1 1 gold badge 23 23 silver badges 44 44 bronze badges.

Alist of TeX engines and associated commands. Each entry is a list with a maximum of five elements. The first element is a symbol used to identify the engine. The second is a string describing the engine. The third is the command to be used for plain TeX. The fourth is the command to be used for LaTeX. Each command can either be a variable or a string. An empty string or nil means there is no command available.

Before running them, AUCTeX checks if it able to find those commands and will warn you in case it fails. You can skip this test by changing the option TeX-check-TeX. It actually checks if can run TeX-command command or the shell returns a command not found error. The error code returned by the shell in this case can be set in TeX-check-TeX-command-not-found option. Some LaTeX packages requires the document to be compiled with a specific engine.

If you try to compile a document which loads one of such packages and the set engine is not one of those allowed you will be asked to select a different engine before running the LaTeX command. String with the extra options to be given to the TeX processor.

For example, if you need to enable the shell escape feature to compile a document, add the following line to the list of local variables of the source file:.



0コメント

  • 1000 / 1000