2016-06-16 4 views
2

[환경 : 윈도우 7, R 3.2.3, RStudio, 최신]knitr/pandoc : 섹션에 대한 상호 참조, 하위

나는 섹션에 레이블을 원하는 기사를 될 수있는 knitr .Rmd 문서가 "나는 토론 3.2에서 ..."

## Mean differences {#sec:meandiff} 

과이 같은 텍스트에 나타납니다 그래서 그 부분을 참고로,이 같은 뭔가가 bookdown를 사용 가능하다 볼 수 있으며, 일부 언급이있다 pandoc 문서에있는 "Internal links"중 http://rmarkdown.rstudio.com/authoring_pandoc_markdown.html#links을 사용해 보았지만 제대로 작동하지 않습니다. RStudio 관련 문서 나 블로그에서이 점을보고는 있지만 지금은 찾을 수 없습니다.

--- 
title: "My title" 
author: Moi Meme 
date: '`r format(Sys.time(), "%B %d, %Y")`' 
output: 
    pdf_document: 
    fig_caption: yes 
    keep_tex: yes 
    number_sections: yes 
    includes: 
     in_header: mystyles.tex 

이 때로 믿을 수 :

나는 그러나, 생성 된 PDF가
In Section (@#sec:meandiff) ... 
In Section (???) ..., with: pandoc-citeproc: reference sec:meandiff not found 
In Section (#sec:meandiff) ... 

내가 사용하고있어 YAML 헤더는이 단지

로 렌더링

In Section (@#sec:meandiff) ... 
In Section (@sec:meandiff) ... 
In Section (#sec:meandiff) ... 

같은 여러 가지 시도 그렇게 많은 상호 참조를 수동으로 처리 할 수는 없지만, pandoc에 의해 행해지는 문법에 대해 힌팅을하면 쉽게 할 수 있습니다. \label의이 인하/pandoc 전문에

에 의해 생성되는 동안

+0

현재 다중 출력 형식에 대해 기본적으로 지원되지 않습니다,하지만 거기에 [거대한 토론 ...] (https://github.com/jgm/pandoc/issues/813) – mb21

+0

이있을 수 있습니다 유 seful : https://rpubs.com/ajlyons/autonumfigs – sparrow

+0

booksdown : https://bookdown.org –

답변

1

아, 내가 라텍스 발생하고있어 이후, 난 그냥, 상호 참조를 수행하는 데 사용할 수 있습니다

\newcommand*{\secref}[1]{Section~\ref{#1}} 

다음 텍스트

In \secref{sec:mean-diff} ... 
... 

## Mean differences {#sec:meandiff}