私はRmarkdown(LaTeX経由でPDFにエクスポート)で論文を執筆しており、本文の単語数を数えなければなりません。Rマークダウンの単語数からセクションを除外する
%TC:ignore
The part that is to be ignored (e.g., Appendix)
%TC:endignore
どのように私は私のRMDファイルにLaTeXのコメントを含めることができます:LaTeX文書では、私は私が私のTEX文書に次のタグを使用してワードカウントから除外したい部分を指定して、コマンドラインからtexcount
を使用します再作成するたびに、手動で%TC
行をtexファイルに追加しないでください。
texcount MWE.tex
をし、答えは次のようになります。私は.Rmdファイルを編成し、出力.texファイルを持っていたら
---
output:
pdf_document:
keep_tex: yes
---
Words that I want to count.
<!-- TC:ignore -->
Words that I want to exclude but cannot,
because the comments do not appear in the `.tex` file.
<!-- TC:endignore -->
%TC:ignore
Other words that I want to exclude but this does not work either
because `%` is not interpreted as \LaTeX comment.
%TC:endignore
#%TC:ignore
Another attempt; it does not work because `#` is for sections,
not comments.
#%TC:endignore
は、私が入力したい:ここ
は私のMWE.Rmd
です6ワード ありがとう!
UPDATE 1:Twitterの上で
、@amesoudiはRStudioアドイン(WordCountAddIn)私のRMDの文書内の単語をカウントするために使用して提案しました。アドインはそこにありますhttps://github.com/benmarwick/wordcountaddin。しかし、これは自動化されておらず、指差しとクリックがまだまだあります。
UPDATE 2:
別の解決策は、
例えば、コメントをラテックスすべきかを識別するための特定の表現を使用することであろう
.Rmd
ファイルでLATEXCOMMENT%TC:ignore
、は、我々はできる、自動的に生成さ
.tex
文書(例えばsed
)