{parsing} is the process of analysing a string of symbols, either in natural or computer language.

learn more… | top users | synonyms

2
votes
1answer
110 views

Parsing some buzzwords in the Latex document and replacing them by link possible?

Is it possible to parse teh whole document automatically, looking for buzzwords, which I will maintain in a special list, and replacing the buzzwords by links to a predefined page e.g. a glossary?
5
votes
1answer
165 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... ...
3
votes
2answers
446 views

Split long string into paragraphs

How can I test a string to see if it has more than one paragraph, and split a string that contains multiple paragraphs into two strings, one with the first paragraph of the original, one with the ...
3
votes
2answers
1k 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 ...
5
votes
1answer
728 views

Generate a parse tree for TeX

If I google for parse tree and TeX. All I'm getting are how to draw parse trees in TeX. I want to know if there are programs that can parse TeX, and output a parse tree that's easy to manipulate.
5
votes
3answers
210 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
310 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} ...
7
votes
2answers
412 views

Formatting crystallographic indices

I would like to make a command in LaTeX that can be used like this: \zoneaxis{1 2 -3} \zoneaxis{2 -1 -1 10} and would produce this: $[1\,2\,\overline{3}]$ $[2\,\overline{1}\,\overline{1}\,10]$ ...
13
votes
5answers
1k 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 ...
12
votes
2answers
798 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 ...
9
votes
2answers
643 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 ...
7
votes
2answers
942 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
1answer
4k 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 ...
5
votes
4answers
1k views

LaTeX parser to perform operations on tags (commands) and its content?

Is there a LaTeX parser available that can be run from a (*nix) command line, and that allows operations on LaTeX tags/commands and its content? What I am trying to do is, for example: script-wise ...
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? ...
46
votes
4answers
3k views

Is there a BNF grammar of the TeX language?

I'm looking for a BNF grammar of the TeX language, does it exist?
13
votes
5answers
863 views

Parse comma-separated list of command names with spaces

Problem This question is related to How can I specify a long list of math operators? – but with a twist: I want to allow spaces in in the comma-separated list, like so: \newacronyms{acm, ams, cpu, ...
16
votes
4answers
2k 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 ...