Skip to content
Public template

About

A Makefile-Based TexTemplate for Computer Graphics Research Papers

Resources

Stars

5 stars

Watchers

2 watching

Forks

Repository files navigation

LaTeX Computer Graphics Paper Template

This a Latex built environment designed for computer graphic papers. It has the following features:

  • Organized template for writing computer graphic papers.
  • Makefile-based build process
  • Includes templates from common graphics journals and conferences
  • Inkscape-Latex support: vector-graphics with selectable text in the same font of the paper.
  • Auto-Preview script for the entire document
  • Auto-Preview script for Inkscape-Latex figures.
  • Auto-Preview script for tables.
  • Auto-Preview script for bibliography.
  • Templates for multiple journals and conferences
  • Inkscape color-palette template.
  • Inkscape style templates for various publications.
  • Works with native Linux, Linux on WSL2, and in virtual machines.
  • Auto downloads templates for non-CTAN packages
  • Optional supplemental material as a second pdf with references into the paper.
  • Consistent references with cleveref ("Sec. 3", "Eq. (4)").
  • Packages for copy-editors and arXiv that build without Inkscape.
  • GitHub workflow that builds the pdfs on demand and publishes them as releases.
  • A style guide for writing papers, see STYLEGUIDE.md.
  • A prompt to check a paper against the style guide with an AI, see STYLECHECK.md.
  • A short sample paper that follows the style guide, with a test bed for the template in its appendix.

Installation

A Linux Work Environment

You need a Linux distribution. I use Ubuntu 22.04.3 LTS. On Windows, you can install it from WSL2. You find resources on the internet on how to install WSL2 and Ubuntu.

Install Linux Packages

You need the following packages in your Linux distribution:

  • make for building various artifacts
  • pdflatex as latex compiler
  • bibtex for the bibliography
  • inkscape for editing and converting vector-graphics
  • texlive-full as your Latex Environment
  • evince for viewing the document and figures.

To install them on Ubuntu 22.04.3 LTS, open a bash and type

sudo apt update
sudo apt install make inkscape texlive-full evince 

Note that texlive-full is large, but you will be on the save side. You can get away with a much smaller installation if you use the so-hier-method ("so hier" is German for "well, let's see" ): Type make, see what is missing, and install the missing packages. Then repeat until you get no more error messages.

Programs

You need a text editor, like Visual Studio Code. You further need inkscape for editing and converting svg graphics. WSL users can use either the Windows version of those programs or the Linux version. I lean towards the Windows version.

User Guide

Select a Template

To select a template, find out what templates are in the templates folder. For example, in a shell type

> ls -a templates/

and you will see

.  ..  acmart  eg  elsearticle  feif  jcgt  tufte

The default is eg. Some templates, e.g., eg and jcgt, download their class files from the publisher's website into download/ on the first build.

Say you want to submit for jcgt. Open the Makefile located in the root folder and find the line where the variable TEMPLATE_PATH is declared and defined. You might find for example something like:

TEMPLATE_PATH				:= templates/eg

Change it to

TEMPLATE_PATH				:= templates/jcgt

In the shell run

make rebuild

to rebuild the document. Your document should now use the jcgt file.

If you want to use another template, exchange jgct with whatever template you want and find in the templates folder.

Template structure

Every template should contain the following files:

  • BibPreview.tex: A document that contains all the bibliography of common/bibliography.bib.
  • FontSample.svg: A document showing the difference between fonts generated by Latex (shown in red) and fonts rendered by inkscape.
  • main.tex: The main document that builds the entire document.
  • NAMETemplate.svg, where NAME is the name of the name of the template: A template svg for inkscape drawings.
  • FigPreview.tex: A template document for previewing pdf-latex svgs.
  • TabPreview.tex: A template document for previewing tables.

Optionally, a template contains:

  • supplemental.tex: The preamble of the supplemental material, see "Supplemental Material".
  • arxiv.tex: Overrides of the document class for the arXiv version, e.g., to remove conference headers, see "arXiv".

Paper Filename and Blind Submission

Set the paper filename without the pdf extension in the Makefile. Find the line that says

OUTPUT_FILE					:= Paper1024

and change Paper1024 to whatever value you want. The supplemental pdf and the GitHub workflow pick up the new name automatically.

Further you can set, whether you want a blind submission or not by changing the first line of main.tex and supplemental.tex

\newcommand{\BlindSubmission}{1}

to 1 for a blind submission and 0 for non-blind submission. The paper number in the blind author line is set in template/main.tex and template/supplemental.tex. Good templates should properly deal with variable by hiding author information and acknowledgements. But it is in your responsibility to make sure, no author information is revealed if that is necessary.

Set Authors, Title, and other Paper-Related Information

Since every template handles setting authors, title, and other paper-related information differently and it is hard to find common abstractions, you must set this information for each template separately.

Therefore, open the file template/main.tex and set all the information according to the template's guidelines.

Edit Document

Sections

In the folder secs, you can place your LaTeX text content. Typically, those are the sections or chapters of your document. You can order them in the secs/structure.tex file and use the LaTeX \input command. The appendix goes into secs/appendix.tex, which template/main.tex inputs where the venue wants it, e.g., after the bibliography for EG and ACM.

Teaser and Abstract

An exception are A0abstract.tex and A0teaser.tex. The template/main.tex inputs them appropriately. Therefore, you must name them A0abstract.tex and A0teaser.tex, otherwise the template will not find them.

Sample Paper

The template comes with a short sample paper, "How Wrong Is Affine Texture Mapping?". It shows STYLEGUIDE.md at work: an SVG teaser with embedded renderings (figs/teaser.svg), a TikZ figure (figs/edge_diagram.tex), plots from CSV data (figs/error_plots.tex, figs/data), a generated table (tabs/subdivision.tex), a code listing (codes/interpolation.tex), and supplemental material. The script scripts/sample_paper.py renders the images and writes the data and the table; it needs numpy, Pillow, and matplotlib. The appendix holds the list of symbols and a test bed (secs/D1TestBed.tex) for fonts, page layout, acronyms, and figures. Replace the sample by your paper, but keep the test bed as long as you change the template.

Common

In the common folder, you find acronyms, commands, packages, and the bibliography that typically persist across multiple papers. They are automatically included in each template.

Bibliography

Making sure that the bibliography looks good, requires frequent tweaking. Therefore, there is a the BibPreview.sh script that builds a document BibPreview.pdf with the entire bibliography in the current template style. You can interactively edit the bibliography file. Upon saving, the script will update BibPreview.pdf.

Alternatively, you can type make bibpreview or make BibPreview.pdf to create BibPreview.pdf.

Building the Document, Viewing the Document, and Interactive Editing and Viewing

For building and viewing the document, we offer several commands.

Build

Type make to build the document. In case you made an error, the console will tell you the error. After fixing, you can launch make again and see if the error is fixed.

Viewing

For viewing the document, type make view. It will open evince that will show the document. You can use any other PDF Viewer, too, but some lock the file while viewing and you need to close it before building the document again.

Interactive Viewing and Editing

For interactive viewing, use the script

./Preview.sh

It will detect changes and automatically rebuild your document. This is very convenient.

Clean

For removing all output, type

make clean

Rebuild

To rebuild from scratch, type

make rebuild

This might become necessary in case you get weird errors.

WSL Performance

Place the project files in your WSL home directory and run make from there. When placing the project files in a native Windows directory, I observed a performance penality of up to 3x. To access the files from Windows, enter \\WSL$\ in the address path of your explorer.

Supplemental Material

If the root folder contains supplemental.tex and the selected template contains supplemental.tex, make also builds build/<OUTPUT_FILE>_Supplemental.pdf. Write its content in secs/S0supplemental.tex. The supplemental reads the labels of the paper with the xr package, so \cref{eq:MaxError} in the supplemental shows the equation number of the paper. The supplemental has its own bibliography, which appears only if the supplemental cites something. Write \SupplementalName where the paper refers to the supplemental material: it reads "supplemental material", or "appendix" in the arXiv version. Delete supplemental.tex if you do not need a supplemental.

References

Use \cref{label} for references, or \Cref{label} at the start of a sentence. cleveref adds the name from the type of the label, e.g., "Sec. 3", "Tab. 1", or "Eq. (4)". Within a sentence, the names are abbreviated, at the start of a sentence they are written out. To change the style for the whole document, edit the \crefname and \Crefname lines in common/packages.tex. Only referenced equations get a number (showonlyrefs); \cref and \eqref both count as references. To number an equation that is only referenced from elsewhere, e.g., from the supplemental, add \noeqref{label} after it.

Figures

In computer graphics, figures are important. There we have templates,

Templates

In the folder figs there is a BaseTemplate.svg with colors, line widths, dashes, line caps, arrows, and colors.

For editing graphics in inkscape, each template folder should have a *Template.svg in its template folder. Use the script tools/InstallInkscapeSVGTemplate.sh copies the template to the inkscape folder. Copy it into the Inkscape palette folder which is either

  • %USERPROFILE%/AppData/Roaming/inkscape/templates (Windows)
  • ~/.config/inkscape/templates (Linux)

Palettes

You can find a palette file in common/inkscape/PaperPalette.gpl. Copy it into the Inkscape palette folder which is either

  • %USERPROFILE%/AppData/Roaming/inkscape/palettes (Windows)
  • ~/.config/inkscape/palettes (Linux)

There is a script in tools/InstallPalette.sh that attempts to copy the file to the Inkscape configuration folder. See the scripts's help message for more details.

Create Palettes

In case you want to create your own palette file, proceed as follows:

  • Create an svg with boxes and use fill colors.
  • Order the boxes back to front in the order in which you want the colors to appear in your palette file.
  • Use the script ColorPaletteCreator.sh to create a gpl file.

See the scripts's help message for more details.

PDFTex Figures

Inkscape has the ability to split an svg into a pdf and tex file. It puts everything that is text into the tex file and the rest in pdf. The tex file loads the pdf and places the text at the appropriate location.

This has the advantage that your fonts are always consistent with the template. Further they are selectable by the viewer of your document. You can also use Latex maths in your figures. The disadvantage is that the text placement can be cumbersome at times, but see the following section "Edit and Preview" for a tool that deals with the problem.

To include them in your document use

\includesvg{figs/figure}

Interactive Preview

In can at times be cumbersome to have the Latex text placed at the right location when using PDFTex for figures. Constant rebuilding of the entire document is time consuming.

To alleviate this problem, use the script FigPreview.sh. From a single svg file, it creates a pdf and tex file, and creates a special pdf that just shows that figure. Whenever the input svg changes, the script rebuilds the pdf.

By this you can almost interactively tweak the output.

To run the script, call

./FigPreview.sh figs/figure.svg

where figure.svg is the figure.svg you want to watch. See the scripts's help message for more details.

SVG Figures

To include svg figures without going through latex use

\includesvg[inkscapelatex=false]{figs/figure}

where figure.svg is your figure. Note that you are not supposed to add the .svg extension to the filename. Hence, figs/figure.svg would be the wrong argument for \includesvg. Also note, that you bypass inkscape-latex with the optional argument inkscapelatex=false

Pixel-Graphics

To include pixel-graphics use

\includegraphics{imgs/image.png}

However, you also include the screenshots in svg files.

Tables

Place tables in the tabs folder. You include tables in your document with \input command.

For example, if you want to include the table tabs/mytable.tex use

\input{tabs/mytable.tex}

You can preview a table with the script TabPreview.sh Type

TabPreview ./tabs/mytable.tex

and the table will be displayed in a custom pdf that the script auto updates in case you modify tabs/mytable.tex.

Fonts

For having font consistency between templates and figures, especially when your not making using Inkscape's export-latex feature, you need to figure out what fonts your document is using, so that you can set them in other tools.

To find out what fonts are used, use the tool pdffonts.

user@host:~/$ pdffonts build/main.pdf
name                                 type              encoding         emb sub uni object ID
------------------------------------ ----------------- ---------------- --- --- --- ---------
CJSCAC+NimbusRomNo9L-ReguItal        Type 1            Custom           yes yes yes     17  0
PQPZGB+NimbusRomNo9L-Regu            Type 1            Custom           yes yes yes     18  0
OMLVZQ+NimbusSanL-Bold               Type 1            Custom           yes yes yes     20  0
OCEVAD+NimbusRomNo9L-Medi            Type 1            Custom           yes yes yes     21  0
NMAAKQ+NimbusSanL-Regu               Type 1            Custom           yes yes yes     23  0
KXUMIR+NimbusSanL-ReguItal           Type 1            Custom           yes yes yes     54  0
EAAPUO+CMMI6                         Type 1            Builtin          yes yes yes     70  0
QEFADV+CMR6                          Type 1            Builtin          yes yes yes     71  0
WKFGUA+CMMI10                        Type 1            Builtin          yes yes yes     72  0

The last three rows contain "CM" which is short for Computer Modern. Those fonts do not typically come with Windows, but you can get them from

and install them. Once you have them, you can use them in Inkscape.

Every template should have a FontSample.svg located in its folder. They, we approximate the fonts from the Inkscape's PDF import, called "Cairo import" with regular Inkscape fonts. It is not perfect, but works most of the time.

Alternatively, you can copy fonts from Linux to a temporary Windows directory. Then, in Windows you install them, by right-clicking on the font in the Windows Explorer and selecting "Install" from the popup menu. For example, in my Linux installation, some fonts like Nimbus Roman are in /usr/share/texmf/fonts/opentype/public/lm/.

Packaging

Publishers require tex sources of your document in a simple format. To create that, call

make package

and a folder build/package and a zip file build/package.zip with its contents will be created. The package contains the sources of the paper and the supplemental, only the SVG figures that the document uses, and their Inkscape conversions. Hence, it builds without Inkscape and without -shell-escape. If the template downloads its class files, the package contains them, too. Make sure that the paper can be built by executing the following commands:

cd build/package
make view

arXiv

To create a submission for arXiv, call

make arxiv

It creates build/arxiv.zip and a preview build/<OUTPUT_FILE>_arXiv.pdf. The arXiv version is a single document: the paper with authors, followed by the supplemental as appendix. Since arXiv runs neither BibTeX nor Inkscape, the zip contains the .bbl and the Inkscape conversions; the SVGs are replaced by placeholders to stay below arXiv's size limit. If the template downloads its class files, the zip contains them, but not their sample documents. If the template contains arxiv.tex, it is loaded in the arXiv version, e.g., to remove conference headers and footers.

To test the zip as arXiv processes it, call

make arxiv-test

It unzips the zip into an empty directory, runs plain pdflatex without BibTeX, Inkscape, and -shell-escape, and fails on errors, undefined references or citations, conference markings in the pdf, and zips above 50 MB. Before submitting, upload the zip to arXiv without submitting it, and check the pdf that arXiv shows.

Releases and GitHub Workflow

The workflow in .github/workflows/build-pdf.yml runs only when you start it (Actions tab, Build PDF, Run workflow), since every run costs GitHub Actions minutes. It builds the pdfs, attaches them to the workflow run, and publishes them to the rolling release latest. To build on every push, add the push trigger that the comment in the workflow shows. To publish a permanent release, run the workflow with a tag, or call

make release RELEASE_TAG=camera-ready

which requires the GitHub CLI gh.

Style Guide

STYLEGUIDE.md describes how we write papers and theses: language, acronyms, structure, mathematics, figures, captions, tables, code, references, citation keys, assets, and a checklist before you hand in a draft. The sample paper in secs/ follows it. STYLECHECK.md has a prompt that lets an AI check your paper against the guide.

History

I have always been using LaTeX to create my computer graphics research papers. Even though I work on Windows, I found that Linux systems provide the best LaTeX environments. Before WSL, I wrote my LaTeX documents in a Linux virtual machine. Since there is WSL2, I use it directly in Windows.

While I maintain this template on a Windows machine, I anticipate that you can use on a native Linux, too.

Open Issues

  • TODO Improve Hochschule Coburg Template?
    • TODO: Tab Preview
    • TODO: Fig Preview
    • TODO: Bib Preview
    • TODO: Glossar Preview
    • TODO: Acronym Preview
    • TODO: List of Symobls Preview
    • TODO: Font Sample
    • TODO: Create FEIFTemplate.svg
  • TODO Should we add a template for grant applications?
  • TODO Refine Tufte Template
  • TODO Make a macro to include graphics and tables.

About

A Makefile-Based TexTemplate for Computer Graphics Research Papers

Resources

Stars

5 stars

Watchers

2 watching

Forks

Contributors

Languages