{tex-core} is for questions that are independent of formats and macro packages. Such questions usually relate to low-level TeX programming or the behaviour of TeX at an underlying level. Note that even Plain TeX is a format in itself; for questions about it, use {plain-tex}.

learn more… | top users | synonyms (1)

3
votes
1answer
61 views

Why can I not vsplit a parbox? (and fbox alignment, and unvbox syntax)

I was trying to experiment with the code in this answer: Breakable vboxes, and I got something I didn't expect; consider this MWE: \documentclass{article} \usepackage{lipsum} \usepackage{xcolor} % ...
1
vote
1answer
87 views

Why does LaTeX throw an error when I write _ in text mode

Why LaTex return error when I write _ in normal mode (not math mode). Why we have decided to return error, we couldn't just print _. I mean if we write _ in a normal mode it print _ and in normal mode ...
7
votes
3answers
235 views

How does (or, what happens when) Tex typeset(s) a line and linebreak?

I could not find references to this with a cursory search, so I thought I'd post a question; I'm aware this is probably discussed at length in the Tex book or similar, but unfortunately I don't have ...
3
votes
1answer
54 views

Variable scoping of edef definitions in a local group (inside an ifx conditional)?

Consider this MWE: \documentclass{article} \def\testswitch#1{ \def\isA{A} \def\firstOpt{#1} \edef\tmpstr{-init-} { % start local \edef\tmpstr{-loc defined-} } % end local ...
34
votes
3answers
792 views

What does the 'etex' package do, exactly?

I was creating a rather large LaTeX project, so I had to use many packages. This gave me an error No room for a new \dimen \newdimen \MPscratchDim while my editor(Kile) opened the file ...
16
votes
1answer
285 views

Semantics of negative glues

This question is about the semantics of glues like 0pt plus -1fill, where the coefficient in front of the fill is negative. The following minimal example shows my attempt to figure this out ...
26
votes
3answers
1k views

Mathematical description of TeX's infinite numbers?

TeX has things like infinitely stretchable spaces and infinitely bad penalties. Since Knuth is Knuth, I assume these are a carefully thought-out implementation of some well defined non-Archimedean ...
3
votes
1answer
37 views

Possible to run a handler / callback function, when a macro (\inputlineno) changes value/definition?

I was thinking about the debugging procedure I went through in How come the tilde ~ sometimes does not behave like non-breaking space? - basically, to find out where did the macro ~ change, I had to ...
6
votes
1answer
182 views

How do I implement a string buffer in TeX?

I've recently learned how to create a macro to iterate over a token sequence using \afterassignment and \let in TeX. Currently, I'm trying to apply this to a tokenization macro (where "tokenization" ...
0
votes
1answer
54 views

Automatic parsing/extraction of single-argument commands from input (for use in new environment)?

I'm not sure whether this is in principle possible, so let me try to explain; consider this MWE: \documentclass{article} \usepackage[showframe]{geometry} \usepackage{tikz} \usetikzlibrary{calc} ...
5
votes
2answers
45 views

Free - dereference - release - delete a newdimen length?

Somewhat similar to How to erase/delete a counter, I guess, but for \newdimen... So, consider the MWE: \documentclass{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} ...
1
vote
0answers
47 views

Untyped character at the end of chapter

Although there is no "f" typed, there exists a "f" character at the end of the chapter when pdf is created. What can be the problem? I can't find it! Even I delete all the text, and just type a ...
6
votes
1answer
69 views

Redefine @ for tabular inter-column specification within \makeatletter \makeatother

I need to use a tabular with a @ inter-column specification within a \makeatletter and \makeatother environment. I. e. I something like \makeatletter %code that uses @ as letter ...
2
votes
3answers
64 views

Legitimate “local variable” (argument) command in a macro raising “Undefined control sequence”?

Consider this MWE: \documentclass[varwidth,tightpage,border=1bp]{standalone} \usepackage{tikz} \begin{document} \begin{tikzpicture} \makeatletter \gdef\getMyInfoString{% \let\trfm\relax % ! ...
8
votes
1answer
185 views

Maximum number of counters am I allowed to make/have?

I'm currently working on generating the pentest-reports of the company I work for with tex. I came across the totcounter package which I use for the overview table of the findings. there i'm adding ...
0
votes
0answers
25 views

Protecting / escaping the # (number-sign/hash) in a callable macro? [duplicate]

Consider this MWE: \documentclass{article} \usepackage{tikz} % \gdef\myset{ %* \tikzset{ % mystyle/.style={rectangle}, mycode/.code n args={2}{% \typeout{YEAH! #1 #2} % }, } % end ...
7
votes
1answer
112 views

How do you define macros to toggle a character active and define a macro for it?

I'm experimenting with core tex in order to learn some basics. My goal is to define a shorthand environment which makes use of active characters. The general idea is to activate the used characters ...
2
votes
3answers
136 views

Left margin wider than right one

Why is the left margin wider than the right one? Each of them should be 1 inch wide: If you run TEX without modifying the plain TEX format, you get pages that are numbered at the bottom; and each ...
5
votes
1answer
104 views

Is there any way to disable automatic ('discretionary break') hyphenation, while allowing/forcing TeX to break some chosen words?

I have a large document with narrower paragraph width than regular (approx 5 average words long), and I want to disable hyphenation short of having the opportunity to allow hyphenation of chosen words ...
4
votes
2answers
91 views

Is it possible to control the minimum tolerance (allowed space between words)

I have learned to use \pretolerance and \tolerance but sometimes TeX decides to "compress" the broken line of text within the paragraph by simply using less space between the words on the line, and I ...
0
votes
1answer
34 views

White marks around leaders in PDF

Why are there white bars between the leaders and each of the rules in this code when compiled with LuaTeX to a PDF file? When compiled (with LuaTeX) to a DVI file no white bars can be seen. a \vrule ...
6
votes
1answer
81 views

Overlapping hboxes

How can I change the following macro to get a rule in hbox 2 that is just as wide as the text in hbox 1 and remove parameter #2? \def\m#1#2{ \leavevmode \hbox to#2{ \hbox ...
5
votes
2answers
115 views

Implicit \hfil at the end of each paragraph?

Why do Alpha \hfil\ Omega\par and Alpha \hfil\ Omega not flush "Omega" to the right?
3
votes
1answer
62 views

TeX commands and currency symbols

Why does the code \documentclass{memoir} \usepackage[latin1]{inputenc} \usepackage[danish]{babel} \usepackage[T1]{fontenc} \def£#1£{``#1''} \def€#1€{<#1>} \begin{document} Hi, £this£ is nice, ...
2
votes
3answers
83 views

eplain access to \li number

What is the best way to get the "marker" for the current item in a list in the eplain format? \numberedlist \li Here's an item \li And this is another and it's marker is: \marker \endnumberedlist ...
3
votes
3answers
101 views

Vertical line in \halign with interrow spacing - LaTeX error

\documentclass[12pt, russian]{article} \tracingall \tracingassigns=5 \tracingmacros=2 \tracingcommands=2 \tracingrestores=1 \tracingstats=0 \tracingoutput=10 \tracinggroups=10 \tracingonline0 ...
4
votes
2answers
131 views

Define a special verbatim commmand

To learn more about Plain TeX, I try to define a special verbatim command \verb{code}, which puts code inside braces. When there is no braces in code, It's easy. But when there are some balanced ...
14
votes
2answers
548 views

What is the difference between square brackets and curly brackets in a command invocation?

Pardon the naive beginner question. In a command like: \textcolor[HTML]{4C7045}{dark green text}, or \documentclass[12pt]{article}, or \begin{figure}[htb], why are some arguments surrounded by [] and ...
8
votes
5answers
256 views

Vertical alignment of text within a table cell

How can I move the text in the following table closer to the upper rule (or closer to the lower rule) without changing row height: {\halign {#\cr \hrulefill\cr \font\f=cmr8\f(bla bla bla)\cr ...
0
votes
0answers
38 views

How LaTeX format paragraph [duplicate]

When I write document I get always Underfull and Overflow warnings. I know what's does means this warnings. I want to know what LaTeX (TEX I guess) does to format a paragraph. I mean how it decides ...
4
votes
1answer
159 views

Non-latin characters with plain TeX

What would it take to output non-latin letters (e.g. cyrillic letters) to a document using just plain TeX (i.e. without using "third-party" macro packages such as LaTeX)?
15
votes
2answers
171 views

Multiple consecutive \par's equivalent to just one?

I think the answer to this question should be positive but I just couldn't find it answered elsewhere: Are multiple consecutive \par's the same as a single \par? For example, is \par\par the same as ...
1
vote
1answer
81 views

how do you put caption on figures in sweave

I have this sweave code. I need to add caption to the figures. I am doing this but it looks like I see the figure before the section{Data ANALYSIS}: \documentclass[letter,12pt]{article} ...
5
votes
1answer
55 views

Break page in \valign

Let's say I have a \valign like: \parindent=0pt \tabskip=\baselineskip \valign{& \hsize=.5\hsize\raggedright #\crcr Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod ...
1
vote
1answer
94 views

Drawing Circuits in LaTeX [duplicate]

What package should I use to draw these circuits? Is it circuitikz?
3
votes
3answers
154 views

ConTeXt: Prevent Reference Name Clashes in Floating Objects of Different Types

I find it very annoying that ConTeXt uses the same namespace for references of floating objects. In other words, if you give the same reference to a figure and a table, then you'd always refer to the ...
3
votes
1answer
61 views

Vector arrow running into brackets

This looks really horrible when I typeset it in Plain TeX: $$[\vec r]$$ \bye The vector arrow bleeds into the bracket on the right, it's not pretty at all. Is there a standard fix for this sort of ...
0
votes
0answers
113 views

Configuring command line editing for MiKTeX

I just started using MiKTeX 2.9. I set up the Makefile to produce the pdf and it works good. However, how do I set up command line editing of my .tex file. I have the downloaded the Emacs editor and ...
2
votes
2answers
76 views

Simulating directly typed text with \input

I currently have the following code written in Plain TeX: \loadtoks\END int main(void) { printf("Hello World! %!@#$%&*&^\n"); } \END {\tt\the\toks0} \bye The macro \loadtoks is ...
1
vote
0answers
76 views

How to convert isodate to x unit in pgfgantt

I'm trying to find a solution to my problem : How to draw vertical lines using pgfgantt package. So I decided to take a look to the package source code and I found this : \def\@tempa{none}% ...
15
votes
2answers
452 views

Why does `x_\text y` work?

As far as I have understand the tokenization in LaTeX, x_\text y will be split up into x _ \text y Now the _ will consume/bind to the next token. However, \text takes an argument as well. If _ ...
4
votes
1answer
95 views

Activating characters with diacritics (accents)

I want to create an environment that would convert all á to \=a, all é to \=e and so on... (short-hand for macrons) Something that should have been a five-minutes easy-to-write tool became a real ...
8
votes
1answer
64 views

Testing for macros by name

I'm curious to know how I would go about testing for macros by name. I need to do something that would be the logical equivalent of the following: \def\doit#1{% \if#1==\foo I got a foo\fi \if#1==\bar ...
0
votes
0answers
36 views

Compatibility with chessboard and xskak

When I try to use these pachages in my latex document (that has other packages as well) it throws me an error; do you know if I can solve this compatibility issues at all? A minimal working example ...
10
votes
2answers
169 views

Why is \newcount declared \outer?

I'm a user primarily of Plain TeX. Lately I get annoyed about the \outer nature of \newcount, especially when I write macros which require temporary internal variables, variables which really need not ...
0
votes
0answers
11 views

make one page 11x16 in middle of document? [duplicate]

So I am working on a report and I need to make a few of my report pages fold outs, thus 11x16 inches instead of the usual 8.5x11. How can I do this in tex?
8
votes
1answer
391 views

A bit of fun with logos: how to combine lines and letters in LaTeX (or just TeX)?

I was just having a bit of fun messing around with typesetting, and was able to produce a simple logo. However, it suffers from several issues that are illustrated in the MWE. I'm mainly just doing ...
17
votes
4answers
719 views

Which commands consisting of a non-letter eat spaces afterwards?

Command names consist of a sequence of letters (until and excluding the first non-letter) or of a single non-letter. Command names ending in a letter (including of course those consisting of a single ...
0
votes
1answer
37 views

Reduce the number of lines of a paragraph [duplicate]

How can I tell Latex that I want my paragraph with n less lines? I saw a question some days ago, but after twenty minutes of heavy searching (I think), I found nothing. There is a “penalty” or ...
12
votes
1answer
166 views

Hide ^^^^-notation from pdftex

The following example gives when compiled with pdflatex the error ! Text line contains an invalid character. \documentclass{article} \usepackage{ifluatex} \ifluatex \usepackage{fontspec} \fi ...