Linked Questions

24
votes
1answer
1k views

How can I color parentheses depending on the nesting level (like emacs' rainbow-delimiters)?

Is it possible to have a custom setup for lstlistings for LISP-like languages and have matching parentheses coloured with a same colour taken from a palette? What I am looking for is something like ...
18
votes
2answers
5k views

Simple way to multiply two values

I have a macro to define the scale of my figures: \newcommand{\myscale}{0.35} Now I have a figure that needs to be scaled twice as big, so I tried to use something like this: \begin{figure}[hbt] \...
10
votes
3answers
615 views

input tokens through the unicode position

With luatex I can inject tokens with a command through their unicode positions (see the following example). I'm wondering if this could be done with pdflatex too. It doesn't need to have all the ...
6
votes
4answers
1k views

Is there a better way to check divisibility in LaTeX?

I want to draw a trimmed ruler, for example, from 2.3cm to 3.9cm where the distance between two consecutive marks is 1mm. I have difficulty to efficiently check whether or not the counter is a ...
7
votes
1answer
1k views

Different headers/borders for each page

I'd like to apply a different heading/border for each page. The footers will all be the same. I want it to look like this: I can make the first two pages different but I don't know how to get ...
5
votes
1answer
2k views

Modulo calculation in PGFplots tick label

I am printing a diagram and want to use a_[0...3] as tick labels on the x-axis. Right now I have a[0...7] as labels and look for a way to print a[\tick mod 4] (i.e. a_0, a_1, a_2, a_3, a_0, a_1, a_2, ...
6
votes
4answers
195 views

Selecting grammatical form depending on programatically defined cardinal number (a la ngettext)

There are many languages where grammatical form depends on number of elements described. In English it is singular and plural form (plural usually but not always is generated by adding suffix 's', ...
6
votes
1answer
681 views

Is a page modulo 4?

If I want to test whether a page is odd/even (i.e. modulo 2) then I can use the following: \ifthenelse{\isodd{\thepage}}{}{} What can I do if I want to test whether a page is modulo 4? A minimal ...
1
vote
2answers
232 views

How to create pgfplotstable confusion matrix?

How to create pgfplotstable confusion matrix ? Situation I want to create a confusion matrix (for example like this), reading data from a file and displaying it flexibly. Moreover, I found these two:...
4
votes
2answers
63 views

Row Numbering for every n-th multiple

I'm working in a tabular environment. I am a writing a set of 20+ rows in the environment. At first, I was going to number each row (automatically). But then it occurred to me that I could just number ...
2
votes
2answers
65 views

Setting \thecounter to user-defined format

I'm trying to get my counter (which has a value between 1--4) to display as a character (namely, the corresponding char from the string SWOT). The following looks right to me but does not do the trick:...
3
votes
1answer
117 views

draw Sierpinski's triangle in Pascal's triangle in tikz (30 row or more)

I want to draw Sierpinski's triangle in Pascal's triangle in tikz for 30 rows or more but my code only works for 13 rows. \documentclass{article} \usepackage{tikz} \usepackage{pdfpages} \begin{...
3
votes
1answer
102 views

How can I change the margins of a page depending on its number with luatex?

For some reasons, I have a 100+ pages LaTeX document that I'm required to format the following way: if \thepage = 1 (modulo 4) then margins must be set to 5cm; if \thepage = 2 (modulo 4) then margins ...