ulyngs / oxforddown

Template for writing an Oxford University thesis in R Markdown; uses the OxThesis LaTeX template and was inspired by thesisdown.
https://ulyngs.github.io/oxforddown/
MIT License
220 stars 80 forks source link

Multiple abstracts with different languages #39

Closed Truong-An-Nguyen closed 2 years ago

Truong-An-Nguyen commented 2 years ago

Hello,

Is there any options to add second abstract in different language?

I tried to update the template.tex as below, but it still render the title as "Abstract", not "Résumé"

%%%%% ABSTRACT -- Nothing to do here except comment out if you don't want it.
\begin{otherlanguage}{french} 
\begin{abstract}
    $abstract2$
\end{abstract}
\end{otherlanguage}

Thanks

bttomio commented 2 years ago

Here is how I managed to add a second abstract (French) by editing the file _abstract.Rmd.

It would be awesome to have an easier way :)

Truong-An-Nguyen commented 2 years ago

Here is how I managed to add a second abstract (French) by editing the file _abstract.Rmd.

It would be awesome to have an easier way :)

Thanks @bttomio, it works with a small correction in the index.Rmd. I added encoding = "UTF-8" to read the French accent

abstract: |
  `r paste(readLines("front-and-back-matter/_abstract.Rmd",encoding = "UTF-8"), collapse = '\n  ')`
bttomio commented 2 years ago

Thanks, @Truong-An-Nguyen!

ulyngs commented 2 years ago

Just added an easy way to do this in 1bb3bf678c9be3be9e8253685a54752d4f88b989

In index.Rmd you can now just go like

abstract: |
  `r paste(readLines("front-and-back-matter/_abstract.Rmd"), collapse = "\n  ")`
abstract-second-heading: "Resumé"
abstract-second: |
  `r paste(readLines("front-and-back-matter/_abstract_french.Rmd", encoding = "UTF-8"), collapse = "\n  ")`