Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to include full hyperlink text (e.g., "Table 1" instead of just "1") for tables in PDF documents? #597

Closed
perlatex opened this issue Dec 7, 2024 · 1 comment

Comments

@perlatex
Copy link

perlatex commented Dec 7, 2024

I'm facing an issue when generating PDF documents from papaja::apa6_pdf(). When referencing tables, the default hyperlink text shows only the number (e.g., "1"), but I would like it to display the full reference text, such as "Table 1" instead.

---
title: "title"
documentclass     : "apa6" 
classoption       : "doc"    
link-citations    : yes
linkcolor         : red
urlcolor          : blue
citecolor         : blue
output            : 
  papaja::apa6_pdf:
    latex_engine: xelatex

header-includes   :
  - \usepackage{tabularray}
  - \usepackage{hyperref}
---


# chapter

The summary information see Table \@ref(tab:tableref), Some description.

```{r tableref}
library(tidyverse)
library(papaja)
iris %>% 
  head() %>% 
  apa_table(
    placement = "h",
    caption = "A summary table of the dataset."
  )
   
```

ask

This generates a hyperlink, but I want it to show "Table 1" rather than just "1". Is there a way to modify the hyperlink text to include the word "Table" instead of just the number?

Thanks in advance!

@crsh crsh added the unrelated label Dec 11, 2024
@crsh
Copy link
Owner

crsh commented Dec 11, 2024

Hi there, thanks for reaching out. This question technically relates to the bookdown package rather than papaja. What you are looking for is something akin to \autoref{} in LaTeX, right? If you are being limited to PDF-output, you can just use the LaTeX command. I don't think there currently is output-format-agnostic analog in bookdown or pandoc. There is an open feature request with pandoc to add this feature. An upvote over there could help.

@crsh crsh closed this as completed Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants