The tag has no wiki summary.

learn more… | top users | synonyms

6
votes
1answer
32 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. ...
2
votes
1answer
68 views

Token list with line breaks for writing multiple lines to file

I make use of a package (gnuplottex) that writes contents of an environment to a file, using the \verbatim@start/processline/end commands (by \immediate\write\FileHandle{\the\verbatim@line}). Now I ...
6
votes
2answers
87 views

Reading number from file into variable — How to put a number into my document that increments with every compilation?

I am not that much into TeX/LaTex programming ... but what I want to do is the following: How to put a number into my document that increments with every compilation My ideas so far are: use a ...
4
votes
0answers
56 views

LuaTeX readline encoding

Must LuaTeX's \readline use latin-1 encoding? In the example below, I first store é in a file (well, and ^^J) which works well. Then I read it back in, using \readline and get two characters é (and ...
3
votes
0answers
66 views

add lines into tex file

I have this tex file coming from matlab. \begin{tikzpicture} \begin{axis}[% width=\figurewidth, height=\figureheight, scale only axis, xmin=1, xmax=5, ymin=2, ymax=10 ] \addplot [color=red,line ...
6
votes
3answers
314 views

Creating my own \tableofcontents in plain TeX

I'd like to define my own table of contents in TeX (not LaTeX, so without packages) to have a fine control on what goes there, how the numbers are displayed, etc. Basically what I would like is to ...
3
votes
2answers
106 views

How to write Russian text in a file?

I am writing Russian text in a file but it gives the error. \documentclass{article} \usepackage{amsmath} \usepackage{amscd} \usepackage[tableposition=top]{caption} \usepackage{ifthen} ...
8
votes
1answer
79 views

Encoding of written out files

I have a tex file with: \usepackage[utf8]{inputenc} The file calls a macro that saves the content between and \begin{something} and \end{something} to a file. But the encoding of the file is not ...
14
votes
1answer
181 views

How to actually close a write-stream

I don't know too much about writing and reading to and from files. But I managed to create a nice command for me where I need to write something into a text-file and later-on read it again. ...
6
votes
1answer
87 views

How to output environment content to a file while enclosing content by a box?

This is the source: \documentclass{article} \begin{document} \begin{obj}{name-of-obj} This is a test code. \begin{equation} a < b \end{equation} \end{obj} \end{document} I want to enclose the ...
7
votes
1answer
131 views

Writing environment content verbatim to file, calling Graphviz and including source/image

Based on Write environment body verbatim to a file I try to write the content of a environment verbatim to a file, call an external tool (in my case the awesome Graphviz) and include the source code ...
11
votes
3answers
237 views

How to read a character one by one from an external file, modify it, and save it back to another external file?

The purpose of this question is to learn how to read character by character of a fetched line of characters, modify it and save back to another file. For the sake of simplicity, let's take a simple ...
4
votes
1answer
75 views

Listings WriteFile adds additional line if content contains two spaces between words

I use the listings latex package to write/read the environment body to a file. But if in the environment are two spaces between some words, there is an additional linebreak added at the beginning (I ...
10
votes
3answers
599 views

Space after command with \write

I did not see this question yet, correct me if there is. It's not the usual problem of adding a space after a command. It's more specifically when writing to a file. For some reason the same method ...
4
votes
1answer
531 views

How to copy contents of one file to another?

So I have a .txt-file and I need to import the data line per line. That works like it should. I need however to adapt the contents loaded into a command an write it to another .txt file that later ...
4
votes
2answers
598 views

Accent characters incorrectly written external file

I tried to write some strings in an external file for use in a special type of index, but using utf8 accented characters appear wrong. In my external file, those characters appear in the same way as ...
4
votes
1answer
124 views

listing's lst@BeginWrite gobbles '->' and '=>' from input [closed]

I'm trying to write a package that takes verbatim input and appends it to several files. My current approach is based of off an answer by Martin Scharrer to a similar problem. The difficulty arises in ...
8
votes
1answer
522 views

Help wanted on \openout, \write and \closeout

Is there a way to test if a token is already associated with a writer? Something like this: \def\do@write#1{% \immediate\write\mywriter{something: #1}% } \def\@writesomething#1{% ...
15
votes
2answers
850 views

Write environment body verbatim to a file

How can one write the body of an environment verbatim to an external file. I tried the following but get problems if the body contains undefined macros (error) or e.g. a % (disappears in the output). ...
9
votes
3answers
295 views

How can I write % into a file?

How can I write % into an auxiliary file? % will not work, because LaTeX thinks that I start a comment with it (in the main file, not in the auxiliary file!), and \% will write \% into the file. How ...
1
vote
1answer
749 views

Is it possible to change jobname from within the input file? [duplicate]

Possible Duplicate: How to influence the name of the pdf file created with pdfLaTeX (from within the source code)? I have a template as follows. % template.tex \documentclass{article} ...
5
votes
1answer
625 views

How to append data to a temporary file?

I want to create a new temporary file (named main-temp.tex), append data to it multiple times, and import the contents later. I haven't learnt how to use TeX file operation, both reading and writing. ...
2
votes
0answers
120 views

How to automatically increase the number of \write registers? [duplicate]

Possible Duplicate: Making efficient use of \writes I am trying to compile a document that heavily uses PGF/TikZ externalization as well as a table of contents, list of figures, etc. I am ...
6
votes
1answer
349 views

Could you give me a working, dangerous LaTeX input file to test the vulnerability of my server?

I have an IIS web server on which I installed Miktex distribution. I host a site that allows users to submit LaTeX input codes. The server then compiles the input using pdflatex.exe to produce a pdf ...
7
votes
1answer
1k views

How to write the \columnwidth to an external file

Some figures in my LaTeX document I am generating with Python. Normally I manually check how wide my picture can be with \showthe\columnwidth and adjust the image width accordingly. (This whole is ...