3
votes
2answers
167 views

Checking in LaTeX for a specific character?

I have a LaTeX problem that I cannot solve by myself. I have a repeating arrangement of characters which I want to format automatically in LaTeX. 1H-NMR (400 MHz; DMSO-d6): \textdelta 12.41 (s, ...
4
votes
2answers
459 views

How to detect words starting with # in listings package?

I am writing some code with the listings package and I need to detect the words starting with the number sign (#) and apply certain style. For example, if I have this code: something #foo ...
12
votes
2answers
2k views

Check if a string contains a given character

I want to implement an if-then-else depending on whether the argument contains a special character or not. Should I be looking here: http://www.tug.org/TUGboat/Articles/tb28-1/tb88glister.pdf, or does ...
5
votes
1answer
371 views

biblatex: What's the first character of a field?

I would like to know, what's the first character of the value of the editor field. If the character is a curly bracket "{" the value should be printed for example bold, if the first character is ...
4
votes
2answers
701 views

Compare a character to a character code?

How can one compare a character (e.g. "U") with a character code in a certain font (e.g. "\char85"). I'd expect the following to work: \documentclass{article} \usepackage{ifthen} \begin{document} ...