{input} is about the \input command which makes LaTeX process the content of a given file basically the same way as if it would be written instead of \input.

learn more… | top users | synonyms

8
votes
1answer
3k views

How to make \lstinputlisting applicable to file paths with spaces?

I am using the listings package and the path to the source code contains some spaces. For example, the path can be /some dir/sub dir/file 1.txt and \lstinputlisting{/some dir/sub dir/file 1.txt} does ...
8
votes
1answer
153 views

How to use luatex callbacks to generate a verbatim copy of the input file

I'm trying to devise a LuaTeX solution for the question Extracting the contents of text in a specified environment into a new file, but it is turning more difficult than expected. To begin, I need to ...
8
votes
1answer
2k views

latexdiff + svn not working with multiple files (flatten)

Short question Seems like --flatten doesn't work properly with latexdiff-vc. How can I get this working, without reverting to my elaborated workflow described below? Context I track the history of ...
7
votes
3answers
6k views

Include data from a .txt

I am using a finite element program that outputs data in .txt files. And I want to input these data in my latex code. Is there a way to input the data files so that they appear as the program output ...
7
votes
1answer
339 views

How to \input the part between \begin{document} and \end{document} from another LaTeX file?

Sometimes I want to \input some LaTeX code, which belongs to a standalone LaTeX file. I would like to input the part between \begin{document} and \end{document}, while skipping the other part.
7
votes
1answer
163 views

Automatically convert \left to \Bigl

I have a LaTeX file, which includes tons of other auto-generated LaTeX files containing TikZ figures. Suppose I want to make every \left( in the TikZ figure appear at the same, fixed size, say \Bigl(. ...
7
votes
1answer
147 views

How can I prevent a new paragraph between two \input commands?

I want to use the command \input{} to insert two textfiles, text1.tex and text2.tex, into my latex working file. I want these two textfiles to produce one single paragraph when I am compiling my ...
7
votes
3answers
282 views

Avoid inputting a file multiple times

I have a revision string automatically saved to a file VERSION (it is the output of git describe and usually looks like v2.2-19-g0a51c27), and define a command ...
7
votes
3answers
132 views

Command that expands to the contents of a file

I'd like to make a macro that expands to the contents of a file. Basically something like \def{\mycommand}{\input{file.txt}} % file.txt contains "Hello%" \anothercommand{\mycommand} ...
7
votes
1answer
327 views

How could I use \input within soul arguments?

So, I basically want to do something like this: \documentclass{article} \usepackage{soul} \begin{document} \so{Hello} \so{\input{key.tex}} \end{document} Now the first "so" works but the second ...
7
votes
2answers
275 views

Options for building multiple documents from the same content with different layouts

I need to produce two document layouts using the same content. I'm going to be making heavy use of the input{} command to do this, but it is more complex than just this. I'm looking for suggestions ...
7
votes
1answer
129 views

What are the pros and cons of packages versus \input for a preamble?

For a some simple cases it seems to me that there would be no important difference between putting some code in a file preamble.tex and having \input{preamble.tex} in the main .tex file putting it ...
7
votes
3answers
1k views

How to make nonstopmode really not stop on a missing input file

I have a file test.tex with these contents: \input{missing} \input{present} When I run PDFLaTeX with --interaction=nonstopmode it stops after the first missing input file: $ pdflatex ...
7
votes
1answer
145 views

does LaTeX support native multifile management?

This is not really a practical question, but more of an academic one: I use emacs to write my LaTeX files and in order to process multifile documents I include at the end of each file a local ...
7
votes
1answer
66 views

How can I access the numbers of pages on which input material begins and ends?

Is there a way to access the numbers of pages on which material included using \input begins and ends? Crude approaches along the lines of \def\myinput#1{% \typeout{ Input starts on page \thepage} ...
7
votes
1answer
314 views

Typesetting multiple TeX files

Q1. Is there an existing template with the following features: (1) Multiple files, which I can typeset individually (as and when necessary). (2) A single .bib file from which I can cite in ...
7
votes
1answer
160 views

\renewcommand of \input for embedding input files without embed ALL source files

I would like to redefine the \input command so that it also embed the input file to the generated pdf. So far I used the code from thi s question (Mark on document where input starts and what is the ...
7
votes
1answer
214 views

Can I amend the preamble from outside the preamble?

I am writing a document (mydoc.tex) that will include a section as a separate document (mysection.tex) using \input{mysection.tex}. If I want to include something in the preamble (specifically ...
7
votes
0answers
543 views

using \input and pygmentize together: trying to get line numbers to show [closed]

I am using pygments to highlight the code I insert in my lyx document. The external file gets inserted in my document like this: {\small \input{listings/blah.tex} } And I use this command to ...
6
votes
4answers
1k views

How to make “\input” in a “\include”-d file use the correct current path?

I'm having a master file let's say test.tex and also some folders sub1/ and sub2/. There is also a TeX file in each of them: sub1/sub1.tex and sub2/sub2.tex. In the sub1/ and sub2/ are also some ...
6
votes
3answers
265 views

Is there a way to load additional packages specified in the document environment?

It seems strange but I really need this. Is there a built-in macro to load additional packages specified in the document environment? % main.tex \documentclass{article} \begin{document} ...
6
votes
2answers
129 views

How to automatically include several text documents into a LaTeX document?

I have several .txt or .dat files, whose names are of the form: dn-ddmmyyyy.txt. For instance: d0-01021989.txt d1-21021989.txt d2-15021994.txt d3-12121996.txt d4-14032014.txt d5-22022035.txt ...many ...
6
votes
1answer
127 views

modular chapters of a dissertation

I have several different chapters I would like to include into a dissertation. Each chapter is a standalone paper and has its own directory structure (figures, tables, etc.). I would like to retain ...
6
votes
2answers
80 views

Restricting \input to avoid unpleasant duplication

Avoid inputting a file multiple times describes how to prevent a file from being \input more than once. I wonder, though, if there is a way to limit this to only preventing a file from being input if ...
6
votes
2answers
71 views

error lines, input files

My problem is debugging a large LaTeX project (a book) with several input files. The line of each error is referred to the current input file, but the name of the file is lost in the previous ...
6
votes
1answer
191 views

MiKTeX order of precedence for duplicate files

I am using MiKTeX under a single-user installation. My MiKTeX Options dialogue shows me, if I click on the "Show MiKTeX-maintained root directories" checkbox, directories in the following order (from ...
6
votes
2answers
1k views

Avoid warnings in TeXlipse

I'm using TeXlipse, an Eclipse plugin, to create my TeX documents. To structure my files I use \input{filename}. Now the problem is, that every file is one section or subsection. TeXlipse shows me a ...
6
votes
1answer
31 views

Make text from external file uppercase

I would like to do something like \uppercase{\input{filename}} so that the text in the file filename is printed uppercase. (Above command complains about FILENAME.tex not to exist, apparently ...
6
votes
1answer
146 views

Latex command /input relative adressing problem

My Latex project is organized like this: In my root Latex folder there is a root latex file named main.tex. In the same folder there is a subfolder pictures which contains 2 files named test.tex ...
6
votes
1answer
532 views

How to use “input” on Linux (Fedora 16)? [closed]

This seems like a trivial thing, but I can't figure out how to use input properly on Fedora. When I used Windows 7, I would put the following into my document ...
6
votes
1answer
435 views

Get {standalone} to ignore blocks of text from \input files (e.g., \begin{spacing} and \maketitle)

I've got a number of separate .tex files that are all \documentclass{article}. I'm inputting these into a \documentclass{book} file as chapters. In the book.tex file, then, I've got inputs like this: ...
6
votes
1answer
915 views

tabular, siunitx and input - `Extra }, or forgotten $.`

I'm trying to include data into a tabular environment \usepackage{booktabs} \usepackage{siunitx} \begin{table} \begin{center} \begin{tabular}{SSSS} \toprule {$na^3$} & ...
6
votes
1answer
691 views

\input only part of a file using catchfilebetweentags package

I would like to include only a part of a .tex file into a different .tex file. The part I want to include is delimited by some comment tags, as it is used by catchfilebetweentags package. I tried the ...
6
votes
1answer
317 views

Including LaTeX documentation as comments in source code

I am working on a large C# project (hundreds of source files). I am trying to add documentation on various user inputs and options. For maintainability I would ideally like to be able to write the ...
6
votes
1answer
2k views

\input{…} is ignored with beamer option ignorenonframetext

I'm using beamer to create my slides and wanted to use beamerarticle to create written paper which is not just printed slides 3 on 1 page. The option ignorenonframetext for the beamer class forces it ...
6
votes
1answer
648 views

Temporarily changing document class in LaTeX/resetting pdfLaTeX

How can I temporarily cause pdfLaTeX to forget everything that I've told it and start with a new document class? I've modified the example environment from the lshort document: ...
6
votes
1answer
108 views

noalign and \include

I have reduced my code to the following lines: \documentclass[9pt,letterpaper,oneside]{amsart} \usepackage{graphicx} \usepackage[table, dvipsnames]{xcolor} \usepackage{longtable} ...
5
votes
2answers
380 views

Argument to \input or \include statement?

I produce a lot of plots in Matlab which I export to TikZ with matlab2tikz. In matlab2tikz I can specify the plot width and height, for instance. This works out quite nicely, but as I write my ...
5
votes
2answers
2k views

Is it possible to create a LaTeX preamble “header”?

Is it possible to create a header in LaTeX containing my usual preamble, functioning similar to a header in C? Specifically, can I write a text document (or something similar) with the preamble that I ...
5
votes
2answers
123 views

Use of \csname in \input produces mysterious results

I am stuck with the following one where I want to input a file with a name in the line of \jobnameQ.tex. Here is my MWE excerpted from a bigger picture. \documentclass{article} \usepackage{lipsum} ...
5
votes
2answers
174 views

Comment out input files through flags

Following up on a previous question about universal processing of some hundreds of exercises to prepare for my students has arisen a new problem that I try to resolve ... however the fact is that I do ...
5
votes
2answers
70 views

How to make a wrapper for \input

I would like to make a wrapper for \input to include TikZ figures. I have tried something like this: \newcommand{\inputtikz}[1]{% \tikzsetnextfilename{#1} \input{figures/{#1}.tikz} } but with this ...
5
votes
2answers
137 views

The least intrusive and most elegant for removing \documentclass?

Here is the context: I have a file named (say) 00.tex, which I use in the following elaborate way. Compiling the file, generates auxiliary tex files, which in turn execute \include{00.tex}. The ...
5
votes
1answer
258 views

loop and input@path

I'm trying to have recursive path in the command \input@path, but it seems to be impossible (as I read, I'm with the TexLive 2012 and Linux). So I had the following idea, make a loop in \input@path, ...
5
votes
1answer
794 views

Jobname of inputted file?

\begin{filecontents}{foo.tex} \def\foo{\jobname} \end{filecontents} \documentclass{article} \begin{document} \input{foo} \foo \end{document} This outputs the jobname of the main file not "foo". How ...
5
votes
1answer
885 views

Special characters in input file

I want to have my sections in independent .txt files in the folder of my assignment. So I use \input{text.txt}. The problem is, I write in Danish and we have the 'æ' 'ø' 'å' characters that aren't ...
5
votes
1answer
2k views

lstinputlisting does not include file within lstnewenvironment?

I want to use lstinputlisting to include a file with code within an lstlisting block, which is defined through a new environment. However, the lstinputlisting command itself, not the code, is ...
5
votes
1answer
2k views

Including all files within a directory [duplicate]

Possible Duplicate: How to iterate through the name of files in a folder Using \input{filename}, I can input a file canned "filename.tex". I have a directory containing all of the files I ...
5
votes
1answer
584 views

Creating a common settings file

I have created a file which provides convenient options to change the settings for all of my documents. For e.g.: \def\BookFontRoman{Gentium Plus} \def\BookFontCJK{Adobe Song Std} \def\PageWidth{280} ...
5
votes
1answer
47 views

How to include files from a directory specified by a concatenation of text and a macro?

This is almost certainly a silly mistake somewhere. I'm essentially trying to do what is being done here. My MWE project: $ find ./ ./ ./common ./common/preambleCommon.tex ./mydoc ./mydoc/mydoc.tex ...