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

_ in twitter handle causes error with url linking to account #117

Closed
MichelineCampbell opened this issue Apr 23, 2020 · 13 comments
Closed
Assignees
Labels
bug Something isn't working

Comments

@MichelineCampbell
Copy link

including an underscore in the twitter: entry for vitae YAML resulted in URL breaking with "/protect%20_" (e.g. my handle was @michcampbell_ - redirected to https://twitter.com/michcampbell/protect%20_ (page that does not exist).)

@mitchelloharawild
Copy link
Owner

Which template are you using?

@MichelineCampbell
Copy link
Author

awesomecv

@mitchelloharawild
Copy link
Owner

I'm unable to reproduce this issue. The URL seems to take me to the right place, although I also can't access your twitter account (even following the crawled URL via google).

---
name: Marie
surname: Curie
position: "Professor"
address: "School of Physics & Chemistry, École Normale Supérieure"
phone: +1 22 3333 4444
www: mariecurie.com
email: "[email protected]"
twitter: michcampbell_
github: michcampbell_
linkedin: michcampbell_
date: "`r format(Sys.time(), '%B %Y')`"
output: vitae::awesomecv
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = FALSE, warning = FALSE, message = FALSE)
library(vitae)
library(dplyr)
```

# Some stuff about me

* I poisoned myself doing research.
* I was the first woman to win a Nobel prize
* I was the first person and only woman to win a Nobel prize in two different sciences.

# Education

```{r}
library(tibble)
tribble(
  ~ Degree, ~ Year, ~ Institution, ~ Where,
  "Informal studies", "1889-91", "Flying University", "Warsaw, Poland",
  "Master of Physics", "1893", "Sorbonne Université", "Paris, France",
  "Master of Mathematics", "1894", "Sorbonne Université", "Paris, France"
) %>%
  detailed_entries(Degree, Year, Institution, Where)
```

# Nobel Prizes

```{r}
tribble(
  ~Year, ~Type, ~Desc,
  1903, "Physics", "Awarded for her work on radioactivity with Pierre Curie and Henri Becquerel",
  1911, "Chemistry", "Awarded for the discovery of radium and polonium"
) %>%
  brief_entries(
    glue::glue("Nobel Prize in {Type}"),
    Year,
    Desc
  )
```

# Publications

```{r}
scholar::get_publications("EmD_lTEAAAAJ&EmD_lTEAAAAJ&") %>%
  filter(cites > 30) %>%
  distinct(title, .keep_all = TRUE) %>%
  transmute(bibtype = "Article", author = as.character(author),
            title = as.character(title),
            journaltitle = as.character(journal), year, key = row_number()) %>%
  RefManageR::as.BibEntry() %>%
  RefManageR::WriteBib("curie.bib")

bibliography_entries("curie.bib")
```

test-twitter.pdf

@mitchelloharawild mitchelloharawild added the awaiting-mre Issue requires MRE. If not provided, will be closed in 1 month. label Apr 24, 2020
@MichelineCampbell
Copy link
Author

Yep, I changed my twitter handle as a quick personal fix last night, so michampbell_ won't take you there anyway.

@mitchelloharawild
Copy link
Owner

Perhaps it is a PDF reader issue? Could you try to follow the link in the pdf provided above?

@MichelineCampbell
Copy link
Author

Possibly - I'll try on my home computer this evening, but the link worked fine just then in both chrome's PDF viewer and adobe acrobat at work. Sorry, I didn't think to check by PDF reader initially (although links to github and email worked fine, so I think it was still the underscore causing a problem).

@MichelineCampbell
Copy link
Author

MichelineCampbell commented Apr 24, 2020

OK I just realised I'm a numpty and had recompiled it in moderncv. Sorry for the mess around.

---
name: Dr. Micheline Campbell
date: "`r format(Sys.time(), '%B, %Y')`"
qualifications: BA(Hons), PhD
position: Scientist, QLD Dept. of Natural Resources, Mines, and Energy
address: Rockhampton, Australia
phone: +61 
email: [email protected]
github: MichelineCampbell
twitter: michcampbell_
headcolor: 414141
output: 
  vitae::moderncv:
    theme: classic
    keep_tex: true
---

@mitchelloharawild mitchelloharawild added bug Something isn't working and removed awaiting-mre Issue requires MRE. If not provided, will be closed in 1 month. labels Apr 26, 2020
@mitchelloharawild mitchelloharawild self-assigned this Apr 26, 2020
@mitchelloharawild
Copy link
Owner

Thanks for the reprex, I'll get this fixed before the next release.

@mitchelloharawild
Copy link
Owner

Hey @robjhyndman, is there some macro which can remove escapes from text (or a better approach entirely).

The issue is that pandoc escapes twitter_ into twitter\_, which is then passed into \href{} which doesn't require escaping _ in the url.

@robjhyndman
Copy link
Collaborator

robjhyndman commented Apr 27, 2020 via email

@mitchelloharawild
Copy link
Owner

Doesn't look like it worked. An alternate solution is to use \textunderscore, but this isn't ideal.

In the csl I've used \href{\removeabs{https://www.twitter.com/#3}}{#3}.

@mitchelloharawild
Copy link
Owner

Closing as this bug is specific to the moderncv template, which should be fixed in the moderncv repository. This bug is described here: https://bugs.launchpad.net/moderncv/+bug/1330710

This will likely be fixed as a side-effect of #69, where the template specific social link support will be replaced with a custom {vitae} solution that uses https://github.com/mitchelloharawild/icon/ to provide any social icon.

@mitchelloharawild
Copy link
Owner

Re-opening as I have found a PR to moderncv which fixes this issue: xdanaux/moderncv#77

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants