[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

Re: Ændre »document«-mønstret i LaTeX-modus



Jacob Sparre Andersen <sslug@sslug> skriver:

> Når jeg åbner en tom LaTeX-fil (noget.tex), plejer jeg at starte med
> at taste Ctrl-C Ctrl-E og vælge »document«-miljøet.  Det giver mig et
> udgangspunkt for at skrive i:
>
> ------------------------------------------------------------
> \documentclass{article}
>
> \begin{document}
>
> \end{document}
> ------------------------------------------------------------
>
> Er det muligt at ændre hvad der indsættes her?  Jeg vil for eksempel
> gerne have at der bliver indsat en linje med
> »\usepackage[danish]{babel}« i præamblen og to linjer med
> »\bibliographystyle{plain}« og »\bibliography{}« i slutningen af
> dokumentet.

Hej,

Jeg har det følgende i min .emacs og det kan du sikkert modificere til
dit behov.

(defun my-LaTeX-document-style-hook nil
  "Insert my default \\usepackages."
  (save-excursion
    (goto-char (point-min))
    (search-forward "\\documentclass" nil t)
    (forward-line)
    (insert "\\usepackage[T1]{fontenc}\n")
    (when (fboundp 'latexenc-coding-system-to-inputenc)
      (if (and (not buffer-file-coding-system)
               (not (eq (latexenc-coding-system-to-inputenc
                         buffer-file-coding-system)
                        'undecided)))
          (insert "\\usepackage[" (latexenc-coding-system-to-inputenc
                                   buffer-file-coding-system) "]{inputenc}\n")
        (insert "\\usepackage[utf8]{inputenc}\n")
        (set-buffer-file-coding-system 'utf-8-unix))
      (insert "\\usepackage{babel}\n")
      (insert "\\usepackage[osf,sc]{mathpazo}\n")
      (insert "\\usepackage{microtype}\n"))))

(add-hook 'LaTeX-mode-hook
          (lambda nil (add-hook 'LaTeX-document-style-hook
                                'my-LaTeX-document-style-hook nil t)))


mvh
        /arne
-- 
Arne Jørgensen <http://arnested.dk/>


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2007-03-01, 02:01 CET [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *