Skip to main content

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
1 answer
33 views

\nameref and \@currentlabelname don't work with tex4ht

I would like to be able to use \nameref and \@currentlabelname with tex4ht. Consider the following example file: \documentclass{article} \usepackage{hyperref} \newcounter{mylabelcounter} \begin{...
Daniel's user avatar
  • 23
1 vote
1 answer
71 views

Label a longtblr row and reference a specific column

I am trying to start with an example from Reference table row in LaTeX to create a label for a row, but I have not had any luck getting that to work in a longtblr environment. The code I have so far ...
Ritmo2k's user avatar
  • 187
0 votes
1 answer
97 views

Labels or keys of tcbtheorems in a section

I'm sure a lot of people asked this already, but I'm not able to find the correct answer. I want to keep track of my label/keys that I was giving a tcbtheorem. I don't know the best practise to ...
NikT's user avatar
  • 3
3 votes
1 answer
89 views

Test if "name" key of label is empty

I'd like to test if the "name" key attached to a label when nameref is loaded is empty. The value can be retrieved expandably with refcount's \getrefbykeydefault and tested as follows. \...
mbert's user avatar
  • 4,506
7 votes
1 answer
4k views

Conflict revtex4-2 class and nameref package

\documentclass{revtex4-2} \usepackage{hyperref} \begin{document} Hello World \end{document} Produces the following warning: Package nameref Warning: The definition of \label has changed! Check your ...
Yumina 弓那 Nirvalen's user avatar
0 votes
1 answer
96 views

How to make cleveref and nameref work with documentclass wlscirep and \section*? [duplicate]

QUESTION: How to make cleveref and nameref work with \documentclass{wlscirep} and \section*? Note that \documentclass{wlscirep} comes from "Template for submissions to Scientific Reports". ...
Ommo's user avatar
  • 849
1 vote
1 answer
80 views

References using nameref disappeared after titlesec update

With the latest update of the titlesec package (from v2.14 to v2.15) all references using nameref disappeared. I think this is a bug? This MWE shows the issue: \documentclass{article} \usepackage{...
suricata78's user avatar
1 vote
2 answers
50 views

Redefining theorem breaks nameref

I'd like to define a command \keyifythm{<envname>} which redefines an amsthm theorem environment to take a key-value optional argument. My approach below works, but for reasons I don't ...
mbert's user avatar
  • 4,506
2 votes
1 answer
110 views

Check if the text of a label is empty

I'm trying to check if a text label is empty. For this purpose, I tried to use the \ifblank command from the etoolbox package. On the following MWE, I would expect that \refdescx{\nameref{lab2}} would ...
ZoKaP's user avatar
  • 47
1 vote
1 answer
100 views

Links from table back to ref using the name (not number) of the table

I'm trying to create a two-way link between tables/figures and the list of all tables/figures that I manually created. I.e., each item in the list of tables should link to a table, and clicking on the ...
rappel's user avatar
  • 13
0 votes
1 answer
216 views

ref references the correct number, but nameref uses the wrong name

This is my first question, so I'm sorry if there are detiails missing or my question could be written more clearly. Any help is greatly appreciated. I want to use hyperref to reference the name of one ...
Tobias's user avatar
  • 3
0 votes
1 answer
47 views

nameref doesn't show in main text when choosing textcolor = white for table caption

I have a table that has a red background and using white text for the caption comes up better than black. This is done by using: \begin{tcolorbox}[colback=yellow!10!white,colframe=csuOrange,title= ...
Leigh K's user avatar
  • 111
3 votes
1 answer
103 views

\nameref and xifthen's \isempty do not work properly

So, I made a macros \fullref and combined it with \ifthenelse to remove [] if no content were printed. But when, for example, theorem has no name, \nameref prints nothing but xifthen's \isempty do not ...
Vladyslav Rehan's user avatar
0 votes
0 answers
162 views

Wrong reference to appendix section

I'm using a macro that is posted here (see the first answer), to automatically add section numbering to \nameref. When dealing with an appendix, instead of adding the reference number of the appendix ...
rasha's user avatar
  • 704
2 votes
2 answers
49 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}...
Tom's user avatar
  • 117
0 votes
0 answers
56 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 ...
Laurianne's user avatar
1 vote
0 answers
80 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 ...
user237210's user avatar
1 vote
1 answer
243 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 ...
xmarteo's user avatar
  • 21
3 votes
1 answer
81 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{...
NBur's user avatar
  • 5,126
2 votes
0 answers
3k 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[...
scottkosty's user avatar
  • 13.3k
0 votes
0 answers
28 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 ...
Autumn's user avatar
  • 1
0 votes
1 answer
105 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 ...
JoelDR's user avatar
  • 3
0 votes
1 answer
72 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 ...
Buster3650's user avatar
0 votes
0 answers
86 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 ...
Eliel Vázquez Espinosa's user avatar
0 votes
1 answer
122 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=...
EoDmnFOr3q's user avatar
  • 2,343
3 votes
1 answer
188 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, ...
Colin P's user avatar
  • 167
1 vote
1 answer
94 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,...
Michelle's user avatar
  • 551
4 votes
2 answers
806 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}} ...
Lechat Marcellin's user avatar
0 votes
1 answer
142 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 ...
Qi Tianluo's user avatar
1 vote
1 answer
188 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, ...
Skeptic's user avatar
  • 3,055
1 vote
2 answers
158 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 ...
Octribin's user avatar
  • 113
4 votes
1 answer
805 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 ...
raf's user avatar
  • 785
3 votes
1 answer
431 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=...
AmIanonIm's user avatar
1 vote
0 answers
32 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[...
Michael's user avatar
  • 197
1 vote
0 answers
175 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} \...
BowPark's user avatar
  • 1,213
0 votes
1 answer
370 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 ...
Tristan Nemoz's user avatar
2 votes
1 answer
929 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, \...
s6hebern's user avatar
  • 317
1 vote
1 answer
379 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 ...
Keelan's user avatar
  • 5,445
2 votes
0 answers
584 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 ...
murray's user avatar
  • 8,692
0 votes
1 answer
67 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 ...
Nils's user avatar
  • 3
3 votes
1 answer
3k 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 ...
Daniel's user avatar
  • 1,807
1 vote
1 answer
157 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 ...
Nameless's user avatar
  • 111
2 votes
1 answer
302 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 ...
mathse's user avatar
  • 101
0 votes
1 answer
339 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 \...
CasperYC's user avatar
  • 697
3 votes
1 answer
2k 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?, ...
user's user avatar
  • 4,815
2 votes
2 answers
362 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{...
Satana's user avatar
  • 123
2 votes
1 answer
43 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{...
R. Absil's user avatar
  • 151
2 votes
2 answers
258 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 ...
Coby Viner's user avatar
  • 1,949
0 votes
1 answer
56 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}} \...
Özgür's user avatar
  • 3,344
2 votes
2 answers
831 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 ...
jSh4rk's user avatar
  • 23