Skip to main content

Questions tagged [ifthenelse]

\ifthenelse{⟨test⟩}{⟨then clause⟩}{⟨else clause⟩} evaluates ⟨test⟩ as a boolean function, and then executes either ⟨then clause⟩ or ⟨else clause⟩. ⟨test⟩ is a boolean expression using the infix connectives, \and, \or, the unary \not and parentheses \( \).

2 votes
2 answers
104 views

This is a follow up to my previous post about arithmetic operations and tikz I would like to performance floating point arithmetic & boolean operations in conjunction with \ifthenelse. Here is a ...
underflow's user avatar
  • 1,099
3 votes
2 answers
129 views

Is there a way to add arithmetic operations to \ifthenelse statements? Here is a minimal (non)example: \documentclass{amsart} \usepackage{tikz, ifthen} \begin{document} \begin{tikzpicture} \...
underflow's user avatar
  • 1,099
0 votes
2 answers
54 views

I created \ifCond1 and \ifCond2 with \newif. If I want to test one condition, I use \ifCond1 Condition 1 OK \else Condition 2 KO \fi. My question : is there a way to use \ifCond1 and \ifCond2 glued ...
user1771398's user avatar
3 votes
2 answers
116 views

I write exam questions in Latex. I defined parameters and use \pgfmathsetmacro to do the calculation and print the result. This makes it easy to just change the values to generate a different question....
Jun's user avatar
  • 93
5 votes
2 answers
333 views

I am preparing materials for my students, and I would like to leave some blanks for them to fill in. For this, I want to define a new command — let’s call it \answerline — to be used like this: Dog ...
Mikhail Stolpovsky's user avatar
2 votes
2 answers
190 views

Edit: The previous edit removed the extra line in my command definition, but it turns out that this was the actual problem and not that there were mismatches in argument types being passed between ...
H. Pecoraro 's user avatar
2 votes
1 answer
71 views

My problem is whether or not to show the lower part of a tcolorbox based on a conditional statement that takes a given argument. I'm wondering: Why doesn't the conditional statement work? I've checked ...
antonio de la rosa's user avatar
0 votes
1 answer
73 views

I am not sure that the result of this code is the most appropriate for the nodes of points P and Q. What is the mistake made? \documentclass{article} \usepackage{tikz} \usetikzlibrary{calc} \...
Paco Robledo's user avatar
2 votes
2 answers
88 views

I'd like to generate a table with some random content. Ideally, I would have lines like a & b & c where I produce a; and sometimes b is a random number and c is blank; and sometimes b is blank ...
user1451632's user avatar
3 votes
1 answer
93 views

Consider the following MWE: \documentclass{article} \usepackage{fullpage} \newcounter{question} \renewcommand{\thequestion}{\Roman{question}} % see https://tex.stackexchange.com/a/729773/10898 \...
azetina's user avatar
  • 30.9k
2 votes
3 answers
241 views

I would like to draw a Riemann sums plot where the bars are graphed based on the heights of each pair of consecutive intervals. The issue will be with the ifthenelse statement as I do not think the ...
Garth Fleming's user avatar
3 votes
3 answers
261 views

I am working on project from which I want to produce both an answer key and a solutions manual to a long list of questions (I am also producing the problem sheet from this project as well). The ...
Benny Wang's user avatar
0 votes
1 answer
84 views

I'm trying to make a comparison in Latex with data imported from a CSV file. Unfortunately, the comparison doesn't work (or gives wrong result) when variable is assigned a value from CSV file even ...
Chris Peh's user avatar
  • 321
3 votes
3 answers
216 views

After an embarrassing amount of attempted research and trial and error, I've landed on the following code that works as expected. If the current year is 2024, it says "They match!". If it's ...
Ben Grossmann's user avatar
0 votes
0 answers
102 views

I have an Excel file which is created when the user inputs for a quote creation. E.g. in cell "D3" you find the company name, in cell "D11" the expiry date of the quote. Table ...
Chris Peh's user avatar
  • 321

15 30 50 per page
1
2 3 4 5
17