{write} is about writing to files in TeX macros.

learn more… | top users | synonyms

0
votes
1answer
57 views

Tikz: flow chart how to write label over a line

I'm using tiKZ to design a flow chart. On that FC, I have, mainly, two principal box: a normal rectangle a diamond box (as a decision) On the decision box, I need to write, over the line that ...
3
votes
3answers
250 views

ç doesn't work in \write and \read

In Plain TeX when I do a \write containing ç or Ç in the string it gets expanded generating a lot of code in the output file, which can't be read back. I got this problem when reading a TOC: This is ...
2
votes
0answers
50 views

Converting/Re-Writing Paper in LaTeX from Word [duplicate]

I have a paper that I wrote in Word with accompanied math equations (for my undergraduate level research paper for mathematics degree) and I just am not at all familiar with LaTeX. I was wondering ...
1
vote
0answers
15 views

How do I stop \write and \message from inserting a newline at 80 characters? [duplicate]

I have the following file: \immediate\write16{abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKL 80 char split is right here -><- this is on the next line} ...
10
votes
1answer
139 views

Translate \typeout to LaTeX3

The command \typeout{argument} expands its argument and writes the result to the log and the terminal. Writing l3build tests, I sought for an equivalent command in LaTeX3, but only found \iow_log:x ...
0
votes
0answers
30 views

How to duplicate content/vboxes?

I am trying to create exercise and answer environments for lecture notes, where I type \begin{exercise}... \end{exercise} followed by \begin{answer}...\end{answer} within the text. I want to include ...
7
votes
2answers
100 views

\write and \ifmmode

This is related to a previous question of mine (if I understand correctly, \write works a bit like \edef). Consider the following code: \documentclass[varwidth,convert={size=640}]{standalone} ...
5
votes
2answers
60 views

How to expand a register value in a \write argument (plain TeX)?

I am using \write to output table of contents information. While the correct heading counter information apears in the headings itself, the TOC headings have the number of the last heading of a page. ...
6
votes
3answers
144 views

Appendixify: Move selected slides to appendix in Beamer

When working with Beamer I often have slides that I initially write in the body of the presentation, then decide they should be consigned to an appendix. This is also useful when reapplying slides ...
3
votes
1answer
60 views

Macro expansion in \write

I want to use a macro in \write18, but this causes the space after it to be ignored. The following example prints foobar to test.txt, whereas I want it to print foo bar: \documentclass{standalone} ...
1
vote
1answer
33 views

How to enable verbatim environment under self defined environment?

So I want to define an inline environment !foo!, and write foo into an exteral file. Here is my source code: \catcode`!=13 \newwrite\mmtlatexfile \immediate\openout\mmtlatexfile=\jobname.mmtlatex ...
2
votes
1answer
55 views

commands with optional arguments in \write

To extract text from huge LaTeX-files in a safe and controllable manner, I am having LaTeX itself write to a textfile. To retain and adapt some formatting informations and structural elements I have ...
2
votes
1answer
91 views

Writing the size of a Tikz node to a file

I write a program that typesets elements in a Tikz picture. In general the items are not placed correctly. In order to solve this, I was thinking of running a two-stage compiler: the first time the ...
1
vote
1answer
47 views

What process can generate a new write sequence

While compiling a very large document recently in xelatex and tex4ht I have observed that tex4ht doesn't handle write streams the same as xelatex. I am trying to prepare a MWE to troubleshoot my ...
6
votes
3answers
226 views

Expanding control sequences and writing the raw result to a file

I'm attempting to automatically generate a BiBTeX file from within LaTeX. I'd like to expand all control sequences, but disable any active character expansion in the output. The idea is that the ...
3
votes
1answer
35 views

Write absolute pagenumber of a reference to a file by macro

I want to write the absolute pagenumber of a reference to a file. therefore i cant use \immediate\write. The problem is now i think that \write expands its parameters when a page is finished, but then ...
0
votes
0answers
68 views

Creating a question-solution capability

I am trying to modify a question-solution capability that was answered brilliantly a while back here. After each question text, one can freely use \solution to keep the solution directly with the ...
4
votes
2answers
51 views

Empty groups {} when writing environment contents verbatim (but with expanded macros)

In answering this question, I noticed some trickiness regarding empty groups {} in an otherwise verbatim context. Suppose you capture the contents of an environment verbatim (as in that question), ...
3
votes
1answer
72 views

Append verbatim material to a file

I am using the fancyvrb package. I'd like to create a verbatim-like environment that does the following two things: 1) Append the verbatim material as-is to a file that has already been opened. 2) ...
1
vote
3answers
68 views

How to write macro outcome to file

I have a macro \printauthors that contains a list of authors, for example John Doe, Barack Obama,... How can I write this content to a file, for example authors.txt. The command ...
6
votes
2answers
61 views

How to 'robustly' use file contents in command arguments?

I have the following code which sets up a XeLaTeX document (to be run with --enable-write18) and defines two commands, \showme and \prRaise: \documentclass[a4paper,oneside]{memoir} ...
2
votes
2answers
53 views

Pattern to detect need for recompilation from auxfile

I am using an auxfile to access the results of some computations which I need before they can actually be computed. Since this requires two runs when something changes the result I would like to have ...
1
vote
0answers
98 views

Evaluating \luaexec while writing to the aux file

In the document end hook I'm trying to write \luaexec{x = 1} to the aux file, where the 1 is computed in Lua itself (and more complex in the real document, of course). MWE: \documentclass{article} ...
14
votes
2answers
249 views

Is there any way to interact with the shell but keep the same session open?

I'm preparing some course material (PDF) for a tutorial that involves the Unix command line. Because I strive for automation (some call that laziness), I've written a little package that allows me, ...
6
votes
1answer
80 views

Write reference of linenumber to file

I want to write the actual linenumbers that a \lineref command generates into an external file. The lines are referenced correctly (after 2 times compiling), but the writing to a file does not work. ...
3
votes
1answer
121 views

A templating system in LaTeX [closed]

I need to generate quite a few LaTeX files in an automated way. I do not want to use any templating engine in Python or Elisp (two languages I'm probably most comfortable with); I'd prefer to do it ...
4
votes
1answer
63 views

Replacing some macro tokens in a list before \write ing

I'm trying to hack a bibliography package (amsrefs), and fall into the following problem. I'm trying to convert the amsrefs format back to .bib files. This doesn't quite work, because strings get ...
4
votes
1answer
100 views

Using \newcommand with \write\@auxout inside

I have read some related posts but still cannot resolve the problem with \newcommand{\myLabel}[2]{\makeatletter\write\@auxout{\string\newlabel{#1}{{#2}{\thepage}}}\makeatother} I would like to ...
6
votes
1answer
415 views

TeX engine can't write on hidden aux files in Windows

To make my latex folder clean, I tried to hide all auxiliary files with the following DOS command: attrib +S +H *.aux ...... attrib +S +H *.toc But when I tried to compile my latex file again, ...
4
votes
2answers
126 views

Generate file write handles on the fly

I am experimenting a little bit with automatic generation of file handles via \newwrite. I want to achieve following behaviour: A user provides a list of file categories, for example Hints, ...
9
votes
1answer
137 views

Difference between morewrites and scrwfile

I have tested morewrites and scrwfile in my template which uses so many writes that without loading any of those packages I would run into the no room for new \write problem. I find that with ...
8
votes
2answers
1k views

debug No room for a new \write problem

I have a template with an extensive documentation. (See TemplateDocumentation.pdf). It compiled several month ago. Now with updated packages it does not compile anymore because of the famous No room ...
9
votes
2answers
377 views

Adding newlines while writing text to a file

Within a custom command, I'm doing the following to write to a file: \newcommand\mycommand[1]{ \newwrite\file \immediate\openout\file=foobar.tex \immediate\write\file{ foo bar #1 ...
2
votes
0answers
273 views

Alternative to Morewrites [closed]

Is there an alternative to morewrites? Using the glossaries package for different types of lists, as well as lstlisting package has put me over the maximum writes number, however, I cannot seem to ...
7
votes
1answer
309 views

Writing \\ to a File

I have a local class that a number of people use. One of the new things I want it to do is write out various user-defined data to a file, so that a follow-up LaTeX document can do something ...
7
votes
1answer
70 views

How many times is “align” processed?

Consider the following MWE which writes the word "Cat" to a file. \documentclass{article} \usepackage{amsmath} \begin{document} \newwrite\datei \immediate\openout\datei=Beispiel.txt \begin{align*} ...
6
votes
1answer
717 views

At which point does \immediate\write write to file?

Assume I have opened a file myfile and write to it with \immediate\write\myfile{My cat is too old} I have multiple such statements in my document and do calculations in between which influence the ...
3
votes
1answer
109 views

Modify the stored value of enumeration in output file

This question is in reference to a previous question: Write the value of enumerate to output file. I would like to take the solution one step further, but I couldn't get it to work. ...
9
votes
1answer
627 views

Write the value of enumerate to output file

I would like to save the present value of an enumeration into an output file. Using information from another question I have the following minimal example: \documentclass{article} ...
10
votes
3answers
394 views

Write on a file and input it

I'm trying to redefine a \tableofcontents-like command. I proceed this way : the displayed elements are written to a file, and the file is input when I want the display. If I know the toc will be ...
10
votes
1answer
157 views

Is there any side effect in using \immediate in the definition of \protected@write?

In latex.ltx, \protected@write is defined as: \long\def \protected@write#1#2#3{% \begingroup \let\thepage\relax #2% \let\protect\@unexpandable@protect ...
10
votes
1answer
183 views

How to write the € symbol into a file, when using Package [utf8]{inputenc}

With the following MWE, I can write the € symbol into the file euro.txt \documentclass{article} \newwrite\tempfile \immediate\openout\tempfile="euro.txt" \begin{document} Write Euro symbol into a ...
6
votes
2answers
311 views

How to redefine commands and environments, and make them acceptable for `\write`

My general problem is the following. I want to "convert" many .tex files into some other format (xml-like). I don't want to modify the tex files, I can only build a documentclass. The texfiles are ...
3
votes
2answers
620 views

Difficulty with \write

I have a macro \Content wich contains several occurence of a macro \comm. The latter increases a counter a displays the value of the counter. Calling \Content gives the correct output. But i want to ...
9
votes
2answers
1k views

How to output a tabulation into a file

With the commands \openout and \write I output text into a file. How can i output a tab ? \documentclass{article} \begin{document} \newwrite\tempfile \immediate\openout\tempfile="filename.txt" ...
9
votes
2answers
4k views

How to use an underscore in a filename

With the commands \openout and \write I output text into a file. I want this file to have a name of containing an underscore (eg. name_01.txt), but I'm unable to get the underscore in the filename. My ...
17
votes
3answers
2k views

Writing { and } to a file with LaTeX

How can the special characters { and } be written literally to an external file in LaTeX, without being balanced? Obviously the following does not work: \immediate\write\my@outfile{{} ...
5
votes
2answers
835 views

write macro parameter character to file (#)

During pdfLaTeX processing, I'm writing a string of key-value pairs to an external file. Sometimes the value will contain \# and I want only the # to be written to the file. Here is my code which ...
9
votes
4answers
2k views

How to write a command to file

I am trying to write to a auxillary file using \newwrite\tempfile [...] \immediate\openout\tempfile=list.tex \immediate\write\tempfile{Text to write to file} \immediate\closeout\tempfile It works ...
9
votes
4answers
2k views

How to use a \write command inside a \newenvironment ?

I'd like to make a new environment which would store its content in a file, so that I can read that file at another part of the document. More specifically, I want to have an environment {proof} such ...