2
votes
1answer
31 views

using a restatable before it is stated

This question is related to the question at Recalling a theorem, which uses the thmtools and thm-restate packages and the restatable environment to define a theorem that can be re-stated later on. Is ...
5
votes
1answer
93 views

Label and page number in macro?

I'm writing a long document, and I've written a little macro for keeping track of various things I want to come back to - for example if I want to continue writing but I know that something I've ...
5
votes
1answer
63 views

re-define \ref and \label to include source filename?

I have a set of documents each with references that look like: \ref{figure1} and so on. This is no problem when building each document separately,but creates many duplicate references when using ...
3
votes
2answers
99 views

Is it possible to declare a footnote in a way that it will attach to the first occurrence of a given word or phrase?

Is it possible to declare a footnote in a way that it will attach to the first occurrence of a given word or phrase? Doing this in a fully automated way might not be possible (see link below), but if ...
5
votes
3answers
111 views

Remove math from command parameter to get only the letters

I use a little command, which prints new defined terms in bold, adds a label and adds them to the index. \newcommand*{\defined}[1]{{\bf #1}\label{#1}\index{#1}} Now if I do \defined{$G$-invariant} ...
2
votes
1answer
138 views

Re-insert equation by label

I read over the response given here: Is it possible to re-insert a LaTeX equation by label? which says such a thing is possible only with a macro. I would like to do this. I have a bajillion ...
3
votes
2answers
77 views

How can I refer to label created by new command?

I have several pairs of graphs. I need to display these graphs in latex. I am using the following which works Great. \begin{figure} \centering \begin{subfigure}{.5\textwidth} \centering ...
1
vote
0answers
75 views

Is it possible to make a macro with \label? [closed]

I'm not very experienced with LaTeX and I'm having trouble when trying to define a macro to include some images. I want to do it this way because I'm trying to take notes using LaTeX and I need to ...
1
vote
1answer
92 views

Macro needed for automatic creation of labels

I'm asking for help with the creation of a label inside a command out of a given text. The given text contains spaces and an umlaut. See my MWE, which contains my question: \documentclass[pagesize, ...
0
votes
0answers
105 views

Cannot pass param to label in newcommand: 'bad character in label' [closed]

When trying to pass name to \label I'm getting 'bad character' error. Is it possible to use \label like this, or should I just manually specify it outside of \img macro? % Usage: \img[name]{caption} ...
4
votes
1answer
240 views

Shortcut commands for referencing floats

I always include the following commands in the preamble of my latex documents to make sure I refer to floats consistently in the text. I was wondering if the community had any thoughts about this, is ...
7
votes
2answers
206 views

How to use \csname … \endcsname with \ref?

I have to get value of a dynamical macro where the index is given by \ref{mymarker}. Is it possible to do? I define a set of macros with a predefined counter 'mycounter' as ...
14
votes
1answer
385 views

How to create my own ref label system?

I want to add a hyperlink to sections where a file is discussed. Additionally the usage should be added to the index. In principle this is very close to the label ref system. A simple approach would ...
10
votes
2answers
238 views

using \nameref only if there is a name

I am referencing some sections (actually those will be custom defined in the end) by number, type and name. But it happens that there is no name. So I want to leave it out. How can I test for that? A ...
1
vote
2answers
111 views

Ref list listing arg instead of actual argument's text in a newcommand

What i'm trying to do is to set up a quick insert of a pdf at a default size with the new command \zfh. The problem lies with the label and how it's listed in my label list database. example: ...
3
votes
1answer
64 views

Using \label command in a custom command

I have some big equations that I wanted to separate out of the text of my document to make the source code easier to read. The idea was to declare a command for each equation in a separate file, ...
5
votes
1answer
312 views

How to programmatically create sections in LaTeX

In the simplest form of the problem I am facing, I need to define a command that accepts two parameters, uses the first to put some contents in the document exactly where the command is invoked, and ...
9
votes
3answers
953 views

Get reference to “current” section

I'd like to write a command to get a reference to the "current" section provided (the term is all wrong, but the example will clarify). The idea is something along the lines of: ...
5
votes
2answers
279 views

Comparing reference numbers

I'm using the refcount package to get the reference number associated with a label. I'd like to determine whether two references lay "next" to each other or not, that is: I'd like an expandable ...
2
votes
1answer
177 views

Call macro whose name depends on macro

Sorry about the title, I really couldn't find a better one. I'm facing the following dilemma: I'm using the smartref package, in particular I'm using its \sgetXval macros. The thing is that I'm using ...
2
votes
2answers
227 views

Customize referencing of subcaptions in “memoir”?

When I use \subcaption{... \label{myfig}} in memoir, and then reference it, the result is something like "Figure 1(a)". But I would like to customize the reference by removing the parentheses, thus ...
13
votes
2answers
219 views

Compress a list of page references

I'm looking for a pure (La)TeX solution (alas, no LuaTeX) for compressing a list of page references (given with \pageref) like cite.sty does with citations; that is "Compress lists of three or more ...
2
votes
2answers
221 views

What do these cross-referencing and code macros mean?

I was searching around my editor and found some templates that I never used before and I was just wondering exactly what do they mean and do. Someone can edit the title is you have a better ...
8
votes
4answers
374 views

Making an “auto-counter” command - test whether a reference marker already exists?

I'd like to be able to number arbitrary objects (in my case, chemical compounds) within a document. Ideally this would involve a command a bit like \ref, but where you don't need a \label. The label ...
6
votes
1answer
392 views

Define a custom command with name, label and linkable

I'd like to create a command with the following features: \newcommand{\mycom}[2]{...} \newcommand{\linktomycom}[1]{...} In the doc body: \mycom{firstitem}{This is the first item} and later: ...
4
votes
1answer
258 views

Define command so that \label works properly

I have something like this: \newcounter{Def} \newcommand{\printDef}{\thechapter.\thesection.\theDef} \newenvironment{Expl} {\small\narrower\medskip\stepcounter{Def}\noindent\ignorespaces ...
1
vote
1answer
459 views

Defining a custom cross referencing style

I want my cross reference links to look like: Chapter X: Chapter Title To achieve that I have created the following command: \newcommand{\fancyref}[1]{\autoref{#1}: \nameref{#1}} The problem is ...
18
votes
4answers
531 views

How exactly does \def\p@figure{Figure~} work?

I took this line from my thesis style and added it into my document (preceded by \makeatletter) and what it does that whenever I used \ref{figureid} instead of putting just the figure number, it puts ...
4
votes
1answer
98 views

Defining a command for linked and indexed section headings?

What is the (preferred way of) defining a command that places a heading (like \section, \chapter, etc.) creates a label for this heading that can be referenced places the heading in the TOC (I ...