Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [write]

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

1
vote
1answer
28 views

Is this possible to fix this requirement (explain briefly in this question)?

My code is as follows: \documentclass{book} \usepackage{lipsum} \begin{document} blah blah blah blah blah blah \lipsum[1-2] \begin{figure} \includegraphics{...eps} \caption{caption text} \end{...
0
votes
0answers
39 views

Get path of (custom) auxiliary file when `-output-directory` flag is given to pdflatex

In short: Say the following is built using pdflatex -output-directory=tmp: \documentclass{article} \newwrite\fileHandle \immediate\openout\fileHandle=outfile.csv \immediate\write\fileHandle{hello ...
0
votes
0answers
8 views

Tuning authors' names and title format in revtex

The solution provided by William Legrand at Author's initials in longbibliography ... would work fine unless the reference section includes footnotes. This is because in that case writing to the ...
2
votes
2answers
38 views

kpfonts error with environ package and \write

Minimum Working Example \documentclass{article} \usepackage{kpfonts} \usepackage{environ} \makeatletter \AtBeginDocument{% \begingroup \newwrite\@bibmeta \immediate\openout\@...
0
votes
2answers
35 views

using \newcommand with \immediate\write inside beamer

I'm trying to write some strings to an external file using the \immediate\write as in the MWE below \documentclass[a4paper,9pt]{beamer} \begin{document} \begin{frame}[plain] %< comment out for ...
-1
votes
2answers
92 views

Re: Lack Of Optional Argument Makes 1st Item Of Environment Get Executed As If It Were Optional Argument

\documentclass{article} \usepackage{verbatim} %\usepackage{fancyvrb} \usepackage{xcolor} \usepackage{xkeyval} %RE: LACK OF OPTIONAL ARGUMENT MAKES 1ST ITEM OF ENVIRONMENT GET EXECUTED AS IF IT WERE ...
2
votes
1answer
51 views

Why does \openout produce output in plain tex when it does not in latex?

This is a follow up question of this question. Why this plain code (from shreevatsar's answer) \newwrite\outfile \openout\outfile\jobname.out \end produce a page but this (equivalent) latex code ...
1
vote
0answers
54 views

\write : maximum lines'

In the ledmac documentation, Peter Wilson wrote that, when writing to the .end file (which stores the endnote), it transforms all spaces to line breaks. We change \newlinechar so that in the ...
2
votes
1answer
38 views

Missing } error from multiple “\immedite\write”s within a foreach loop; the current plot has no coordinates error with gnuplot

I suspect that these errors are coming from a section of code in which I loop through a master data file and restructure it so that I can give the newly made file as an argument to pgfplots. If I ...
2
votes
2answers
113 views

How to perform a replacement on a string before doing a \write?

I'd like to output LaTeX code to a file, with the caveat that all backslashes are doubled (ie, \ is replaced with \\). This output will be consumed by another program. I've adapted egreg's answer ...
2
votes
0answers
97 views

Write fully expanded macros to auxiliary files

Considering the following code snippet: \documentclass{article} \usepackage{xparse} % \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \NewDocumentCommand{\edeftest}{m}{\edef\test{#1}#1} \...
0
votes
0answers
28 views

Write out an unbalanced brace to a file [duplicate]

I want to know if it's possible to write out the line \def\TEMP{ to a file, and then later write } to close the brace-pair in the written file? Essentially I'd like to do; \documentclass{article} \...
3
votes
3answers
341 views

Write accented characters to file using \write

I am trying to output some information to an auxiliary file using \write and among other things I have authors names that often include accented letters. If I use the string explicitly, the accented ...
1
vote
1answer
126 views

How to check if the footnote mark appears on the same page of the footonote text?

For my typesetting purposes I need to check if the "footnote tag" appears in the same page of (the beginning of) the "footnote text". Sometimes indeed, it happens that, e.g., I have the footnote tag ...
3
votes
1answer
33 views

Layout and export URLs

I use LaTeX for technical documentation of test-scenarios of a software system. The idea is as follows: I write a test scenario in LaTeX. In this test-scenario, I use pieces of data that are ...
0
votes
1answer
50 views

\write command generates “incomplete \iffalse” error

I'm using LaTeX to generate a 100 pages document. Every page is basically a different randomly generated identity. At the end of every page, I use the \write command to write some datas that I ...
1
vote
4answers
274 views

How to use color and symbol at the same time?

How can I write in LaTeX, for example: \sanela{} but in red color? I typed \verb|\sanela|\{\} but it seems like a lot to type? How to add color red here?
8
votes
1answer
179 views

Write dynamic command name to an auxiliary file

I have a collection of latex documents. I want to output some latex commands to an auxiliary file corresponding to each document. All these aux files will be later used (along with their TOCs) to ...
9
votes
1answer
186 views

TeX's \write command sometimes induces a spurious vertical space

in the process of debugging a problem with FiXme (reported by Lars Madsen), I fell on this issue which I'm afraid is beyond my expertise. Consider the following MWE: \documentclass{memoir} \...
1
vote
2answers
203 views

How to escape a list of underscored filenames efficiently?

I am thinking how to read a CSV file which has filenames which have underscores efficiently into a LaTeX variable. I think reading the raw variables into a variable by input and then manipulating ...
2
votes
1answer
92 views

Writing a % to a file [duplicate]

I'm writing a macro to write some commands into a text file. This text file is supposed to be read later to execute some macros. The macro : \documentclass{article} \begin{document}% \newwrite\...
0
votes
0answers
44 views

How to modify the environment and command possible write the content in a file through the \write command?

I want to "generate/convert" my .tex files into xml format while compiling LaTeX. I don't want to modify the tex files, I want to generate the xml file trough the \write command based on the DTD while ...
6
votes
2answers
215 views

Size limit of an output file

I am designing a set of macros to have exercises in a book and write the answers at the end while typesetting the answers just after the questions in the exercise file. (See MWE for an example). (The ...
7
votes
2answers
79 views

How to write the result of a citation to a file?

I would like to write the result of "\cite{xyz}" to a file. The following MWE gives me Forbidden control sequence found while scanning text of \write. So I do not know how to do it. \documentclass{...
2
votes
1answer
116 views

Set up dynamic footnote margin (based on footnote numbers on page)

This is a follow up question of Is it possible to declare that the footnote number is right aligned but uses a dynamic width?. I tried to implement the solution given by @wipet on the original ...
5
votes
1answer
238 views

How to \immediate\write with multiple lines?

Using LuaLaTeX with TeXlive 2016, although I imagine that this question applies to nearly anything: I know how to create a file using \immediate\write on a line-by-line basis. But I would like to do ...
2
votes
2answers
132 views

Add line to index file to avoid page number

Is it possible to write custom lines into the index-file? Consider this: \documentclass{scrbook} \usepackage[splitindex]{imakeidx} \makeindex[name=date] \newcommand\dateindex[1]{\index[date]{#1}} ...
4
votes
1answer
274 views

bidi, RTL and \write

In order to solve one issue with reledmac in RTL, I made some test with \write and bidi. In the following MWE, only the first \write works. It I delete the \RTL, all the \write work. \documentclass{...
1
vote
0answers
43 views

How to avoid log messages which accidentally look like errors?

TeX errors are conventionally marked by the sequence <LF>!<SPACE>… in log files. However, sometimes one can accidentally get this sequence of characters in a log file even if no error ...
2
votes
1answer
83 views

How does adjustwidth affect \par and \write?

With the following code: \documentclass{article} \usepackage{newfile} \usepackage{changepage} \begin{document} \newoutputstream{info} \openoutputfile{\jobname.info}{info} \section{First} Here's some ...
0
votes
1answer
90 views

Write out # to a file [duplicate]

I'm writing to a file from within my document. At a certain location, I would like to actually write out the character #. I tried something like this: \newwrite\tempo \immediate\openout\tempo=outputo....
0
votes
0answers
32 views

Writing files to another directories [duplicate]

I need to write files in a specific directory on the file system where I have access to. But even if I can write files in the current working directory or any sub-directories, it seems that I am stock ...
3
votes
1answer
79 views

Generating a table with all entries from all over the document

We're working on a technical document where we define messages in different chapter/section all over the document. All messages have the same structure and are displayed in a table. We thought that it ...
7
votes
1answer
230 views

Why doesn't \write work when nothing is typeset in document?

I can't understand at which point \openout opens files, \write writes to them and \closeout closes them. I find that if nothing is typeset in the document environment, only the immediate writes write ...
3
votes
1answer
88 views

Does morewrites not support filecontents, and can I write body of environment using TeX primatives?

Is there an equivalent way to write the body of my environment to a file without filecontents using TeX primatives? morewrites or filecontents limitation I suspect a limitation that these packages ...
7
votes
1answer
104 views

\write or \index at the beginning of a table cell adds spurious vertical space

If a tabular column of type p (or a few others such as tabularx's X) starts with a write (for example because it starts with \index), this inserts some vertical space. MWE: \documentclass{article} %\...
1
vote
1answer
57 views

TeX-file output another TeX-file

My problem, is to generate some .tex-file from within another .tex-file. The origin of problem is to extract some information from scientific paper, and create another .tex->.pdf-file with data about ...
1
vote
0answers
54 views

How to use \@writefile without blocking a write stream?

From what I understand, to properly use \@writefile one has to block a write stream, like this: \documentclass{article} \usepackage{lipsum} \begin{document} \makeatletter \newwrite\tf@foo \openout\...
4
votes
1answer
63 views

Why get control sequences expanded in the process of writing them to an auxiliary file?

I was looking at LamsTeX, an old TeX format, because it has some interesting macros. I found this article about it. In the article we can read \bitem Many \LaTeX\ difficulties just now being ...
0
votes
1answer
130 views

\addxcontentsline causes empty to part of mdframed box before page break

I’m using mdframed to surround an own environment called {myenv} (for this example). And this environment is setup as a trio list and uses \addxcontentsline to write a list of these environments (I’m ...
0
votes
1answer
478 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
401 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 ...
1
vote
0answers
82 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
26 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} \message{...
10
votes
1answer
188 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 ...
1
vote
0answers
88 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 ...
6
votes
2answers
150 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
283 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. ...
7
votes
4answers
793 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
89 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} \...