pagedown html resume - 如何将 aside 部分中的免责声明部分移动到最后一页?

pagedown html resume - How to move disclaimer section within aside section to the last page?

template resume from pagedown为例,我想要免责声明部分(目前在第一页的右下角,阅读“This resume was made with the R package pagedown.最后更新于 2021-08-18。") 移至最后一页的底部。

我在下面粘贴了模板 r-markdown 文档,但也可以通过在 R Studio 中打开一个新的 R-markdown 文档,然后选择“来自模板”部分和“HTML继续。

我从文档和阅读各种自定义解决方案中了解到 CSS 会涉及,但我不确定如何使用 CSS 将该部分强制到最后一页。

---
title: "Lijia Yu's resume"
author: Lijia Yu
date: "`r Sys.Date()`"
output:
  pagedown::html_resume:
    # set it to true for a self-contained HTML page but it'll take longer to render
    self_contained: false
# uncomment this line to produce HTML and PDF in RStudio:
#knit: pagedown::chrome_print
---

Aside
================================================================================


![Lijia Yu](https://avatars1.githubusercontent.com/u/895125?s=400&v=4){width=80%}


Contact Info {#contact}
--------------------------------------------------------------------------------

- <i class="fa fa-envelope"></i> lijia.yu@outlook.com
- <i class="fa fa-github"></i> [github.com/yulijia](https://github.com/yulijia)
- <i class="fa fa-phone"></i> +1 000-000-0000
- For more information, please contact me via email.


Skills {#skills}
--------------------------------------------------------------------------------

- Experienced in statistical analysis, statistical learning models, and optimization methods.

- Full experience with next generation sequencing data analysis.

- Highly skilled in R, Bash, Perl, Python, LaTeX


Disclaimer {#disclaimer}
--------------------------------------------------------------------------------

This resume was made with the R package [**pagedown**](https://github.com/rstudio/pagedown).

Last updated on `r Sys.Date()`.



Main
================================================================================

Lijia Yu {#title}
--------------------------------------------------------------------------------

### Currently searching for a PhD student position

Please note that this is a *real* resume, and I'm really looking for a PhD
student position at the moment. I made this resume because Yihui asked me
if I'd like to test the **pagedown** package with my resume. If you are
interested in my background and skills, please feel free to contact me.


Education {data-icon=graduation-cap data-concise=true}
--------------------------------------------------------------------------------

### Beijing University of Chemical Technology

B.S. in Information and Computing Sciences

Beijing, China

2010

Thesis: Dyadic wavelet and its application in edge detection

### University of Chinese Academy of Sciences

M.S. in Bioinformatics

Beijing, China

2014

Thesis: A multi-omics study for intra-individual divergence of the distributions between mRNA isoforms in mammals


Research Experience {data-icon=laptop}
--------------------------------------------------------------------------------

### Graduate Research Assistant

Beijing Institute of Genomics, Chinese Academy of Sciences

Beijing, China

2011 - 2014

- Performed computational biology research towards understanding regulation of alternative splicing in human and mouse transcriptome.
- Found EGFR pathway related mutations, aimed to understand the impacts of cancer mutations on EGFR signaling pathway.

### Bioinformatican

My Health Gene Technology Co., Ltd.

Beijing, China

2015 - 2016

- Investigated how cancer cells spread to other parts of the body at the single cell level.

### Visiting Scientist

University of Alabama at Birmingham

AL, USA

2016 - 2018

- Investigated the role of mitochondria in development of cancer.
- Investigated the evolution of genome architecture and its role in important evolutionary events.
- Detected thrombotic thrombocytopenic purpura related mutations in mutiple patients' blood genome.
  

Professional Experience {data-icon=suitcase}
--------------------------------------------------------------------------------

### Data Scientist, intern

SupStat Inc.

Beijing, China

2014

::: concise
- Taught R language to beginners. 
- Wrote Shiny app demos.
- Converted statistical tutorials from SPSS to R language.
:::

### Bioinformatician

My Health Gene Technology Co., Ltd.

Beijing, China

2015 - 2016

::: concise
- Analyzed whole-exome sequencing data. 
- Wrote analysis pipelines of ChIP-seq, single cell DNA-seq and single cell RNA-seq.
- Studied tumor metastasis and wrote research reports. 
- Also did case studies to identify the genetic defect causing rare disease.
:::


Teaching Experience {data-icon=chalkboard-teacher}
--------------------------------------------------------------------------------

### Introduction to R Language for Beginners.

Instructor of R and Data Mining Training Courses at SupStat Inc.

Beijing, China

2014

### Computational Biology and Bioinformatics.

Teaching assistant of GBS CB2-201 courses at UAB

AL, USA

2016 - 2017


Selected Publications and Posters {data-icon=file}
--------------------------------------------------------------------------------

### Genetic and epigenetic signals are found predictive to the distribution of intra-individual divergence of alternative splicing.

Poster for 2013 International Conference of Genomics

Qingdao, China

2014

**Yu L**, Chen B, Zhang Z.

### ESCRT-0 complex modulates Rbf mutant cell survival by regulating Rhomboid endosomal trafficking and EGFR signaling.

J Cell Sci. 2016 May 15;129(10):2075-84.

N/A

2016 

Sheng Z, **Yu L**, Zhang T, Pei X, Li X, Zhang Z and Du W. 

你想要的最好的方法是要求作者支持这个功能。这是在不更改源代码的情况下执行此操作的技巧。将此块添加到 Rmd

的末尾
```{js move_disclaim, echo=FALSE}
(function() {
    var pages 
    var timer = 0;
    var changeDC = setInterval(function() {
        pages = document.querySelectorAll('.pagedjs_page');
        if(pages.length !== 2 && timer <= 5000) {
            timer += 200;
            return;
        }
        if(pages.length !== 2 && timer > 5000) return clearInterval(changeDC);
        var firstPage = pages[0];
        var lastePage = pages[pages.length - 1];
        var aside = firstPage.querySelector('#aside');
        var asideClone = aside.cloneNode();
        asideClone.id = "aside_last";
        var disclaim = document.querySelector('#disclaimer');
        asideClone.appendChild(disclaim);
        lastePage.querySelector('.pagedjs_page_content > div').appendChild(asideClone);
        clearInterval(changeDC);
    }, 200);
})()
```

它有什么作用:

  1. 为什么我不只使用 CSS?因为我做不到。免责声明的样式是 position: absolutediv 之内 position: relative。所以它被锁在相对div里面。你对此无能为力(除非我不知道的技巧)。
  2. 我的想法是用js把那个元素移到最后一页。
  3. 每次打开网页时,页面布局都会使用异步 js 功能动态呈现。可能不是你想象的那样,当 Rmarkdown 完成渲染后,我们应该已经准备好页面了。不,不是,作者使用了一个叫做{paged.js}的库来做渲染。它会在您每次打开浏览器选项卡时生成布局。
  4. 作者在渲染完成时没有触发任何事件,所以我无从知晓渲染完成。所以我不知道什么时候可以开始搬家
  5. 我的做法是添加一个每200ms运行一次的定时器。如果渲染完成,我会移动并删除计时器,或者如果它花费超过 5 秒,我认为它有问题,清除计时器并且什么也不做。
  6. 您需要定义的一件事是 pages.length !== 2。您需要知道它会生成多少页,这应该是一个您可以轻松获得的固定数字。