Difference between revisions of "Command/input"
< Command
Jump to navigation
Jump to search
(Add number of paragraphs) |
(clarified that the special parent-searching behavior of some file reference commands does not apply to \input.) |
||
Line 21: | Line 21: | ||
When no file extension is specified the extension ''.tex'' is assumed. | When no file extension is specified the extension ''.tex'' is assumed. | ||
+ | |||
+ | Unlike the case with project structure commands such as {{code|\project}}, {{code|\input}} will not cause ConTeXt to look in parent directories for the specified file (unless of course the given filename is actually a path beginning with {{code|../}} or the equivalent). | ||
== Example == | == Example == |
Revision as of 19:16, 24 March 2014
\input
Syntax
\input file | |
file | name of the file |
Description
The command \input filename
is replaced by the content of the text file filename
.
When no file extension is specified the extension .tex is assumed.
Unlike the case with project structure commands such as \project
, \input
will not cause ConTeXt to look in parent directories for the specified file (unless of course the given filename is actually a path beginning with ../
or the equivalent).
Example
We have two files, each containing a chapter:
% chapter-01.tex \subject{Chapter 1} This is the first chapter.
% chapter-02.tex \subject{Chapter 2} This is the second chapter.
The book file inputs both chapters:
% complete-book.tex \starttext % No extension specified, so .tex assumed \input chapter-01 \input chapter-02 \stoptext
Compiling book.tex
produces the following:
See also
- \ReadFile: Similar to
\input
but the filename is specified as an argument - \readfile: Similar to
\ReadFile
with additional options when file is not found. - \getbuffer: Get back the "formatted" content of a buffer.
- \typebuffer: Get back the content of a buffer as verbatim text.
- \typefile: Print a file verbatim
- \component and \environment for input commands with more descriptive names.
- Dummy text for other ways to produce filler text
Help from ConTeXt-Mailinglist/Forum
All issues with:
- input on the mailing list (all results)
- input on the mailing list (subject only)
- input on stack exchange
- input in ConTeXt's source
Default input files
ConTeXt includes a number of files that you can use with \input
when you quickly need some filler text.
filename | description |
---|---|
aesop-de.tex | 178 words: title and 2 paragraphs
Der L\"owe und die M\"ucke Eine M\"ucke forderte mit den \"uberm\"utigsten Worten |
bryson.tex | 111 words
Imagine trying to live in a world dominated by dihydrogen oxide, a compound that has no taste or smell and is so viable in its properties that it is generally benign but at other times swiftly lethal. |
cow.pdf | The famous cow |
davis.tex | 133 words
This nation, turning 100 years old, had no {\em Odyssey}, no St.~George slaying the dragon, no Prometheus. The emerging American genius for making a lot of money was a poor substitute for King |
dawkins.tex | 192 words
I used a similar illustration in one of my Royal Institution Christmas Lectures in 1991. I said I had reason to believe that among my audience was a psychic, |
demo-mps.tex | MetaPost demo |
demo-tex.tex | Example ConTeXt file |
demo-xml.tex | Example TeX/XML file |
douglas.tex | 204 words, 2 paragraphs
Donald Knuth has spent the past several years working on a system allowing him to control many aspects of the design of his forthcoming books, from the typesetting and layout |
hacker.jpg | The hacker logo |
hawking.tex | 81 words
If [in 2600] you stacked all the new books being published next to each other, you would have to move at ninety miles an hour just to keep up with the end of the line. Of course, by 2600 new artistic |
khatt-ar.tex | Arabic text.
قَالَ عَلِيُّ بْنُ أَبِي طَالِبٍ لِكَاتِبِهِ عُبَيْدِ اللّٰهِ بْنِ أَبِي رَافِعٍ: أَلِقْ دَوَاتَكَ، وَ أَطِلْ جِلْفَةَ قَلَمِكَ، وَ فَرِّجْ بَيْنَ السُّطُورِ، وَ قَرْمِطْ بَيْنَ الْحُرُوفِ؛ فَإِنَّ ذَلِكَ أَجْدَرُ بِصَبَاحَةِ الْخَطِّ. |
khatt-en.tex | 47 words
ʿAlī ibn Abī Ṭālib said to his scribe ʿUbaydullāh ibn Abī Rāfiʿ: your inkwell before you, sharpen the edge of your pen, make sure there is open space between the lines, and set your letter|-|spacing closely. Now {\em that} is the way to make the script shine! |
knuth.tex | 117 words, 3 paragraphs
Thus, I came to the conclusion that the designer of a new system must not only be the implementer and first large||scale user; the designer should also write the first |
linden.tex | 95 words
The warm water spills north and south through a series of ocean currents that mirror to some degree the cells in the atmosphere above the water. Like the atmospheric cells, for instance, these giant oceanic gears |
lorem.tex | 122 words
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur massa turpis, semper quis fringilla ut, viverra nec risus. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac |
materie.tex | 72 words. A list of tools, written in old Dutch.
Zaagh, of Steek||zaagh. Domme||kraght. Mokers. |
mill.png | Black-and-white photograph of a windmill |
montgomery.tex | 140 words
Making oil requires a specific series of geological accidents over inconceivable amounts of time. First, organic-rich sediment needs to be burried faster than it can decay. Then the stuff needs to get pushed |
reich.tex | 43 words. Every line is a quotation.
\quotation {Heavy smoke} \quotation {Stand by, stand by} \quotation {It's full a' smoke} |
sample.tex | 566 words. Table of contents of the directory. |
spider.eps | Spider! |
thuan.tex | 98 words
Had our solar system included two suns, the problem would have involved three bodies (the two suns and each planet), and chaos would have been immediately obvious. Planets would have had |
tufte.tex | 91 words
We thrive in information||thick worlds because of our marvelous and everyday capacity to select, edit, single out, structure, highlight, group, pair, merge, |
ward.tex | 57 words
The Earth, as a habitat for animal life, is in old age and has a fatal illness. Several, in fact. It would be happening whether humans had ever evolved or not. But our presence is |
weisman.tex | 53 words
Since the mid-1990s, humans have taken an unprecedented step in Earthly annals by introducing not just exotic flora or fauna from one ecosystem into another, but actually inserting exotic genes into the operating |
zapf.tex | 98 words
Coming back to the use of typefaces in electronic publishing: many of the new typographers receive their knowledge and information about the rules of typography |