{xifthen} is for questions addressing issues related to conditionals.

learn more… | top users | synonyms

2
votes
1answer
43 views

Retrieving text from a “database text” file

I refer to my question and the solutions in String comparison in \ifthenelse I hope I can make my question clear enough, I am not a technician. I use a kind of database file (simple text file) with ...
4
votes
1answer
72 views

How to automate introduction of section titles in book

I'm using Spundun's method for automating inputing the entries in a diary, in turn inspired by Peter Grill (Using LaTeX to keep a diary), and I would like to add section dividers by year. This should ...
14
votes
2answers
361 views

String comparison in \ifthenelse

I want find a certain line of text in a data file cities.txt: A;London B;Berlin C;Paris with the xstring and [xifthen][2] packages: \documentclass[12pt, a4paper]{article} \usepackage{xstring} ...
5
votes
1answer
114 views

Using `ifthenelse` to combine two related functions into one

This question is based on Peter Grill's answer to "Table including rows of a master table".. The function PrintDTLTable was in Peter's original answer. I wanted a version that would run over all ...
5
votes
1answer
337 views

(x)ifthen in TikZ

I am searching for a way to conditionally handle some items in a TikZ \foreach specially using an \ifthenelse condition. However, the compiler responds ! Undefined control sequence. <argument> ...
7
votes
1answer
174 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 ...
8
votes
1answer
98 views

Compare the height of arguments

I'm trying to define a \newcommand with three arguments. I'd like to: compare the height of these arguments choose the largest height to create frames (with that height) around the arguments. ...
6
votes
2answers
199 views

How to select conditional text?

I've three variable statements : Statement1 = You are Great Student. Statement2 = You are average Student. Statement3 = You Need improvement on list of topics mentioned below. In the report ...
2
votes
0answers
22 views

Behavior of \global when used with xifthen package [duplicate]

I'm trying to calculate the sum of some numbers in my document. I want to allow non-integer values, so I'm using lengths, which works just fine. In my document it's often necessary to specify the ...
5
votes
2answers
127 views

Variable persist outside environment

I am using the ifthen package for some conditional formatting. I am storing state in some booleans, but it seems that there is an issue with lexical scope. In particular, when a boolean is set within ...
2
votes
1answer
142 views

Use result from pgfmath with xifthen

I try to use the results of pgfmath calculations with cnttest from xifthen, but it fails: \documentclass{article} \usepackage{pgf,xifthen} \begin{document} \pgfmathparse{42+77}% ...
5
votes
2answers
299 views

Boolean based environments

I know that this question is basically identical to that of Hide custom environment content based on boolean Except I want to avoid using the environ package, which, otherwise, would be the best ...
6
votes
2answers
274 views

How to extend a macro for e-mail addresses to support multiple arguments?

I prepared the following macros to format e-mail adresses in a e-mail header. \usepackage{xifthen}% Provides \ifthenelse and \isempty % E-Mail header strings with format. ...
4
votes
1answer
238 views

PGF loop variables in string comparisons

In a bigger context, I need to check whether an integer parameter is contained in a set of numbers. I decided to encode sets as strings; elements are separated by !. I don't know whether this is the ...
2
votes
2answers
336 views

Test equality between number of the current page and the one of one reference indicated

In the following code, I have one problem with the test \ifthenelse{\equal{\pageref{#1}}{\thepage}}{...}{...}. Why doesn't this detect the equality hoped if the reference is in the same page where it ...