Latex project with parent-child files

Russel Winder russel at russel.org.uk
Wed Aug 10 15:27:49 UTC 2011


Michael,

On Wed, 2011-08-10 at 04:02 -0700, spinner wrote:
> I'm a newby to Bazaar and looking at Bazaar Explorer to manage my
> dissertation
> writing. I'm writing my diss in multiple LaTex files and bringing them
> together into a parent (wrap) file with \include{chap1.tex},
> \include{chap2.tex}, etc.

Sounds standard and sensible to me :-)

> I'm having a problem in identifying the proper parent-child folder
> structure to write the necessary .aux files (Tex) so the folders� work
> with Bazaar. I can't figure out a directory structure that blends
> Tex's requirements to write aux files for the child files and
> Bazaar. I'm hoping someone else has already figured out how to make
> these two requirements work together.

I am not sure what has given you the ideas that Bazaar has a required
folder structure because it does not. Bazaar manages a directory tree
without regard for any structure other than that the .bzr directory at
the top of the project hierarchy is special.  Thus the only requirements
are those of TeX. (I assume you are using pdfLaTex or XeLaTeX rather
than TeX.)

> First, here's my understanding of Bazaar's general folder
> requirements. I believe it essentially works with this folder
> structure for simple projects: ~/diss/wrap/trunk/wrapfile.tex. It adds
> a folder named 'trunk' and my working tex file is in this trunk
> folder. Bazaar's 'project' name is the name of the preceding folder
> 'wrap' and the working tex file is not in this folder. To keep a tidy
> version system, I want to keep my chapters as separate versioning
> 'projects' in different folders. Thus: /chap1/trunk/chap1.tex,
> /chap2/trunk/chap2.tex, etc. I don't want to put all these chapter tex
> files in one huge Bazaar project folder because the folder gets
> untidy.

Uuuurrrr.... no.  I am not sure what documentation has given you this
view of Bazaar, but it is wrong.  (Ignoring the complexity of shared
repositories) The project directory (branch) is the one with .bzr in it.
There are no other constraints.

I generally have a branch looking something like:

+ doc.ltx
+ Chapters
|	+ chapter1.ltx
|	+ chapter2.ltx

etc.  I don't see any need for anything more complex than this since to
appear to separately version each chapter you just have the workflow of
only ever committing one file at a time.

> Second, to compile a document in LaTeX with parent-child files when
> these files are in separate directories, I understand Tex requires
> that the child tex files be in subfolders below the parent to get the
> \include command in the parent (wrap) file to work properly, which
> depends on Tex writing aux files for each child in their respective
> child folders. Thus, we have this folder structure according to Tex's
> requirements: /wrap/wrapfile.tex /wrap/chap1/chap1.tex
> /wrap/chap2/chap2.tex

TeX has no such requirement, you can input or include files from
anywhere in the filestore.  It is normal though for the input/include
files to be in subdirectories.

The aux files will be written in the directory in which the source file
offered to the executable of (pdf|xe)(La)TeX is.

> Here's my problem. How do I reconcile Tex's and Bazaar's requirements?
> 
> Bazaar needs this folder structure to keep chapters as separate
> versioning projects: /wrap/trunk/wrapfile.tex /chap1/trunk/chap1.tex

I don't understand the need to separately version chapters.

> How do the child files and their folders fit into this version system?
> Logically, I don't believe this will work well in Bazaar:
> /wrap/trunk/wrapfile.tex /wrap/trunk/chap1/trunk/chap1.tex

If you really have to have separate Bazaar branches per chapter then
create the branches all in the same directory and them just use
the ../chapterN/chapterN.ltx type path in the input/include.

> If you are still reading this message, thank you. As I said, I hope
> someone has already found a solution to get parent-child files working
> with Bazaar and keeping chapters as separate projects. Many thanks.

To quote:  If I want to get there, I wouldn't start here.

I would just use a single Bazaar branch with the control LaTeX file in
the root (with the .bzr directory) and then subdirectories for Chapters,
Images, SourceCode etc. with the Images and SourceCode directories
having per chapter subdirectories.

Then use Waf or SCons to manage everything.

Do not even think about keeping aux files in the branch under version
control, generate them every session.  Having written a number of books
using LaTeX (and now XeLaTeX), I can attest to the fact that letting
Waf/SCons control the dependencies is about 100000000% easier than
trying to do what it says in the TeXBook -- which is about 20 years
behind the times in terms of tooling.  But that criticism doesn't mean I
don't love and use XeLaTeX -- I think it is the only sane document
preparation system (*).



(*) Except for slides for presentation where I admit I don't use beamer
because it is too restrictive, I'm afraid I just use LibreOffice Impress
for that.  But XeLaTex for everything else document wise.

-- 
Russel.
=============================================================================
Dr Russel Winder      t: +44 20 7585 2200   voip: sip:russel.winder at ekiga.net
41 Buckmaster Road    m: +44 7770 465 077   xmpp: russel at russel.org.uk
London SW11 1EN, UK   w: www.russel.org.uk  skype: russel_winder
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <https://lists.ubuntu.com/archives/bazaar/attachments/20110810/716cc444/attachment.pgp>


More information about the bazaar mailing list