{parsing} is the process of analysing a string of symbols, either in natural or computer language.
5
votes
1answer
67 views
Parsing a \$ as part of an improved \getargs command
As the author of stringstrings, I am acutely aware of its slowness. For small tasks, that slowness can be annoying. For larger tasks, it can be prohibitive.
Recently, in using data column as ...
35
votes
4answers
2k views
Is there a BNF grammar of the TeX language?
I'm looking for a BNF grammar of the TeX language, does it exist?
8
votes
1answer
3k views
pgfplot: Datafile format for datetime field
I have a datafile (which I may manipulate to any format), it contains a date-time stamp currently in the form "year-month-day hour:min" and a single variable for each recorded time.
When I attempt to ...
12
votes
2answers
661 views
Parsing files through LuaTeX
This question has two parts:
How would one generally parse a file with LuaTeX, assuming the file only holds data
that is delimited either by spaces, commas or semicolons.
How would you parse the ...
6
votes
2answers
787 views
Iterate over space-separated list
I’ll briefly explain the background in case this can be solved simpler but I’d still be interested in an answer to the actual question, too.
My chapter titles are very narrow and use a large font so ...
-11
votes
2answers
643 views
Stringified commands to macros sequence
First, what is the proper terminology for a "string" in TeX/LaTeX that is an argument for a macro? e.g., \macro{somestring} Obviously somestring is a token, set of tokens, string, argument, etc. I ...
3
votes
2answers
175 views
Shell script which parses .tex files for figures
I would like to pull all figures including captions out of multiple .tex files and write them into a single new .tex file. This means I have to parse for
\begin{figure}
. . .
\end{figure}
and ...
16
votes
5answers
415 views
Applying an operation only to capitals
I'd like to apply a function to capitals only so that:
\emphcaps{YaWeH}
Outputs like:
\emph{Y}a\emph{W}e\emph{H}
Preferably without using too many packages (I already use memoir).
NOTES: I use ...
11
votes
5answers
863 views
How do I write a macro having comma-separated and variable number of arguments?
I want to write a macro in LaTeX2e that can pass \textcolor, which is embedded in another macro, the values of the colour model gray, rgb, or cmyk. The number of arguments specified implies the colour ...
8
votes
2answers
2k views
What parsers for (La)TeX mathematics exist outside of the TeX engines?
Inspired by the author's motivation for asking Is there a BNF grammar of tex language.
Are there any well done libraries that can parse some subset of TeX mathematics independently of the TeX engine? ...
8
votes
2answers
497 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 ...
5
votes
1answer
129 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...
...
5
votes
3answers
175 views
Cartesian product of two lists as parameters for a command
Friends, I used to suffer a lot when had to iterate through elements of a list, but thanks to egreg's suggestion, I've been successfully using the etoolbox package for that task, e.g.:
...
2
votes
2answers
242 views
Time calculation for task reports
Consider this MWE:
\documentclass{article}
\newenvironment{dayreport}{\begin{tabular}{ll}\hline Task & Time\\\hline}{\hline\end{tabular}}
\newcommand{\task}[2]{#1 & #2\\}
\begin{document}
...
16
votes
4answers
1k views
Syntax of TeX/LaTeX
{} and [] do some kind of grouping, and comma seems to be special as well. Being a programmer I find it frustrating to use Latex on incantation-only basis. I would like to know how does it exactly ...
10
votes
1answer
307 views
Extract the logically first slide in a Beamer overlay specification?
When writing Beamer slides for a talk, I find that I often want to have some text (usually math) visible on a group of slides and be alerted on only the first slide in the group. For example, I can ...
6
votes
1answer
116 views
Is it possible to scan until the end of the current `\item`
I do a lot of itemize lists in beamer presentation which, in a later step, I want to format nicely, for instance, typeset everything up to the first colon in boldface and the remaining part scriptsize ...
6
votes
4answers
402 views
Parse a string into tokens of numbers and not numbers
I have a string that I want to parse into to numbers and non-numbers.
For my purposes:
A Number can EITHER be any sequential string of digits OR sequential string of digits with a . followed by ...
5
votes
2answers
97 views
Parsing leading hardspaces
This question is related to (but distinct from) this question: Parsing a \$ as part of an improved \getargs command, which I asked earlier.
I am experiencing a residual space in a string result from ...
5
votes
3answers
126 views
String parsing macro fails within custom cite command of biblatex?
I am trying to use the same string parsing macro as in String parsing macro fails within a minipage environment?; but this time in context of biblatex - and I'm having similar problems, I guess.
...
4
votes
1answer
232 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, ...
3
votes
2answers
659 views
In the siunitx package, how do i get it to produce uncertainties with the \pm symbol instead of parenthesis
Using the siunitx package, if I specify an error with the \pm symbol then it automatically converts it to a form using parenthesis. I would like it to not do this and keep the \pm symbol, but still ...