0
votes
1answer
38 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} ...
14
votes
2answers
490 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 ...
6
votes
2answers
59 views

Different Behaviors Digesting \csname x\endcsname and Digesting \x (expansion issue)

This question has been significantly EDITED, as I learned more of the problem. If I was good, I would be able to create macros with multiple optional arguments, but not only can't I, but in this ...
2
votes
1answer
133 views

How to check if token is a macro?

I am thinking about possibility to parse LaTeX document. What I really need is to track category codes of symbols. As I understand TeX expands all of macros in his mouth and tracks changes of category ...
6
votes
1answer
189 views

Arbitrary text parsing from a separate file

I'm still very new to the world of TeX, so please bear with me if this question is unclear or has been asked before. I'm starting to figure my way through TeX and the millions of plugins and ...
13
votes
1answer
147 views

What is considered a token for non-standard input encodings?

When I use an input encoding to (La)TeX that allows me to directly input characters such as é and ä (such as by declaring \usepackage[utf8]{inputenc}), how is a token defined? Specifically, is it ...
4
votes
1answer
439 views

String parsing macro fails within a minipage environment? [closed]

I am trying to work with a string parsing macro, found in the answer of TeX capacity exceeded while parsing a date string - TeX - LaTeX. Basically, I have strings num01, num02... num09 - from these, ...
5
votes
1answer
172 views

How to skip an `\item` entirely, with no side-effects?

In Ryan Reich's great answer to my question on onlyitems, he had LaTeX ignore an \item by setting it into a box and then not using the box, effectively discarding it: ...SNIP... ...
9
votes
2answers
668 views

\def taking next word as argument?

This question is a variant of my previous question requesting a macro that takes the rest of the line as argument. I would like to write a macro that would take the next word as argument, where word ...