[texworks] Inclusion paths for TeXworks

John F.Hughes jfhext at gmail.com
Wed Jan 30 17:51:46 CET 2013


Vladimir Lomov <lomov.vl at ...> writes:

> 
> Hello,
> 
> ** John F. Hughes [2013-01-22 12:41:48 -0500]:
> 
> >  Hi.
> 
> > I'm trying to set up a standard LaTeX environment for assignments in a
> > class I'm teaching. The directory structure is roughly this:
> 
> > asgn:
> >   LATEX
> >        assignment.cls
> >   asgn1:
> >       hw1.tex
> >   asgn2:
> >       hw2.tex
> >   ...
> 
> > I'd like the first line of each assignment.tex file to be
> 
> > \documentclass{assignment}
> 
> > and have TeXworks somehow find the class definition in
> > ../LATEX/assignment.cls
> 
> First of all, the problem you try to solve doesn't related to TeXworks,
> but how latex engine finds files.
> 
> > I suspect that I either have to do something with environment variables, or
> > some TeXworks startup file that I don't know about, or SOMEthing, but
> > frankly, after some digging around through the documentation, I'm at a
> > loss.
> 
> > Any suggestions?
> 
> Yes, if you don't like to set up personal TEXMF tree then you have to
> set up environment variable TEXINPUTS. How to set up env. variable on
> Windows depends on version Windows.
> 
> > I'd rather NOT put the class file into some miktex-specific location, which
> > seems like the obvious solution: I think of it as associated to the
> > assignments rather than to "doing LaTeX stuff", so it should be in a
> > directory near the assignments.
> 
> Why not? It is associated with you, your work not with MiKTeX. 

That's true, but more important, the class files is associated with these 
documents, which are part of a course which may soon be taught by someone else, 
who may need to modify things, etc. So the association of the settings with the 
documents is stronger than the association of the settings with ME. 

Thanks for the detailed answer below. I found, with more searching, that I'd 
asked almost the same question (about a multi-author book) a year ago, and you'd 
given a corresponding answer; I'm sorry I didn't find it before re-asking. 

I *did* find settings that work for me in this instance, and I'll once again 
record them for others who might find this useful. 

Under File...

for pdfLaTeX+MakeIndex+BibTeX, the settings are

program: texify.tex
arguments:
--pdf
--text-option=-synctex-1
$fullname
--tex-option=-include-directory="..\LATEX"
--tex-option=-include-directory=".\LATEX"

The first of the "include-directory" paths is useful for my current situation, 
with the LATEX directory one level up; the second is useful in the book-
generating situation I mentioned, where the LATEX directory is in the same 
directory as the master file for the book. 

My impression, after some experimentation, is that on Windows the double-quotes 
may be necessary even if the path contains no spaces. 

--John

> There is
> such thing as 'personal' TEXMF tree. You can put your files there and
> any latex engine (latex, pdflatex, xelatex, lualatex) can find them.
> See
> http://docs.miktex.org/2.9/manual/localadditions.html
> 
> For example, create directory (tree)
> %USERPROFILE%/texmf/tex/latex/jhughes
> and add it as "User-Managed TEXMF Directory" (MiKTeX term). Put there
> your LaTeX files, e.g. 'assignment.cls'.
> 
> %USERPROFILE% on Windows plays the same role as $HOME on Linux. Run it
> terminal (Command Prompt)
> echo %USERPROFILE%
> to find out that is your '%USERPROFILE%'.
> 
> > On Linux, I'd do something with TEXINPUTS, as I recall, but on windows...I
> > have no idea.
> 
> > Thanks in advance,
> 
> > John
> 
> ---
> WBR, Vladimir Lomov
> 





More information about the texworks mailing list