Skip to main content

Questions tagged [conditionals]

{conditionals} is about macros like \if and \ifx that may execute other macros depending on whether certain conditions are true or not. Popular packages are {etoolbox} and {ifthen}.

3 votes
2 answers
128 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
53 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
1 vote
0 answers
29 views

In the following MCE, bibliographic references are grouped by year, with a bibheading for each year (an unnumbered section indicating the year in question). \documentclass{article} \usepackage{...
Denis Bitouzé's user avatar
2 votes
1 answer
65 views

I would like to conditionally add text (for example, "- Answers") to my exercise sheet title based on the global solution/print option set in \xsimsetup. My goal is to have the title change ...
Aymane Fihadi's user avatar
8 votes
4 answers
330 views

I’m trying to recreate a figure from Roger B. Nelsen’s Proofs Without Words: Exercises in Visual Thinking—specifically “Sums of Squares V” (Integer Sums, p. 81). My code gets everything right except ...
Richard's user avatar
  • 187
2 votes
1 answer
56 views

I want to print a 'normal' and an annotated bibliography from the same .bib file. Both documents need to have the same custom style (not pictured in the MWE), so I used the method in: Print and format ...
Pedro's user avatar
  • 33
0 votes
2 answers
86 views

I'm writing my first LaTeX class. After some research I've found that kvoptions seems to be the most recommended for key value class options, and etoolbox is recommended over ifthen for conditionals. ...
jemhop's user avatar
  • 21
5 votes
1 answer
116 views

I'd to be able to set a value at the start of my document that sets in which chapters examples will have solutions. My attempt at this is as follows. \newcommand{\solutionsupto}{2} \newenvironment{...
thecloisterbell's user avatar
0 votes
1 answer
101 views

Background: I want to create a multiple choice exam in two versions, where the order of the choices differ. That is, both versions have the same questions and a list of answer options, but these ...
Bernd's user avatar
  • 1,905
3 votes
1 answer
133 views

I would like to define two switches such that this code \begin{document} \A This is text A Some more text A \B some text B \A again some text A \end{document} produces the following output: This is ...
user2026844's user avatar
10 votes
2 answers
228 views

I have come across the following oddity. Consider this example: \catcode`!=\active \let~=\empty \ifcat\noexpand~\noexpand! yes\else no\fi \let~=\relax \ifcat\noexpand~\noexpand! yes\else no\fi Why ...
plante's user avatar
  • 2,097
1 vote
0 answers
67 views

This question is related to one of my previous questions: Specifying exact placement of answers in exam tests I would like to make exam tests that can be compiled without and with answers, and the ...
bcsikos's user avatar
  • 879
2 votes
1 answer
101 views

I have a custom .sty file that has an option, "slides", for including packages and commands specific to beamer documents. Here's how it's structured: \NeedsTeXFormat{LaTeX2e} \...
Deniz's user avatar
  • 53
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
1 vote
2 answers
110 views

EDIT: As Skillmon pointed out in the comments: "If you input your file multiple times you're adding stuff to your sequences every time you input it (since you don't disable your \quan-macro on ...
math_inquiry's user avatar

15 30 50 per page
1
2 3 4 5
128