Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to use a common file containing all required package details?

1 view
Skip to first unread message

Sharon Kimble

unread,
May 5, 2015, 1:46:55 PM5/5/15
to help-gnu-emacs

I'm trying to have one common file containing all my preamble for a
latex document up to \begin{document}, which will appear as -

--8<---------------cut here---------------start------------->8---
\documentclass[a4paper,12pt]{report} %% works
\input{/home/boudiccas/research/masterlatex}
\include{ob2014-title}
\begin{document}
--8<---------------cut here---------------end--------------->8---

Doing this will mean that I only have one file to keep current of
all package changes but will be able to be used for all my latex
projects.

It works and loads it, 'it' being "masterlatex.tex", but when it
reaches the end of "masterlatex" it stops at \documentclass just
before "masterlatex" being loaded and goes no further. How can I get
it to continue please, and load the rest of the project main file,
and ultimately build a pdf?

Or is there a existing package that will allow me to list all the
packages I want to use, along with the required options?

Thanks
Sharon.
--
A taste of linux = http://www.sharons.org.uk
TGmeds = http://www.tgmeds.org.uk
Debian 8.0, fluxbox 1.3.7, emacs 24.5.50.1
signature.asc

Jorge A. Alfaro-Murillo

unread,
May 5, 2015, 2:07:32 PM5/5/15
to help-gn...@gnu.org
Sharon Kimble writes:

> I'm trying to have one common file containing all my preamble
> for a latex document up to \begin{document}, which will appear
> as -
>
> --8<---------------cut
> here---------------start------------->8---
> \documentclass[a4paper,12pt]{report} %% works
> \input{/home/boudiccas/research/masterlatex}
> \include{ob2014-title} \begin{document} --8<---------------cut
> here---------------end--------------->8---
>
> Doing this will mean that I only have one file to keep current
> of all package changes but will be able to be used for all my
> latex projects.
>
> It works and loads it, 'it' being "masterlatex.tex", but when it
> reaches the end of "masterlatex" it stops at \documentclass just
> before "masterlatex" being loaded and goes no further. How can I
> get it to continue please, and load the rest of the project main
> file, and ultimately build a pdf?

What are you using? Plain emacs? For LaTeX you certainly want to
install AUCTeX: M-x package-install<ENTER>auctex<ENTER>

This gives you, among many other things, the ability to define in
each document which file is the master file.

That said, the way you describe it, makes me think that you have a
call to documentclass twice, which would be a mistake. What you
call masterlatex.tex is not really the master file, but the file
with your options, and should not have any call to documentclass
or begin{document}, just your LaTeX preamble.

> Or is there a existing package that will allow me to list all
> the packages I want to use, along with the required options?

AUCTeX, check the variable LaTeX-default-options.

Best,

--
Jorge.


0 new messages