Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [protected-macro]

The tag has no usage guidance.

7
votes
1answer
47 views

Use of \noexpand in the implementation of \TextOrMath for eTeX

In latexrelease 2015/01/01, there are two implementations of \TextOrMath: one for regular TeX, the other one for eTeX-like engines (more precisely: those which support \protected). My question ...
2
votes
1answer
43 views

How to change zero to dotted zero in an enumitem label?

MWE \documentclass[a4paper,11pt]{book} \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \usepackage{lmodern} \usepackage{enumitem} \makeatletter \protected\def\pmzerodot{% \nfss@text{% \sbox0{...
0
votes
1answer
41 views

Protect fragile variable in file path. Case of \ifthenelse in \includegraphics{}

In this script: \documentclass{article} \usepackage{ifthen} \usepackage{graphicx} \newcommand{\myfigure}[1]{% ...
9
votes
2answers
245 views

What is the difference between \unexpanded and \protected in ConTeXt?

EDIT: It turns out that \unexpanded in ConTeXt is different from \unexpanded in ε-TeX, so the earlier description doesn't apply. I'll update the question accordingly. From the ε-TeX manual: ...
1
vote
1answer
98 views

authblk with protected commands and pdflatex

When trying to use this answer to add a linked image to an author with the authblk package, somehow all the following text is shifted, with pdfLaTeX: \documentclass{scrartcl} \usepackage{scalerel} \...
1
vote
1answer
61 views

passing a parameter to nested macro inside caption

I'm having a really hard time understanding this error in a massive document. I took the time to work out a "minimal example", so I could post the error with precision. Please, when trying to answer, ...
0
votes
0answers
11 views

Extra White Space after iftenelse in Title [duplicate]

To begin, here is a MWE: \documentclass[12pt]{article} \usepackage{float} \usepackage{tikz} \usepackage{subfig} \usepackage{ifthen} \begin{document} \newcommand{\titlename}[1] { \ifthenelse{\...
2
votes
0answers
98 views

Automatically `\protect` arguments sent to existing command

Say you are using titlecaps and you have the following code: \documentclass{article} \usepackage{titlecaps} \begin{document} \def\makemytitle#1{{\Large \titlecap{#1}}} \makemytitle{The lazy fox ...
1
vote
1answer
100 views

\protect vs \texorpdfstring in description lists' keys

I'm referring to chapters and sections in a description list. I want the link to include the chapter or section part as well. I found two options to achieve this: use \protect or use \texorpdfstring. ...
3
votes
1answer
53 views

New command within glossaries ›first‹ needs to be protected?

Consider following MWE \documentclass{scrartcl} \usepackage{xspace} \makeatletter \newcommand\BC{\,v.\,Chr\@ifnextchar.{}{.\relax\@\xspace}} \newcommand\AD{\,n.\,Chr\@ifnextchar.{}{.\relax\@\xspace}} ...
2
votes
0answers
118 views

Write fully expanded macros to auxiliary files

Considering the following code snippet: \documentclass{article} \usepackage{xparse} % \usepackage[T1]{fontenc} \usepackage[utf8]{inputenc} \NewDocumentCommand{\edeftest}{m}{\edef\test{#1}#1} \...
8
votes
1answer
248 views

Moving arguments and \protect: coming to grips with the definitions

I'm trying to understand the precise semantics of \protect as described in the beginning of section 11.4 Robust commands and protect of the source2e document, the annotated source code of the LaTeX2e ...
5
votes
1answer
365 views

How to unprotect a command to expand it?

This is another question about protection and expansion, that I still don't understand well… (and I guess this is my problem here). I read especially How do I "unprotect" an argument?, and ...
1
vote
1answer
164 views

Correct way to compare macro definitions that contain protected macros, e.g., bibnamedelima

I'm trying to compare the content of \partnamefamily of an author's name in biblatex against a manual definition that is stored in another macro, lets call it \family, using \ifdefequal. So, I have ...