Take the 2-minute tour ×
TeX - LaTeX Stack Exchange is a question and answer site for users of TeX, LaTeX, ConTeXt, and related typesetting systems. It's 100% free, no registration required.

I'd like to to generate some metadata in the log file that I can copy to another application. But the log file is wrapped to 80 columns and I end up with newlines embedded in what I'm putting there. Is there a way around this?

The two ways I know to write to the log file are \message and \immediate\write17. But both of these have the same effect. Is \write17 a special filehandle that only writes wrapped text?

My workaround so far is to write to the auxiliary file between \iffalse...\fi, but I know that's not what the aux file is for. I don't feel like writing this metadata to another file. Yes, I'm being stubborn, but TeX means you can usually get anything you want if you work hard enough. Can I do this?

Edit: Here's something else that doesn't work. Open another filehandle with the same filename.

\newwrite\logfilenowrap
\immediate\openout\logfilenowrap=\jobname.log

Then \immediate\write\logfilenowrap{long text} will not wrap lines. But it lops off everything that was in the logfile before this point (of course it does. Opening a file handle usually puts the pointer at the front).

Edit 2: Thanks for all the replies. Consensus is that this is "probably" not possible. I'll go the route of writing metadata to a separate text file.

share|improve this question
    
I’m not sure, but maybe something in Will’s answer to the orthogonally named question “How can I word-wrap LaTeX warning/error output?” helps. –  Caramdir Oct 13 '10 at 3:00
    
I wish, but that seems to be about inserting extra newlines. I want to avoid the ones which are there. –  Matthew Leingang Oct 13 '10 at 3:14
    
As others have said, I don't think this is possible. I'd probably do the explicit hard wrapping ( package to appear shortly) and insert a special char to indicate where to soft-wrap in post-processing. –  Will Robertson Oct 13 '10 at 23:43
add comment

2 Answers

up vote 3 down vote accepted

I am pretty sure the wrapping behaviour is hardwired in TeX itself. Why can't you simply write to a separate file instead?

\newwrite\mylog
\immediate\openout\mylog=\jobname.mylog
share|improve this answer
    
Sure, I can. I just wanted to cut down on the amount of files lying around. If I decide to create a separate file for metadata, I start thinking about RDF which is a favorite pet project/rat hole of mine. So I wanted to keep things simple. –  Matthew Leingang Oct 13 '10 at 12:06
add comment

Output file line wrapping is controlled by the max_print_line setting in texmf.cnf (for TeX Live, miktex may have another system that I do not know).

The default setting is:

max_print_line = 79
share|improve this answer
    
Miktex knows max_print_line too. It can be set temporarly with the option --max-print-line=150 or in the .ini files by calling e.g. initexmf --edit-config-file pdflatex and then adding max_print_line=150. The second must be done for each compiler which should use this setting. –  Ulrike Fischer Oct 13 '10 at 7:42
    
No texmf.cnf file on my machine has this setting in it. But I assume from your answer that whatever it is has to be a positive number. In other words, it can't be shut off. –  Matthew Leingang Oct 13 '10 at 12:08
1  
Correct. But you can give it is very high value :) –  Taco Hoekwater Oct 13 '10 at 15:30
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.