rstudio / rticles

LaTeX Journal Article Templates for R Markdown
https://pkgs.rstudio.com/rticles/
1.47k stars 518 forks source link

R 4.0.2 does not produce rticles:ieee_article format #351

Closed AtharKharal closed 3 years ago

AtharKharal commented 3 years ago

My following file (pasted below) uses ieee_article template but it does not produce the required output. Instead it always produces same (standard latex) format in pdf. The rmarkdown file and session info are pasted below. Help please.

---
title: Demo of IEEEtran.cls for IEEE Conferences
affiliation:
  institution:
    - name: Air University
      department: Department of Mathematics
      location: Pakistan
      email: atharkharal@gmail.com
      mark: 1
      author:
        - name: Athar Kharal
keywords: ["keyword 1", "keyword 2"]
abstract: |
  The abstract goes here.
  On multiple lines eventually.

bibliography: mybibfile.bib
output:
  bookdown::pdf_book:
     base_format: rticles::ieee_article    #elsevier_article   #ieee_article
     keep_tex: true
     template: null
header-includes:
  \usepackage{amsfonts}
  \usepackage{graphicx}
citation_sorting: none   ## used as sorting option of the biblatex package (if selected)
---

Introduction
=============
This demo file is intended to serve as a ``starter file''
for IEEE conference papers produced under \LaTeX\ using
IEEEtran.cls version 1.8b and later.

I wish you the best of success.

## Subsection Heading Here
Subsection text here.

### Subsubsection Heading Here
Subsubsection text here.

Conclusion
============
The conclusion goes here.

Acknowledgment {#acknowledgment}
==============

The authors would like to thank...

Bibliography styles
===================

Here are two sample references: @Feynman1963118 [@Dirac1953888].

\newpage
References {#references .numbered}
==========

SESSION INFO: R version 4.0.2 (2020-06-22) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows 10 x64 (build 19041)

Matrix products: default

locale: [1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252 LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252

attached base packages: [1] stats graphics grDevices utils datasets methods base

other attached packages: [1] rticles_0.17.1

loaded via a namespace (and not attached): [1] compiler_4.0.2 bookdown_0.21 htmltools_0.5.0 tools_4.0.2 yaml_2.2.1 rmarkdown_2.5.3 knitr_1.30 xfun_0.19 digest_0.6.27
[10] rlang_0.4.8 evaluate_0.14


By filing an issue to this repo, I promise that

I understand that my issue may be closed if I don't fulfill my promises.

cderv commented 3 years ago

Instead it always produces same (standard latex) format in pdf.

What do you mean by that ?

Can you format you code correctly to that it is easier for us to reproduce based on your example ? And check that your yaml header has the correct indentation. When I tried, it works ok for me.

About how to format, it is in the issue guide you should follow: https://yihui.org/issue/#please-format-your-issue-correctly

Thank you.

AtharKharal commented 3 years ago

Sorry for the incorrect code formatting. I have corrected the issue above. By saying "produces same format in pdf" I mean to say that the choice of rticles::ieee_article does not produce a 2 column IEEE-like document, rather it gives a standard LaTeX Article with its contents on first page and having only 1 column.

cderv commented 3 years ago

Thanks for the formatting

output:
  bookdown::pdf_book:
     base_format: rticles::ieee_article    #elsevier_article   #ieee_article
     keep_tex: true
     template: null

I believe this is because you explicitly tells the format not to use any template. That means the default Pandoc template will be use, instead of the ieee template you want.

Why set template: null ?

cderv commented 3 years ago

Can you remove this template: null and retry ? It should work as expected.

AtharKharal commented 3 years ago

Thanks, issue solved. In fact I feel myself quite stupid now! Regards

cderv commented 3 years ago

Don't be too hard on yourself ! This is by asking questions to have another set of eyes on something that we find answer quicker and learn in the process.

Do not hesitate to ask question on https://community.rstudio.com for examples, there is a broad community ready to help by having another look when you're stuck !

Glad we solve it !

github-actions[bot] commented 3 years ago

This old thread has been automatically locked. If you think you have found something related to this, please open a new issue by following the issue guide (https://yihui.org/issue/), and link to this old issue if necessary.