Guide to writing papers and using render functions

Your Name

Your Affiliation

Introduction

This document serves as a comprehensive guide to using the rformat.php template for writing and publishing papers. It explains all the features available and provides instructions on how to use them effectively.

Getting Started

To begin using rformat.php, include the rpapersrender.php file in your script. This file contains all the necessary functions to render different sections of your paper.

Including rpapersrender.php

<?php
include '../inc/rpapersrender.php';
?>

Text Sections

Use the renderTextSection function to create text sections in your paper. You can specify the title, content, heading level, and an optional ID for cross-referencing.

Usage of renderTextSection

<?php
renderTextSection(
    'Section Title',
    'Section content goes here.',
    1, // Heading level
    'section-id' // Optional ID
);
?>

Images

You can include images in your paper using the renderImageSection function. It supports single images with positions (left, right, center) and captions.

Usage of renderImageSection for Single Image

<?php
renderImageSection('Figure 1: Example Image', [
    'type' => 'single',
    'src' => 'path/to/image.jpg',
    'position' => 'center',
    'caption' => 'An example image.'
]);
?>

Image with Text

To place an image alongside text, use the renderImageWithText function. You can position the image to the left or right of the text.

Usage of renderImageWithText

<?php
renderImageWithText('Section Title', [
    'src' => 'path/to/image.jpg',
    'position' => 'left', // 'left' or 'right'
    'text' => 'Text content goes here.',
    'caption' => 'Image caption (optional)'
]);
?>

Image Grids

To display multiple images in a grid layout, use the renderImageSection function with 'type' => 'grid'. Specify the images and the number of columns.

Usage of renderImageSection for Image Grid

<?php
renderImageSection('Figure 2: Image Grid', [
    'type' => 'grid',
    'images' => [
        'path/to/image1.jpg',
        'path/to/image2.jpg',
        'path/to/image3.jpg'
    ],
    'columns' => 3
]);
?>

Mathematical Equations

Include mathematical equations using the renderEquation function. Equations are written in LaTeX format and rendered using MathJax.

Usage of renderEquation

<?php
renderEquation('E = mc^2', 'equation-id');
?>
\[E = mc^2\]

Tables

Use the renderTable function to include tables in your paper. Provide the table title, headers, data, optional caption, and an optional ID.

Usage of renderTable

<?php
$headers = ['Header 1', 'Header 2'];
$data = [
    ['Row 1 Col 1', 'Row 1 Col 2'],
    ['Row 2 Col 1', 'Row 2 Col 2']
];
renderTable('Table 1: Example Table', $headers, $data, 'Table caption', 'table-id');
?>

Code Blocks

Include code snippets using the renderCodeBlock function. You can specify the programming language for syntax highlighting.

Usage of renderCodeBlock

<?php
renderCodeBlock('Example Code', "<?php
echo 'Hello, World!';
?>", 'php', 'code-id');
?>

Footnotes

Add footnotes to your paper using the renderFootnote function. Place a superscript number where the footnote reference should appear.

This is an example sentence with a footnote.1

1 This is the footnote content.

Citations and References

Cite sources in your paper and list them in the references section. Use anchor tags to link citations to reference entries.

Example Citation

<p>According to Smith (2020)<a href='#ref-1'>[1]</a>, the results are significant.</p>

References

  1. [1] Smith, J. (2020). Title of the Paper. Journal Name, Volume(Issue), pages.

Lists

Create ordered and unordered lists using the renderList function.

Usage of renderList

<?php
$items = ['Item 1', 'Item 2', 'Item 3'];
renderList($items, true); // Ordered list
renderList($items, false); // Unordered list
?>
  1. First item
  2. Second item
  3. Third item

Appendices

Include supplementary material in appendices using the renderAppendix function.

Usage of renderAppendix

<?php
renderAppendix('Appendix A: Additional Information', 'Content of the appendix.', 'appendix-a');
?>

Conclusion

This guide has covered all the features available in rformat.php for writing and publishing papers. Use this document as a reference to utilize all the functionalities effectively.