Questions tagged [nameref]

The `nameref` package is meant to extract the name of section or caption titles for a given label. It is part of the `hyperref` package bundle and provides basically the `\nameref` and `\nameref*` macros.

Filter by
Sorted by
Tagged with
2 votes
2 answers
27 views

Remove citation from nameref

I have some theorems/lemmas which have a reference in their name, like this: \begin{lemma}[Park's Lemma~\textnormal{\protect{\cite{park}}}]\label{lemma:parks-lemma} This is Park's Lemma \end{lemma}...
  • 97
0 votes
0 answers
23 views

Use \nameref to refer to annex

I use my Universty's template Latex (University of Montreal) for my these and I'm facing an error I don't know how to fix it: I used template's commands to create annexes (\Annexe) but it's not a ...
1 vote
0 answers
40 views

LaTeX doesn't recognise label for unnumbered section

I'm fairly experienced with LaTeX and can usually solve bigger problems with a quick Google but this one is driving me mad. In my thesis I have unnumbered sections. I am trying to refer to a ...
1 vote
1 answer
44 views

Protection setting \@currentlabelname to give a "name" to a \phantomsection

This is a follow-up question to nameref With Arbitrary Text and also Refer to arbitrary text (without numbering and not by section) To summarize, the question was about how to reference to an ...
  • 21
1 vote
1 answer
19 views

Loss of nameref when changing documentclass

The following MWE compiles fine \documentclass{article} \usepackage{tcolorbox} \tcbuselibrary{theorems} \usepackage{hyperref} \usepackage{cleveref} \newtcbtheorem{thm}{Theorem}{#1}{thm} \begin{...
  • 3,671
0 votes
0 answers
1k views

EuropeCV fails with LaTeX2e pre-release because of loading hyperref in \AtBeginDocument

Below is a minimal example that compiles successfully with stable TeX Live 2022 pdflatex but fails with the latest (and expected to be released in a couple days I think) pdflatex-dev: \documentclass[...
  • 12.6k
0 votes
0 answers
25 views

Using \nameref to refer to an unlabeled section doesn't work [duplicate]

I want to reference to my \section*{Foo.} with the \label{sec:foo}. For this, I tried using \nameref{sec:foo} but it doesn't work, i.e. there are no errors but it just doesn't print anything at that ...
  • 1
0 votes
1 answer
63 views

nameref circular reference causes TeX capacity exceeded

Update: Thanks everyone for your help, looks like I just misunderstood how \nameref works. I didn't realise it printed the entire caption, so as Ulrike commented it looks like the code is simply ...
  • 3
0 votes
1 answer
49 views

How to make section name appear in ToC when using both fancyhdr and titlesec

We want the section Preface to appear on the TOC, but as can be seen on the following screenshot, the section name does not appear to be visible, although the dotted line is appearing with page number ...
0 votes
0 answers
53 views

Titlesec doesn't allow me to use nameref

I'm writing an essay and using fancyhdr, nameref and titlesec. Namerefis used to have the \currentname of the section in the footer, but I also wanted to make the section names look different and when ...
0 votes
1 answer
67 views

How to get \nameref{} to be displayed in small caps?

Consider the following MWE: \documentclass[a4paper]{scrartcl} % PACKAGES LOADING \usepackage[dvipsnames]{xcolor} \usepackage{amsmath, mathtools, amsthm, mathrsfs, amssymb} \usepackage[framemethod=...
  • 2,139
3 votes
1 answer
119 views

Nameref is broken after renewing sections command

To comply with the rules of my university I have to not print section headings and make some other changes to TOCs and sections. Here is a (more or less minimal) MWE: \documentclass[titlepage, ...
  • 167
1 vote
1 answer
55 views

How do I split \nameref text across two rows, within a single table column?

I have the following table \documentclass{article} \usepackage[english]{babel} \usepackage{amsmath,amsthm,amssymb} \usepackage{amsfonts} \usepackage[a4paper,layout=a4paper, bindingoffset=4cm,...
  • 503
4 votes
2 answers
134 views

Give a name to \ref but not the name of the section - LaTex

I try to learn LaTex via TexStudio on Ubuntu. I need to reference to a paragraph like that: \paragraph{Théorème 5.}\label{theoreme5} And I need that: \section{Preuve du Théorème \nameref{theoreme5}} ...
0 votes
1 answer
24 views

Why do nameref package zap the ending dot in \label and how to avoid this zap locally?

So, I'm hacking something related to nameref and during the hacking, I find on the beginning of page 3 of the nameref manual on my computer (dated 2016/05/21) that We redefine \label so that it also ...
0 votes
0 answers
91 views

cleveref does not work together in sv classes with envcountsame option

I posted once before about this issue, here, but would like to start a new thread with more information and a MWE. I hope that's OK. (In the old post I did not very adequately explain the situation, ...
  • 2,845
1 vote
2 answers
46 views

Get name of any labelled section

Is there a way to get the name of any, not just the current, section (chapter, section, subsection, ...) by its label? Just like the \nameref command, but the hyperref package is loaded and I don't ...
1 vote
1 answer
102 views

nameref is not working for unnumbered sections due to titilesec and latexbangla

I am trying to cross-reference the unnumbered chapters and sections in a book. But I found out \nameref is not working for unnumbered sections due to the packages latexbangla and \titlesec. Here is ...
  • 417
2 votes
1 answer
100 views

In Beamer cannot link/ref/hyperref to a certain slide/frame where a label was placed

This is the code I am using. \documentclass[xcolor=svgnames, aspectratio=169]{beamer} \usepackage[breakwords]{truncate} \usepackage{ragged2e} \usepackage{xcolor,colortbl} \hypersetup{ pdfstartview=...
1 vote
0 answers
20 views

"register" package strange behavior

When I use a register package in my document, the nameref is not working correctly. For example, below document shows wrong chapter name. \documentclass{scrreprt} \usepackage{nameref} \usepackage[...
  • 187
1 vote
0 answers
98 views

Impossible to nameref Appendix Sections

Consider this MWE: \documentclass[12pt]{book} \usepackage{hyperref} \usepackage[toc,page]{appendix} \usepackage{titlesec} \setcounter{tocdepth}{4} \setcounter{secnumdepth}{4} \begin{document} \...
  • 1,095
0 votes
1 answer
147 views

Nameref refers to section title instead of theorem title

I've seen similar issue here, but the answer was posted in 2011, stating that it was due to the fact that the used nameref version was obsolete. I have to use Overleaf for my document and I don't have ...
0 votes
0 answers
217 views

\nameref not working with starred sections

I have an appendix in my document which I want to reference by its name in the text. I use the starred \section* command here, because I do not want the appendix to appear in the TOC. However, \...
  • 277
1 vote
1 answer
233 views

How to get \nameref working on beamer slide titles?

\nameref and beamer sometimes need some work to play nicely together. In the below MWE, I would want the text to say "\nameref uses the frame title.", but it says "\nameref uses the ...
  • 4,985
2 votes
0 answers
421 views

nameref sectioning: Parameters must be numbered consecurivel

After the latest updates to TeXLive 2020, a book-length document using the memoir document class now fails to compile with either pdflatex or xelatex, despite my having made no changes whatsoever in ...
  • 6,828
0 votes
1 answer
52 views

Index entry with nameref content leads to emergency stop

Good evening, everybody. After having read lots of your formidable Q&A's (thank you for the insights) I am struggling hard with this problem and would like to pose a question: What I intend to do ...
  • 3
3 votes
1 answer
2k views

How to avoid "Infinite glue shrinkage found in a paragraph." error with enumitem and nameref

There seems to be a problem when combining the enumitem and nameref package. With the code below I get the error: ! Infinite glue shrinkage found in a paragraph. I already checked the package ...
  • 1,727
1 vote
1 answer
91 views

Link map from referenced theorems in my document

I am writing a latex document full of hyperlinks pointing to various areas of the document itself (I am using \nameref to reference theorems). I have a questions regarding these: is it possible to ...
  • 111
2 votes
1 answer
140 views

Jump to item - not to chapter with "\nameref"

I use a "description" environment and want to refer to certain items by name (which works fine). But I also want, that when a reader clicks on the resulting hyperlink that one jumps directly to the ...
  • 91
0 votes
1 answer
209 views

How to get ride of the file extension in \currfilename

How to get ride of the file extension in \currfilename? The \jobname would only give me the name without the .tex, which is fine. But that's not what I want if I am using \input or \include. So \...
  • 545
3 votes
1 answer
1k views

Undefined control sequence while adding a new parameter to a existing \ExplSyntaxOn code

I am fixing my command \fullref, which internally uses \nameref and does not support multiple labels to be used simultaneously. However, on the question How to nameref multiple labels simultaneously?, ...
  • 4,455
2 votes
2 answers
112 views

Use \nameref without displaying the entire name

Say I have a TeX section: \section*{Appendix A: My Name is Blah} \label{appendix} but I want to refer to "Appendix A" without the ": My Name is Blah". Is there a way to do this? The code \nameref{...
  • 123
1 vote
1 answer
33 views

Recover long name of a section in beamer (nameref used)

In beamer, I'm introducing a slide at the beginning of each section with \usepackage{nameref} \newcommand*{\currentname}{\@currentlabelname} \AtBeginSection[] { \begin{frame} \begin{...
  • 141
2 votes
2 answers
204 views

Enumitem with hyperref's \nameref, in complex environments

I provide this pre-amble of my main desired output, having been told that my below approach is inherently misguided (due to \nameref not being designed or able to obtain only a numeral, instead of a ...
  • 1,727
0 votes
1 answer
47 views

The name at the beginning of the letters in the appendix does not change in ToC

MWE \documentclass{book} \usepackage{lipsum} \usepackage{titletoc} \usepackage{appendix} \renewcommand{\chaptername}{\textit{Division}} \renewcommand{\appendixname}{\textit{Addition}} \...
  • 3,212
2 votes
2 answers
527 views

Use \nameref to get text from a custom environment

I've got an own environment for requirements. In my document I want to reference each requirement and get its text. If I use \namref I get only the name of the corresponding section. Can someone help ...
  • 23
1 vote
1 answer
286 views

How to nameref multiple labels simultaneously?

On this example, I use \cref{first,second} and cleveref correctly labels them: \documentclass[10pt,a5paper]{memoir} \usepackage[brazil]{babel} \usepackage{hyperref} \usepackage{cleveref} \begin{...
  • 4,455
0 votes
1 answer
85 views

How to add a custom TOC (automated "Section Break-down") after each \chapter command?

Let's say we have a document broken into chapters and we want at the beginning of each chapter to add between two horizontal lines a "Section Break-Down" that shows all the sections and subsections of ...
  • 19.4k
1 vote
1 answer
135 views

nameref does not work with LLNCS

I'm trying to use the very practicle nameref package with lncs (sty file downloaded here). Unfortunately, instead of displaying the actual name of the definition, it displays the name of last section. ...
  • 5,295
2 votes
1 answer
78 views

Use name of referenced object as argument of string comparison

I have argument #1 which contains some text X representing some label. I would like to use \str_if_eq to compare X and name of paragraph referenced by this string. What I want to achieve is that if \...
0 votes
0 answers
328 views

Redefine \autoref for paragraphs

I'm working with \autoref from the hyperref package to reference my sections, etc. What I currently work with: \documentclass[a4paper, 12pt, parskip]{scrreprt} \usepackage[utf8]{inputenc} \...
  • 1
2 votes
1 answer
59 views

How do I add graphicname like figurename?

MWE \documentclass[a4paper,11pt]{book} \usepackage{caption} \usepackage{tikz} \usepackage{graphicx} \usepackage{float} \newfloat{Grafik}{htbp}{loa} \begin{document} \chapter{A} \section{B} \begin{...
  • 3,212
10 votes
1 answer
779 views

Capitalization variants of nameref

Several packages that generate inline text (i.e. glossaries, cleverref) have commands to let the author choose capitalization. In particular, glossaries seems to be able to do parts of this ...
  • 3,267
3 votes
1 answer
655 views

\nameref use the long title instead of the short title

For my table of contents I need the short title, often formatted with \newline so it looks nice. For \nameref{label} I need the long title instead of the short title. Is it possible to have \nameref ...
1 vote
1 answer
214 views

References and citations with bibtex

I use bibtex for my references and I am wondering, which is the best way to organise my list and citations? There are many question about references but I can not find a way to do what I want. with ...
  • 215
1 vote
1 answer
807 views

Undefined control sequence. --\nameref

I am using IEEETran document class, from https://www.computer.org/web/tpds/author My LaTeX source looks like: (See \S\ref{AnyLabel}--\nameref{AnyLabel}.) . . . \section{AnySec}\label{AnyLabel} I ...
2 votes
2 answers
223 views

Use counters in a bar chart

I have a document consisting of different topics within multi-variable calculus. I want to start the document with a bar chart displaying how many problems there are of each kind, based on the number ...
1 vote
1 answer
109 views

Custom counter printed correctly in situ, but not in nameref references

The journal that I'm submitting to has a LaTeX template (yay!), but the template suggests manually labeling supplemental figures. Since I'm too lazy to do that, I thought I would make a new counter ...
  • 13
4 votes
2 answers
924 views

Lower-case letter in \nameref

I use this before \begin{document}: \newcounter{mylabelcounter} \makeatletter \newcommand{\labelText}[2]{% #1\refstepcounter{mylabelcounter}% \immediate\write\@auxout{% \string\...
  • 53
4 votes
3 answers
446 views

Using \nameref in section name disturbs display of header

General description of the issue I have an appendix whose section names have to be identical to the names of sections of the main part of the dissertation. Therefore I used the \nameref command of ...