Skip to content

Commit 6576ddf

Browse files
author
cranko
committed
Release request commit created with Cranko.
+++ cranko-rc-info-v1 [[projects]] qnames = ["tectonic_errors", "cargo"] bump_spec = "minor bump" [[projects]] qnames = ["tectonic_status_base", "cargo"] bump_spec = "minor bump" [[projects]] qnames = ["tectonic_io_base", "cargo"] bump_spec = "minor bump" +++
2 parents 4a951f0 + 10dcf43 commit 6576ddf

File tree

5 files changed

+134
-5
lines changed

5 files changed

+134
-5
lines changed

crates/bridge_flate/build.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,10 @@ fn main() {
1515
let mut header_path: PathBuf = outdir.into();
1616
header_path.push("tectonic_bridge_flate.h");
1717

18-
let mut config = cbindgen::Config::default();
19-
config.cpp_compat = true;
18+
let mut config = cbindgen::Config {
19+
cpp_compat: true,
20+
..Default::default()
21+
};
2022
config.enumeration.prefix_with_name = true;
2123

2224
let mut manifest_dir: PathBuf = env::var("CARGO_MANIFEST_DIR").unwrap().into();

docs/src/SUMMARY.md

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
# “V2” Command-Line Interface
1313

1414
- [`tectonic -X build`](v2cli/build.md)
15+
- [`tectonic -X compile`](v2cli/compile.md)
1516
- [`tectonic -X new`](v2cli/new.md)
1617

1718
# Concept Reference

docs/src/getting-started/first-document.md

+10
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ $ cd myfirstdoc
4646
it will become unnecessary and you’ll just be able to write `tectonic new`, but
4747
that changeover hasn’t happened yet.*
4848

49+
If you’ve got an existing TeX file, you can process it in in one-off fashion with:
50+
51+
```sh
52+
$ tectonic -X compile myfile.tex
53+
```
54+
55+
See [the `tectonic -X compile` documentation][cli-compile] for all of the options.
56+
57+
[cli-compile]: ../v2cli/compile.md
58+
4959

5060
## Basic document source structure
5161

docs/src/v2cli/compile.md

+105
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# tectonic -X compile
2+
3+
Compile a standalone TeX document.
4+
5+
***This is a [V2 CLI][v2cli-ref] command. For information on the original (“V1”
6+
CLI), see [its reference page][v1cli-ref].***
7+
8+
[v2cli-ref]: ../ref/v2cli.md
9+
[v1cli-ref]: ../ref/v1cli.md
10+
11+
#### Example
12+
13+
Generate `myfile.pdf` from `myfile.tex`:
14+
15+
```sh
16+
tectonic -X compile myfile.tex
17+
```
18+
19+
#### Usage Synopsis
20+
21+
```sh
22+
tectonic -X compile # full form
23+
[--bundle PATH] [-b PATH]
24+
[--chatter LEVEL] [-c LEVEL]
25+
[--color WHEN]
26+
[--format PATH] [-f]
27+
[--hide PATH...]
28+
[--keep-intermediates] [-k]
29+
[--keep-logs]
30+
[--makefile-rules PATH]
31+
[--only-cached] [-C]
32+
[--open]
33+
[--outdir DIR] [-o]
34+
[--outfmt FORMAT]
35+
[--pass PASS]
36+
[--print] [-p]
37+
[--reruns COUNT] [-r COUNT]
38+
[--synctex]
39+
[--web-bundle URL] [-w]
40+
[-Z UNSTABLE-OPTION]
41+
TEXPATH
42+
```
43+
44+
#### Remarks
45+
46+
This command compiles a freestanding TeX document, outside of the Tectonic
47+
[document][docs-ref] framework. It is virtually the same interface as the [“V1”
48+
command-line interface][v1cli-ref], with lots of options. In comparison, the V2
49+
interface is “[cargo]-like”, with a variety of subcommands anchored around a
50+
[Tectonic.toml] file defining a document to build.
51+
52+
[docs-ref]: ../ref/documents.md
53+
[cargo]: https://doc.rust-lang.org/cargo/
54+
[Tectonic.toml]: ./tectonic-toml.md
55+
56+
Basic usage of this command is often as simple as:
57+
58+
```sh
59+
tectonic -X compile myfile.tex
60+
```
61+
62+
This will compile the file and create `myfile.pdf` if nothing went wrong. You
63+
can use an input filename of `-` to have Tectonic process standard input. (In
64+
this case, the output file will be named `texput.pdf`.)
65+
66+
67+
#### Options
68+
69+
The following are the available flags.
70+
71+
| Short | Full | Explanation |
72+
|:------|:--------------------------|:-----------------------------------------------------------------------------------------------|
73+
| `-b` | `--bundle <PATH>` | Use this Zip-format bundle file to find resource files instead of the default |
74+
| `-c` | `--chatter <LEVEL>` | How much chatter to print when running. Possible values: `default`, `minimal` |
75+
| | `--color <WHEN>` | When to colorize the program’s output: `always`, `auto`, or `never` |
76+
| | `--format <PATH>` | The name of the "format" file used to initialize the TeX engine. Default: `latex` |
77+
| `-h` | `--help` | Prints help information |
78+
| | `--hide <PATH>...` | Tell the engine that no file at `<PATH>` exists, if it tries to read it |
79+
| `-k` | `--keep-intermediates` | Keep the intermediate files generated during processing |
80+
| | `--keep-logs` | Keep the log files generated during processing |
81+
| | `--makefile-rules <PATH>` | Write Makefile-format rules expressing the dependencies of this run to `<PATH>` |
82+
| `-C` | `--only-cached` | Use only resource files cached locally |
83+
| | `--open` | Open the output PDF after it is built |
84+
| `-o` | `--outdir <OUTDIR>` | The directory in which to place output files. Default: the directory containing INPUT |
85+
| | `--outfmt <FORMAT>` | The kind of output to generate. Possible values: `pdf` (the default), `html`, `xdv`, `aux`, `format` |
86+
| | `--pass <PASS>` | Which engines to run. Possible values: `default`, `tex`, `bibtex_first` |
87+
| `-p` | `--print` | Print the engine's chatter during processing |
88+
| `-r` | `--reruns <COUNT>` | Rerun the TeX engine exactly this many times after the first |
89+
| | `--synctex` | Generate SyncTeX data |
90+
| `-V` | `--version` | Prints version information |
91+
| `-w` | `--web-bundle <URL>` | Use this URL find resource files instead of the default |
92+
| `-Z` | `-Z <UNSTABLE-OPTION>` | Activate experimental “unstable” options |
93+
94+
#### Unstable options
95+
96+
The following unstable options may be available. As the name aims to indicate,
97+
the set of unstable options is subject to change at any time.
98+
99+
| Expression | Explanation |
100+
|:-------------------------|:------------|
101+
| `-Z help` | List all unstable options |
102+
| `-Z continue-on-errors` | Keep compiling even when severe errors occur |
103+
| `-Z min-crossrefs=<num>` | Equivalent to bibtex's `-min-crossrefs` flag. Default vaue: 2 |
104+
| `-Z paper-size=<spec>` | Change the initial paper size. Default: `letter` |
105+

src/engines/mod.rs

+14-3
Original file line numberDiff line numberDiff line change
@@ -779,10 +779,21 @@ pub extern "C" fn input_getc(es: &mut ExecutionState, handle: *mut InputHandle)
779779

780780
match es.input_getc(handle) {
781781
Ok(b) => libc::c_int::from(b),
782-
Err(Error(ErrorKind::Io(ref ioe), _)) if ioe.kind() == io::ErrorKind::UnexpectedEof => {
783-
libc::EOF
784-
}
785782
Err(e) => {
783+
if let Error(ErrorKind::Io(ref ioe), _) = e {
784+
if ioe.kind() == io::ErrorKind::UnexpectedEof {
785+
return libc::EOF;
786+
}
787+
}
788+
789+
if let Error(ErrorKind::NewStyle(ref ns), _) = e {
790+
if let Some(ioe) = ns.downcast_ref::<io::Error>() {
791+
if ioe.kind() == io::ErrorKind::UnexpectedEof {
792+
return libc::EOF;
793+
}
794+
}
795+
}
796+
786797
tt_warning!(es.status, "getc failed"; SyncError::new(e).into());
787798
-1
788799
}

0 commit comments

Comments
 (0)