Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
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@...
Vincent's user avatar
  • 5,801
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 ...
user126154's user avatar
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} \...
user220299's user avatar
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 ...
rmrf's user avatar
  • 13
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 ...
tobriand's user avatar
  • 123
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]{% ...
Viesturs's user avatar
  • 8,255
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 ...
potato's user avatar
  • 111
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 ...
Suzanne Soy's user avatar
  • 3,073