New answers tagged

2

For MiKTeX the following sequence gives the desired result, as far as I understand your question (the command-line syntax for TeX Live seems to be a bit different, but I don't have a TeX Live system here to test): Scenario 1: The latex.fmt format file is already available Create a file mycalculator.tex with the following content: \RequirePackage{...


10

It's just part of the context, similar to l.2 which indicates line 2. At any given time, TeX may be reading either from a line in a file, from the terminal or one of the read streams, or from a token list it had constructed earlier (by reading from a file, for example) and saved. When printing out an error, TeX prints \errorcontextlines pairs of lines of ...


4

You're increase of the pool size lead to additional memory requirements. So you do not need any other changes to eTeX, you have to increase the provided memory. In your Javascript versions, the amount of memory is set in the "compiler". For your settings you would need 32906 pages of memory, but there is an impmentation limit at 32767 pages. Luckily you can ...


2

It is not related to \write really. \jobname is expandable and expands to the filename, \day is not expandable, it is like a count register, so you want \the\day to get the decimal value as an expansion.


4

Here's a LuaLaTeX-based solution, which doesn't require you to modify the existing "..." and '...' pairs of quotes. It consists of a Lua function called msq (short for 'make smart quotes') and two utility LaTeX macros which switch the Lua function on and off. \documentclass{book} \usepackage[english]{babel} % or some other suitable language choice \...


6

Replace at first the last quote with the editor and "Search and Replace" "<space> -> } Then repcae the first quote with " -> \enquote{ and then use always: \documentclass{article} \usepackage[french,ngerman,english]{babel} \usepackage[autostyle]{csquotes} \begin{document} \enquote{quote} \enquote*{quote} \enquote{quote \enquote{quote ...


1

This answer does not answer the question perfectly because not all input is processed as usual, which is what most of the other answers focus on. However, it seems that none of the other answers is perfectly satisfying either, mentioning that in some cases (like math mode) they can not guarantee to suppress the output. This answer takes a different approach, ...


10

This was originally the answer to Difference between TeX and LaTeX, so the wording may seem a bit off context to this question, but the message remains. Surprisingly all of those are kind of true. Here's a very brief summary to try to make things clear for you: TeX is a program, and is the underlying program in all of the TeX family. However TeX, as a ...


1

You can use the regular expression facilities of expl3. \documentclass{article} \usepackage{xparse} \ExplSyntaxOn \NewDocumentCommand{\iflengthTF}{mmm} { % regex from https://stackoverflow.com/a/23872060/923955 % with modifications for expl3 and for adding a unit \regex_match:nnTF { \A [+\-]? ((\d+(\.\d*)?)|(\.\d+)) \s* (pt|pc|in|bp|cm|mm|dd|cc|...


4

I'll try to explain this using quotes from the TeXbook. Summary When the main vertical list isn't empty at the point where the \end token is digested, TeX inserts the equivalent of \line{}\vfill\penalty-'10000000000 into the main vertical list, exercises the page builder and prepares to read \end again (TeXbook pp. 264 and 283). In your example, this \line{...


4

It is tex-the-program's final endgame to flush out the insert: tex.web has @ We don't want to leave |main_control| immediately when a |stop| command is sensed, because it may be necessary to invoke an \.{\\output} routine several times before things really grind to a halt. (The output routine might even say `\.{\\gdef\\end\{...\}}', to prolong the life of ...


3

Nothing better than doing an experiment. In TeX Live we find /usr/local/texlive/2012/texmf-dist/doc/fonts/yannisgr/rgrsc10.300gf and the corresponding tfm file. Upon running gftype, we read Character 0: dx 1376256 (21), width 524290 (20.75554), loc 8275 With tftopl rgrsc10, we read (CHARACTER O 0 (CHARWD R 0.500002) (CHARHT R 0.444445) (CHARIC ...


5

tl;dr: I do not think defining TeX-like registers from Lua is possible, but you can get a bit closer. Fixing \the is easy: You only have to trigger one level of expansion form Lua. You could try token.expand but that function has a unconventional understanding which token to expand. So it's easier to rely on the standard TeX tool to get one level of ...


7

The \unexpanded primitive is essentially an anonymous toks, which means no expansion _within an \edef or similar, whereas \noexpand explicitly changes the behaviour of the next token to be equal to \relax for one expansion. This is perhaps easier to see if we choose to typeset the results of the two: \documentclass{article} \begin{document} \newcommand{\...


5

Glue and penalties are discardable, so without the box the entire \nobreak\hfil\penalty50\hskip2em\nobreak\hfil sequence is discardable If the break happens at the p50 then you would have N Bourbarki (Paris) on the second line, so you get badness from stretching two word spaces to fill the line" But actually it takes the break after N. as that is ...


6

The problem is, as described in Frougon's very fine answer, that conditionals in TeX work in quite a peculiar way: when the test is evaluated true, \else...\fi will only disappear as a result of expanding \else, which removes everything up to the matching \fi (without expansion). When the test is evaluated false, everything up to \else (or \fi) will be ...


7

TeX makes two passes when breaks a paragraph into lines. At the first pass it tries to split it without any hyphenation, and if it fails then at the second pass it adds the possibility of hyphenation. In your case the second paragraph can be broke into lines at the first pass, but the combined three paragraphs cannot because of the first one. So, TeX makes ...


8

In your second example, when the \ifnum takes the first branch, TeX executes \def\foo\else..., which is quite problematic as we'll explain below. Things are similar when the other branch is taken: \def\bar\fi.... What happens precisely Let's take for instance the case where the \ifnum test is true. In this case, \foo gets defined, but not the way you ...


11

The information on that page is wrong (or at least outdated, all commands in latex2.09 that had an optional argument were fragile, but latex2e has been available since 1993...) the example in the question does not define an optional argument but if you change it so that it does, using the facility of \newcommand to define such an argument you will see that ...


29

The command you defined does not take an optional argument, it takes a delimited argument. If you do: \def\b[#1]#2{.#2.\bf #1} \b[one]two it will work fine, however if you remove the [one] TeX will throw an error: \def\b[#1]#2{.#2.\bf #1} \b two ! Use of \b doesn't match its definition. l.5 \b t wo ? because when you define a command with \def\b[...


3

Does the text say that with \hangindent=0pt \hangafter=1000 you don't get the “normal paragraph shape”? This code typesets the same paragraphs: \input plipsum \hangindent=0pt \hangafter=-1 \lipsum 1 \hangindent=0pt \hangafter=20 \lipsum 1 \parshape 1 0pt \hsize \lipsum 1 \bye What the text says is that the values to which the parameters are reset are ...


0

similar to a "timestamp" in mysql-databases MySQL and other database software have persistence as one of their primary features: today you may execute a statement like INSERT INTO ... and its effect remains when you access the database days or months later. Underneath, this is usually achieved by writing to some files, but this detail is hidden from you, ...


Top 50 recent answers are included