# Tag Info

## Hot answers tagged terminal-output

26

You can modify the texmf.cnf variables error_line and max_print_line, adding to the "local" texmf.cnf file, whose location depends on the distribution you're using; for TeX Live it is /usr/local/texlive/2011/texmf.cnf and the lines to be added are max_print_line=1000 error_line=254 half_error_line=238 The first number is actually arbitrary, but 1000 ...

19

Something like this? (Actually stolen from tcolorbox manual and slightly changed ;-)) A verbatim input environment is necessary in my point of view, so a listings etc. style approach might be very convenient. The tcolorbox wrappers of listings provide nice features to improve the look of the surroundings of a listings environment. Use the every listings ...

14

In MiKTeX you can use the option --max-print-line=140 to get longer log lines. This will also affect the output in the command line window but only if have enlarged it before.

12

This has nothing to do with \typeout except insofar as its argument is fully expanded because of \write, as you noted. You could ask the same of \edef, and the answer would be to use a sufficiently elaborate combination of \expandafter, \noexpand, and \unexpanded to force each token to expand the desired number of times. For example: *\def\a{\b} \def\b{\c}...

11

From LuaTeX Reference, beta 0.70.1, section 2.3 UNICODE text support: Output to the terminal uses ^^ notation for the lower control range (c < 32), with the exception of ^^I, ^^J and ^^M. These are considered 'safe' and therefore print-as-is. And in the manual are the terminal/log explicitely excluded for process_output_buffer: 4.1.3.2 ...

11

There are two issues: LaTeX has assigned catcode 15 for character ^^1b (decimal 27). The use of ^^1b triggers then the error message: ! Text line contains an invalid character. Thus the catcode for the character needs to be changed (see the example below). TeX usually prints control characters with the ^^-notation. TeX compilers can have command line ...

10

The command tex '\empty {Hello World!}\bye' only works on a Unix-like terminal, for Windows command prompt, the ' characters has to be replaced by " double quotes, it is tex "\empty {Hello World!}\bye" In either case, a file called texput.dvi is generated, if pdftex is used, the file will be called texput.pdf then. This is basically a test whether ...

10

As @egreg says, it looks like a bug to me. For writing to files you can modify a lua callback but unfortunately the callback (as documented) is not called when writing to the terminal. \edef\foo{\string\^^M} {\catcode\^=12 \directlua{ callback.register( "process_output_buffer", function (s) snew, n = string.gsub(s,"\string\r","^^M") return snew end) }} ...

10

The best way is outlined in Passing parameters to a document, which should be better known. If the document starts as \ifcase\flag\relax <what to do when \flag=0>\or <what to do when \flag=1>\or <what to do when \flag=2>\or ... <what to do when \flag=n>\else <what to do otherwise>\fi we are free to choose among ...

9

{\uccodeA=97 \uppercase{\typeout{== A ==}}} will typeout the character with character code 97

7

LaTeX is always run from the command line: An editor simply enters the command for you when you hit the button. Most tex editors will even allow you to customize what command you send. Given this, you don't need to write your file on the command line. Simply write and save the file as normal. Then open a command line, and go to the directory you saved it ...

7

This is not garbage, but very important information. All text files that are input are recorded, along with the image files that are imported and included in the final PDF. A .fd file contains the necessary info to use a font; in your case t1cmss.fd contains the information for European Modern Sans (T1 encoding) and t1fi4.fd is for Inconsolata. TeX has no ...

6

This space is, as far as I know, impossible to avoid between two separate \messages. The solution would be to first combine all the contiguous material in one macro (adding material with \edef\foo{\foo <material>}), and then doing \message{\foo}. To really know where the space comes from, look in tex.web, documented source code of TeX. The relevant ...

6

If you actually want to generate the error in an expansion only context such as a \write or a PS \special the usual way is just to use an undefined command such as \ERROR You can not trigger any other error from there (and LaTeX3 can't really change that). ! Undefined control sequence. l.1 ...ptingToCallUndefinedPropertyunknownproperty \documentclass{...

5

You shouldn't invoke latex (or pdflatex) from the folder that contains the executables, because that folder is (or at least should be...) writeable only by root. Thus, latex has to crash because it can't create the .log, .aux, and .pdf (or .dvi) files to the executables folder. You may verify this by typing sudo ./latex /Users/fluid/Desktop/sample.tex ...

5

XeTeX is the engine. LaTeX is the format. When you compile with xetex, the LaTeX format is not loaded so things like \documentclass are not defined. You can compile this way if your document is not using LaTeX but plain TeX. The executable is the same, but the name you call it by matters. This is because the executable tests to find out what name it has ...

4

I'm not sure if this exactly what you need, but with help of grep you can do something. Let's say I want to compile my tex file via terminal. pdflatex Untitled.tex does the job. However, I can pipe the output of this into grep and use color feature of grep to highlight a word (in this example "pdf") pdflatex Untitled.tex | grep -E --color "pdf|$" The ... 4 If you have hex value rather than the ascii code value then you can use ^^61 to represent a. The hex digits have to be in lowercase (for the letters a-f). If you have only the ascii code number then you have to build your own table (if you want to mix such output with other material) or use the ingenious trick with \uccodeby David, but the latter doesn't ... 4 \show uses the same internal routines that TeX employs for error messages. Judging now this may seem a design error, but one always has to keep in mind that TeX was released in 1982, when computer memory was quite scarcer than it is today. A front-end like Texmaker could, in principle, distinguish between diagnostic messages given by \show (or \showthe) and ... 4 You can either redirect all of the pdflatex output: for sh: pdflatex ... > /dev/null 2>&1 for cmd: pdflatex ... > NUL 2>&1 Or you can use the -quiet option: pdflatex -quiet ... 4 .ins and .dtx are source files, they are usually sorted into the source subtree of a TDS tree (texmf/source/latex/babel/babel.ins). The files in a TDS tree are organized in such a way, that source, documentation files are not searched, when TeX looks for its input/package/class files. This reduces the search space and makes file look-up faster. But on the ... 4 Edit to follow up on OP's modifications. Perhaps this will be ok with your yet to be precisely specified yet unknown constraints: \documentclass{article} \newcommand{\mymessage}[1]{\bgroup\escapechar-1 \typeout{\detokenize{#1}}\egroup} \begin{document} \mymessage{foo\#bar\!foo\%hello\&world} \end{document} produces: foo#bar!foo%hello&world ... 4 This works for me: \documentclass{article} \gdef\company{ Company name ABCDEF } \begin{document} \typeout{\company} \end{document} 4 Knitr can show not only outputs from R, but also from another engines. May be this is not the ideal approach to mimic a real screenshot, but can show the true outputs of a bash shell typing only the commands. \documentclass{article} \usepackage{xcolor} %\usepackage[black]{sourcecodepro} \begin{document} \section*{Top Linux utilities:} \subsection*{... 3 Per @phg's suggestion, I'll post this answer on his behalf: if running a posix compliant system, try rlwrap tex; that indeed keeps record of keys typed on TeX's command line without linking it to readline. Your (pdf)latex is very likely simply a symlink to the pdftex interpreter, which is actually what runs under the hood. Having that in mind, from @phg's ... 3 I'm answering to remove this question from the unanswered queue. You should set TeX-show-compilation to t. You can do that by adding the following code to your .emacs: (setq TeX-show-compilation t) 3 one way i've found involves using \write18. i created a bash script: #!/usr/bin/env bash echo -e "\x1b$*\x1b[0m" and then in my TeX i do \immediate\write18{esc "[38;05;54mhelo Indigo"} in other words, i 'outsourced' printing the problematic \x1b escape character. now i wonder whether there's a solution that does not include an external script.

3

Well, here is a partial answer - does everything, (except I don't know how to output ASCII code as character on terminal in Latex (\char apparently typesets, and it's not expandable, so cannot be used in \typeout) EDIT: Fixed thanks to uccode trick by @DavidCarlisle in comments.), except the "reverse lookup". (EDIT2: See also the texref tool (not the ...

3

The texio library provided by luatex provides more control over message formatting and does not insert a space: \def\mymessage#1{\directlua{texio.write("\luaescapestring{#1}")}} \mymessage{.}\mymessage{.}\mymessage{.} \bye The result is: grendel:io sharpie\$ luatex io.tex This is LuaTeX, Version beta-0.60.2-2010071218 (TeX Live 2010) (rev 3736) (./io.tex....

3

From the comments received so far, and my own conclusions after reading the LuaTeX manual, I'm now convinced that the log file cannot be read reliably from lua code being run in the same document whose log file I'm trying to read. Opening that file from lua and reading with file.read() is not reliable because the same file is open and being written in by ...

Only top voted, non community-wiki answers of a minimum length are eligible