All Questions
Tagged with ifthenelse expansion
8 questions
1
vote
2
answers
147
views
LaTeX3 version of expandafter-ifx-csname?
I currently have this code from a previous question (link here)
\NewDocumentCommand \IfFontTF {mmmmmm}
{%
\begingroup
\fontencoding{#1}\fontfamily{#2}\fontseries{#3}\fontshape{#4}\try@load@...
0
votes
2
answers
108
views
How to check that something starts with * (or how to build your own exercise sheet from a moodle database)
I would like to check if something starts with an asterisk (*)
My attempt:
\def\testast#1{\ifx*#1\relax YES\else NO\fi}
But the output of \testast{*Word} is WordYES while I would expect just YES
The ...
1
vote
1
answer
60
views
Problem expanding arguments
I have a problem of understanding how expanding works.
I have been reading several posts but none of them solve my problem.
I have been trying to do something like this:
\documentclass{article}
\...
1
vote
1
answer
173
views
Check for empty tex file to decide ifthenelse branch
Objective:
I am trying to key on on the presence of file content (comments are acceptable, I am trying to key in on content that would be displayed in the built PDF) to determine what path to take.
If ...
1
vote
2
answers
688
views
Why does \ifdim work here but \if doesn't?
I'm very new to LaTeX, and need to compare a length I've defined with a default value (and set another length accordingly). Consequently, I'm exploring the murky (to me anyway) world of LaTeX ...
0
votes
1
answer
203
views
Protect fragile variable in file path. Case of \ifthenelse in \includegraphics{}
In this script:
\documentclass{article}
\usepackage{ifthen}
\usepackage{graphicx}
\newcommand{\myfigure}[1]{% ...
1
vote
2
answers
426
views
Expanding a macro as the argument to \input results in undefined control sequence error
I'm creating a package which defines a command that looks something like this:
\newcommand{\mycommand}[2]{
\input{|"\mypackage@buildcommand{#1}{#2}"}
}
mypackage@buildcommand uses the ifthen ...
10
votes
2
answers
1k
views
How do I perform an expandable string comparison?
I need to perform a string comparison (string equality). If the macro is non-expandable (e.g. contains \def or \let), it causes problems in the place where it is used.
I tried using \ifthenelse from ...