3
votes
1answer
35 views

Change figure caption name in “thesis” document

Does anyone have an idea why this approach to changing figure naming doesn't work in thesis type document? I'm using babel and all other captions translate normally, except "Figure", which stays at ...
2
votes
1answer
23 views

How to pre-evaluate commands that are problematic for a specific environment?

More specifically, my problem occurs in the caption environment, but I imagine this applies elsewhere. I would like to insert the text generated by \suppOrApp and store it in the variable \sOrA: ...
1
vote
0answers
19 views

Why is space inserted at beginning of table or figure caption when using macros to define caption label? [duplicate]

Here is my MWE. As you can see, the problem only happens when we use the macro \suppOrApp. \documentclass{article} \usepackage[english]{babel} \usepackage{blindtext} \usepackage{caption} ...
3
votes
1answer
39 views

\ifmmode check in section caption

To assure the correct usage of newcommands which only shall be used in mathmode, I have introduced a mathcommand, which checks mathmode by \ifmmode. Now I want to use such a mathcommand in a section ...
1
vote
1answer
67 views

How to make figure captions working inside a macro?

I am writing a report often having the need to insert two figures next to each other with separate figure numbers (not subfigures a,b). To speed up the process I wrote a macro but somehow the captions ...
4
votes
1answer
124 views

Add optional argument to the caption to get into figure list entry

I would like to add the optional list entry, which is used for a listoffigures, also to the caption. In this basic example: \documentclass{scrreprt} \usepackage{caption} \begin{document} ...
4
votes
1answer
227 views

Command to insert filename in caption of a listing

I would like to have a command to insert listings that contain the filename in the caption. This works well as long as there is no "_" etc. in the filename. I also tried the suggestion from a ...
4
votes
1answer
97 views

automatic nomenclature breaks with subfigure

I am using the method recommended in List of symbols/abbreviations and macros to automatically generate an entry to the nomenclature (nomencl package) when I first use a command, i.e. ...
1
vote
1answer
74 views

Command for table with label

How can I create a command for a 2 tables with a label on top and a command for the options below? example of what i am saying is:
2
votes
1answer
212 views

Using (redefined) macro in \caption doesn't work, but it works in another environment

My problem is strange behavior my command \vec{} in \caption. I used this construction: \renewcommand{\vec}[1]{\accentset{\rightarrow}{#1}} See my code: \documentclass[12pt, a4paper, czech, ...
4
votes
2answers
1k views

\renewcommand with \caption*

I'd like to redefine \caption* as \renewcommand{\caption*}[1]{\vspace{\abovecaptionskip}\caption*{\textbf{Note:} #1}\vspace{-\abovecaptionskip}} but keep getting an error when I try to compile. My ...
2
votes
2answers
896 views

input filename as caption in listing

I'm working on the following piece of code \newcommand{\mycin}[1]{% new command for icluding piece of code from external files \lstinputlisting{#1} } I want to add a caption that reflects the ...
2
votes
1answer
262 views

Why won't this macro work in a \caption?

I created a macro to easily shift into typewriter mode, ala markdown or fancyvrb's "short verbatim" command. It works everywhere but in \captions. In that case, TeX fails saying I've exceeded ...
13
votes
4answers
330 views

How to prevent last period in captions from appearing in the list of figures?

Is there any simple way of removing the last character of an argument to a command (or environment)? I'm looking for a simple way to remove the punctuation mark from a caption when it appears in the ...
12
votes
1answer
750 views

“etc.” abbreviation macro gives error when used in caption

I've been using the abbreviation macros for i.e., e.g., and etc. that are provided in this post. However, I just discovered that the etc. macro, and a similar one I made for et al. both cause errors ...
7
votes
3answers
3k views

How to redefine the caption command with optional arguments

I'm writing a thesis that has double spacing on by default throughout the document. However, captions on figures need to be singlepaced. I can do that like this \normalsize \singlespace \caption{ ...