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
1 vote
1 answer
21 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 ...
user avatar
  • 21
1 vote
1 answer
16 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{...
user avatar
  • 3,621
0 votes
0 answers
92 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[...
user avatar
  • 12.4k
0 votes
0 answers
24 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 ...
user avatar
  • 1
0 votes
1 answer
43 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 ...
user avatar
  • 3
0 votes
1 answer
39 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 ...
user avatar
0 votes
0 answers
39 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 ...
user avatar
0 votes
1 answer
46 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=...
user avatar
  • 2,049
0 votes
0 answers
33 views

How do I capitalise each word in a \nameref call?

Using the same data as I asked in this earlier question. How do I capitalise each word in the final column, which is called by \nameref? I need to retain the ability to use lower-case on the first ...
user avatar
  • 473
3 votes
1 answer
89 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, ...
user avatar
  • 145
1 vote
1 answer
42 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,...
user avatar
  • 473
4 votes
2 answers
67 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}} ...
user avatar
0 votes
1 answer
21 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 ...
user avatar
0 votes
0 answers
54 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, ...
user avatar
  • 2,795
1 vote
2 answers
45 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 ...
user avatar
1 vote
1 answer
66 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 ...
user avatar
  • 415
2 votes
1 answer
67 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=...
user avatar
1 vote
0 answers
18 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[...
user avatar
  • 187
1 vote
0 answers
74 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} \...
user avatar
  • 1,075
0 votes
1 answer
95 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 ...
user avatar
0 votes
0 answers
99 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, \...
user avatar
  • 277
1 vote
1 answer
182 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 ...
user avatar
  • 4,875
2 votes
0 answers
372 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 ...
user avatar
  • 6,538
0 votes
1 answer
49 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 ...
user avatar
  • 3
3 votes
1 answer
937 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 ...
user avatar
  • 1,687
1 vote
1 answer
89 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 ...
user avatar
  • 111
2 votes
1 answer
104 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 ...
user avatar
  • 91
0 votes
1 answer
171 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 \...
user avatar
  • 515
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?, ...
user avatar
  • 4,365
2 votes
2 answers
78 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{...
user avatar
  • 123
1 vote
0 answers
24 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{...
user avatar
  • 141
2 votes
2 answers
182 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 ...
user avatar
  • 1,488
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}} \...
user avatar
  • 3,210
2 votes
2 answers
450 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 ...
user avatar
  • 23
1 vote
1 answer
261 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{...
user avatar
  • 4,365
0 votes
1 answer
82 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 ...
user avatar
  • 18.8k
1 vote
1 answer
109 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. ...
user avatar
  • 5,093
2 votes
1 answer
76 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 \...
user avatar
0 votes
0 answers
219 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} \...
user avatar
  • 1
2 votes
1 answer
54 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{...
user avatar
  • 3,210
10 votes
1 answer
692 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 ...
user avatar
  • 3,257
3 votes
1 answer
607 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 ...
user avatar
1 vote
1 answer
213 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 ...
user avatar
  • 215
1 vote
1 answer
736 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 ...
user avatar
2 votes
2 answers
214 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 ...
user avatar
1 vote
1 answer
103 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 ...
user avatar
  • 13
4 votes
2 answers
831 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\...
user avatar
  • 53
4 votes
3 answers
412 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 ...
user avatar
3 votes
0 answers
102 views

References to a label

I would like to create a label and display in the pdf-output, where the label is used: \documentclass{report} \usepackage{nameref, hyperref} \begin{document} \chapter{The first chapter} \label{ch:...
user avatar
  • 123
2 votes
0 answers
2k views

Cannot label a wrapfigure [duplicate]

I have the following environment to display a sidebar: \newcommand{\dummy}{} \newenvironment*{lsidebar}[2][0.5] { \renewcommand{\dummy}{#1} \wrapfigure{l}{#1\textwidth} \rule{#1\...
user avatar