Skip to main content

Questions tagged [fragile]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
41 views

Beamer strange interaction between fragile, standalone and new frame option

I am playing with beamer and I wrote a frame option optionA to change locally the background. I also want to put some part of my document in a standalone, so I create another named part.tex included ...
R. N's user avatar
  • 1,138
1 vote
3 answers
93 views

Problem with command expansion in xstring macro? "Incomplete \iffalse"

I have written the following commands which first chunk the input text by ; and then make "fractions" out of text that is separated by /. My intention with this is to display genotypes with ...
tired63194's user avatar
1 vote
1 answer
62 views

How to make \mathbf robust?

I made a command \statementinput which makes a table easily with given two lists of elements. Most of the elements are math formulas, and I don't want to put each of them in \(\), so I used the array ...
Jaehyeon Seo's user avatar
0 votes
1 answer
48 views

beamerappendixnote does not work with [fragile] / verbatim context

I use beamerappendixnote to provide code examples in my lecture slides, for students who want to redo what we did in class. Putting code on slides with nice highlighting, etc., requires the [fragile] ...
sheß's user avatar
  • 3,692
2 votes
1 answer
108 views

Hiding verbatim material on beamer slide while saving the space

The bigger picture is the following: I want to have a minted environment hidden in the presentation but save the space and have it available in my notes. So I created a command: \newcommand{\hidden}[1]...
Tia Chung's user avatar
2 votes
1 answer
400 views

Reasons for not using \protect

So I have been looking into the details of what it means for a macro to be \protected and thus be made robust. I have found this question where an answer explains the concept of what it means for a ...
Raven's user avatar
  • 3,043
9 votes
2 answers
290 views

How to use \DeclarePairedDelimiter commands as moving arguments (such as sections or captions)?

I am having trouble to use \DeclarePairedDelimiter commands from the mathtools package with the optional size argument inside moving arguments such as section titles (or caption texts), when a table ...
Ben JW's user avatar
  • 191
0 votes
0 answers
34 views

Display % with \newcommand{\mintinline{...}} [duplicate]

I don't understand why the two frames below are not treated the same way. The first one correctly displays the % symbol, while the second one gives an error. \documentclass[10pt]{beamer} \usepackage{...
tigerjack's user avatar
  • 249
1 vote
1 answer
151 views

Using custom units with siunitx v3 in captions - is \protect insufficient?

I am using my previously discussed custom commands (also provided below), in siunitx. Since version 3, I am no longer able to use them in captions, whereas previously, adding \protect before them ...
Coby Viner's user avatar
  • 1,949
1 vote
2 answers
231 views

How does \protected deal with arguments? Is it different than \protect?

According to this answer \protect\foo expands to something like \noexpand\protect\noexpand\foo when it gets saved to a macro (e.g. in a context like a beamer frame). I think \protected\def basically ...
Peter Gerdes's user avatar
2 votes
1 answer
54 views

Error from fragile beamer-frame within etoolbox's ifbool

Based on etoolbox booleans, I am (un)selecting Beamer slides. When I try to do this with a fragile frame I run into errors. See MWE. Could you explain why, and would you have a workaround for this? I ...
matheburg's user avatar
  • 1,299
2 votes
2 answers
64 views

How do you protect fragile commands or commands in general inside \bib* fields of amsrefs?

I would like to kindly inquire how to protect commands (which I would normally presume to be fragile) in the non-citable \bib* bibliographic fields of the package amsrefs. Consider the following MWE1, ...
beethovengg14's user avatar
0 votes
1 answer
188 views

multido and fragile frames in beamer

I'm trying to use multido package to create a sequence of slides with multiple code snippets using listing. Unfortunately the fragile option leads to the following error: ! File ended while scanning ...
LEo's user avatar
  • 772
1 vote
2 answers
1k views

Error: use of macro doesn't match its definition

I'm trying to write a package to provide some shortcut commands for common linear algebra operations (for my intro to linear algebra course at least). However, I'm getting weird errors under certain ...
Mia's user avatar
  • 167
27 votes
2 answers
1k views

Fragile commands in 2021

Since 2015, \( \), \begin{math} etc. have been made robust. Aside from user-generated commands not created with \DeclareRobustCommand and out-of-date packages, are fragile commands still a thing in ...
Don Hosek's user avatar
  • 14.2k
2 votes
1 answer
344 views

Tikz matrix node in beamer with fragile option AND \onslide produces error

When drawing a tikz picture entailing a matrix of nodes in beamer it is needed to turn on beamer option fragile. This works fine. However, when also applying an \onslide<x-y>{} within or around ...
kilsen's user avatar
  • 357
3 votes
1 answer
119 views

Why my macro is fragile in a title? Can I make it more solid?

The follwoing code stops the compilation even if the output is the good one if the message are ignored. Why my macro is fragile? Can I make here more solid ? \documentclass[12pt,a4paper]{article} \...
projetmbc's user avatar
  • 13.4k
1 vote
0 answers
426 views

Beamer: \begin{frame} + minted package for syntax highlighting

I am trying to define a .sty file to help adding slides with code samples in my presentations. The minted package is a nice-looking solution for adding syntax-highlighting, but I can't get it to work ...
f.leno's user avatar
  • 95
0 votes
1 answer
108 views

fp and macro question

I try to feed macros doing FP calculations into other macros doing the same, and face problems with macro expansion. The usual "protect" trick didn't work for me. Any hints? An example is below. \...
taku's user avatar
  • 3
2 votes
1 answer
88 views

\rotatebox error with prebreak in \lstlisting

Command \rotatebox generates error when used with non-orthogonal (not a multiple of 90) angles in prebreak of a \lstlisting. Here is an example: \documentclass{article} \usepackage{graphicx, listings}...
Kian Mirjalali's user avatar
3 votes
0 answers
55 views

Is there a downside of always using fragile? [duplicate]

I am preparing a presentation and since I am presenting a lot of code, I find myself adding [fragile] to many slides such that I can put verbatim code in it (actually lstlisting from from the listings ...
alfC's user avatar
  • 14.5k
19 votes
2 answers
2k views

Are all commands with an optional argument fragile?

Here is a discussion of fragile command in LaTeX. And it says that any commands that have an optional argument are fragile, for instance \footnote[2]{myfoottext} and \footnot{myotherfoottext}. I have ...
Brooks's user avatar
  • 573
2 votes
2 answers
422 views

Fragile and newenvironment

I would like to have the title and the subtitle of my beamer slides to be the "current" section and subsection respectively - just like in the following example: \documentclass{beamer} \...
D.F.F's user avatar
  • 414
6 votes
1 answer
462 views

White-space after `[fragile]\end{frame}` breaks beamer?

I have detected a very strange behaviour when creating beamer slides with the [fragile] option. I read and know that the line \end{frame} must not be indented and must not have a comment directly ...
Ktree's user avatar
  • 688
0 votes
1 answer
196 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,095
3 votes
0 answers
207 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 ...
Andreas Storvik Strauman's user avatar
4 votes
1 answer
1k views

beamer and verbatim

why the following mwe doesn't work, if i uncomment line \end{frame}? \documentclass[xcolor={dvipsnames,handout,svgnames,table}]{beamer} \usepackage[utf8]{inputenc} \begin{document} \begin{frame}[...
Zarko's user avatar
  • 300k
0 votes
1 answer
301 views

Creating a begin{frame}[fragile] macro

This is a follow up to my question in this thread, in response to which @samcarter showed me how to combine <+-> with fragile. In the example below, I've tried to further automate his code ...
Leo Simon's user avatar
  • 2,209
1 vote
1 answer
179 views

combining <+-> and fragile as optional arguments to the begin{frame} command

I'd like to be able to custom-define a frame environment that has two arguments, <+-> and fragile. The first allows me to uncover items in a list environment, the second allows me to use the ...
Leo Simon's user avatar
  • 2,209
346 votes
5 answers
41k views

What is the difference between Fragile and Robust commands? When and why do we need \protect?

So I've read a few times about this, the “moving arguments” and all that. But what does it really mean? Could someone explain in a few words what is going on at the TeX level, what is the difference ...
Juan A. Navarro's user avatar