changing the working directory

usetex will produce a number of files in the current directory, like .aux
and .log. If the current directory is not writeable, then these files are
written to .matplotlib/tex.cache.

Is it ok to change the current directory to .matplotlib/tex.cache, generate
the tex files, and then change back to the original working directory? Even
if an error is encountered along the way, I could change back to the original
working directory before passing the error along.

Is it bad practice to do this?

Darren Dale wrote:

Is it ok to change the current directory to .matplotlib/tex.cache, generate the tex files, and then change back to the original working directory?

I think it's bad practice: it sure seems fragile. I don't like my software to change my working directory.

Why not have a TexTempDir attribute stored somewhere, and write everything there?

-Chris

···

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...236...

That's exactly what I'm trying to do. Or maybe I dont understand what you are
suggesting.

···

On Wednesday 05 April 2006 18:42, Christopher Barker wrote:

Darren Dale wrote:
> Is it ok to change the current directory to .matplotlib/tex.cache,
> generate the tex files, and then change back to the original working
> directory?

I think it's bad practice: it sure seems fragile. I don't like my
software to change my working directory.

Why not have a TexTempDir attribute stored somewhere, and write
everything there?

I've looked into this more than once before, but this time around I finally
found a real solution:

latex -output-directory=C:\texoutput -aux-directory=C:\tobedeleted foo.tex

Ok, moving on.

···

On Wednesday 05 April 2006 18:46, Darren Dale wrote:

On Wednesday 05 April 2006 18:42, Christopher Barker wrote:
> Darren Dale wrote:
> > Is it ok to change the current directory to .matplotlib/tex.cache,
> > generate the tex files, and then change back to the original working
> > directory?
>
> I think it's bad practice: it sure seems fragile. I don't like my
> software to change my working directory.
>
> Why not have a TexTempDir attribute stored somewhere, and write
> everything there?

That's exactly what I'm trying to do. Or maybe I dont understand what you
are suggesting.

Yes, you're right. I guess this option is exclusive to miktek. Ok, so I'm back
to believing that there is no way to hide all the tex output files, I guess
they will just have to temporarily exist in the current working directory.

Damn is that ugly.

···

On Wednesday 05 April 2006 20:03, Ryan Krauss wrote:

I didn't know latex had this capability and I don't see it listed in
the options if I type latex --help. (I am running Ubuntu). Is this
something you only need on windows/miktex or should this option be
cross-platform? I don't have output or aux directory options.

ryan@...339...:~/thesis$ latex -output-directory=/home/ryan
rwk_thesis_main.tex latex: unrecognized option
`-output-directory=/home/ryan'
Try `latex --help' for more information.

Darren Dale wrote:

I didn't know latex had this capability and I don't see it listed in
the options if I type latex --help. (I am running Ubuntu). Is this
something you only need on windows/miktex or should this option be
cross-platform? I don't have output or aux directory options.

ryan@...339...:~/thesis$ latex -output-directory=/home/ryan
rwk_thesis_main.tex latex: unrecognized option
`-output-directory=/home/ryan'
Try `latex --help' for more information.

Yes, you're right. I guess this option is exclusive to miktek. Ok, so I'm back to believing that there is no way to hide all the tex output files, I guess they will just have to temporarily exist in the current working directory.

Damn is that ugly.

This doesn't sound right. What kind of tex build is ubuntu using? I thought just about everything now (including miktex) was based on tetex with kpathsea. I don't have an ubuntu handy to try, but a little googling shows that tetex is offered. Is it some sort of stripped-down version?

On Mandriva 2006:

[efiring@...340... examples]$ latex --help
[snip]
-output-directory=DIR use DIR as the directory to write files to
[snip]

Eric

···

On Wednesday 05 April 2006 20:03, Ryan Krauss wrote:

I just installed whatever tetex option was shown in the package
manager. Here is what I've got:

ryan@...339...:~$ latex -v
e-TeX (Web2C 7.4.5) 3.14159-2.1
kpathsea version 3.4.5
Copyright (C) 1997-2003 The NTS Team.
Kpathsea is copyright (C) 1997-2003 Free Software Foundation, Inc.
There is NO warranty. Redistribution of this software is
covered by the terms of both the e-TeX copyright and
the GNU General Public License.
For more information about these matters, see the files
named COPYING and the e-TeX source.
Primary author of e-TeX: The NTS Team.
Kpathsea written by Karl Berry and others.

ryan@...339...:~$ latex --help
Usage: etex [OPTION]... [TEXNAME[.tex]] [COMMANDS]
   or: etex [OPTION]... \FIRST-LINE
   or: etex [OPTION]... &FMT ARGS
  Run e-TeX on TEXNAME, usually creating TEXNAME.dvi.
  Any remaining COMMANDS are processed as e-TeX input, after TEXNAME is read.
  If the first line of TEXNAME is %&FMT, and FMT is an existing .efmt file,
  use it. Else use `NAME.efmt', where NAME is the program invocation name,
  most commonly `etex'.

  Alternatively, if the first non-option argument begins with a backslash,
  interpret all non-option arguments as a line of e-TeX input.

  Alternatively, if the first non-option argument begins with a &, the
  next word is taken as the FMT to read, overriding all else. Any
  remaining arguments are processed as above.

  If no arguments or options are specified, prompt for input.

-efmt=FMTNAME use FMTNAME instead of program name or a %& line
-file-line-error-style print file:line:error style messages
-ini be einitex, for dumping formats; this is implicitly
                          true if the program name is `einitex'
-interaction=STRING set interaction mode (STRING=batchmode/nonstopmode/
                          scrollmode/errorstopmode)
-ipc send DVI output to a socket as well as the usual
                          output file
-ipc-start as -ipc, and also start the server at the other end
-jobname=STRING set the job name to STRING
-kpathsea-debug=NUMBER set path searching debugging flags according to
                          the bits of NUMBER
[-no]-mktex=FMT disable/enable mktexFMT generation (FMT=tex/tfm)
-mltex enable MLTeX extensions such as \charsubdef
-output-comment=STRING use STRING for DVI file comment instead of date
-parse-first-line parse of the first line of the input file
-progname=STRING set program (and fmt) name to STRING
-recorder enable filename recorder
-shell-escape enable \write18{SHELL COMMAND}
-src-specials insert source specials into the DVI file
-src-specials=WHERE insert source specials in certain places of
                          the DVI file. WHERE is a comma-separated value
                          list: cr display hbox math par parend vbox
-translate-file=TCXNAME use the TCX file TCXNAME
-help display this help and exit
-version output version information and exit

Email bug reports to tex-k@...341...

Ryan

···

On 4/5/06, Eric Firing <efiring@...229...> wrote:

Darren Dale wrote:
> On Wednesday 05 April 2006 20:03, Ryan Krauss wrote:
>
>>I didn't know latex had this capability and I don't see it listed in
>>the options if I type latex --help. (I am running Ubuntu). Is this
>>something you only need on windows/miktex or should this option be
>>cross-platform? I don't have output or aux directory options.
>>
>>ryan@...339...:~/thesis$ latex -output-directory=/home/ryan
>>rwk_thesis_main.tex latex: unrecognized option
>>`-output-directory=/home/ryan'
>>Try `latex --help' for more information.
>
>
> Yes, you're right. I guess this option is exclusive to miktek. Ok, so I'm back
> to believing that there is no way to hide all the tex output files, I guess
> they will just have to temporarily exist in the current working directory.
>
> Damn is that ugly.

This doesn't sound right. What kind of tex build is ubuntu using? I
thought just about everything now (including miktex) was based on tetex
with kpathsea. I don't have an ubuntu handy to try, but a little
googling shows that tetex is offered. Is it some sort of stripped-down
version?

On Mandriva 2006:

[efiring@...340... examples]$ latex --help
[snip]
-output-directory=DIR use DIR as the directory to write files to
[snip]

Eric

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
Matplotlib-devel mailing list
Matplotlib-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/matplotlib-devel

Darren Dale wrote:

Why not have a TexTempDir attribute stored somewhere, and write
everything there?

That's exactly what I'm trying to do. Or maybe I dont understand what you are suggesting.

I'm confused about what "working directory" you're talking about. I thought you meant Python's working directory:

>>> os.getcwd()

However, if you mean a sub-process's working directory:

os.system("cd temp; ls")

Then I don't have a problem with that. It won't screw up anything else.

Could you use a standard temp directory instead? Maybe by using something from the tempfile module.

It would be nice if TeX/LaTeX gave you a way to specify directories to use, but I guess it doesn't, at least not consistently across systems.
Darn.

-Chris

···

On Wednesday 05 April 2006 18:42, Christopher Barker wrote:

--
Christopher Barker, Ph.D.
Oceanographer
                                         
NOAA/OR&R/HAZMAT (206) 526-6959 voice
7600 Sand Point Way NE (206) 526-6329 fax
Seattle, WA 98115 (206) 526-6317 main reception

Chris.Barker@...236...

There's a thought. I'll have a look at it when I can, but I'm swamped at the
moment. Maybe next week.

···

On Thursday 06 April 2006 17:47, Christopher Barker wrote:

Darren Dale wrote:
> On Wednesday 05 April 2006 18:42, Christopher Barker wrote:
>> Why not have a TexTempDir attribute stored somewhere, and write
>> everything there?
>
> That's exactly what I'm trying to do. Or maybe I dont understand what you
> are suggesting.

I'm confused about what "working directory" you're talking about. I

thought you meant Python's working directory:
>>> os.getcwd()

However, if you mean a sub-process's working directory:

os.system("cd temp; ls")

Then I don't have a problem with that. It won't screw up anything else.

Thank you for that suggestion, it turned out to be an acceptable solution.
Changes in svn 2274.

I hope the recent lack of bug reports concerning the usetex option is an
indication that the current implementation is approaching stability. I dont
know if I have mentioned it here, but I think I worked out the clipping
problems we were having with ghostscript-7.07. At any rate, I would
appreciate some testing now, since I changed the way subprocesses are handled
and where temporary files are created.

Darren

···

On Thursday 06 April 2006 17:47, Christopher Barker wrote:

Darren Dale wrote:
> On Wednesday 05 April 2006 18:42, Christopher Barker wrote:
>> Why not have a TexTempDir attribute stored somewhere, and write
>> everything there?
>
> That's exactly what I'm trying to do. Or maybe I dont understand what you
> are suggesting.

I'm confused about what "working directory" you're talking about. I

thought you meant Python's working directory:
>>> os.getcwd()

However, if you mean a sub-process's working directory:

os.system("cd temp; ls")