GithubHelp home page GithubHelp logo

tennets / paper-draft-tex Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 4.97 MB

"Create scientific papers draft effortlessly with this LaTeX template, seamlessly integrating MATLAB-generated high-quality figures."

License: MIT License

TeX 50.58% MATLAB 49.42%
drafting-scientific-documents latex-template matlab easy-to-use

paper-draft-tex's Introduction

paper-draft-tex

paper-draft-tex showcases how you might want to structure the draft of your scientific paper in LaTex. It also provide a useful (basic) function to format Matlab-generated figures to Latex-ready high-quality ones.

It helped me structure my ideas and results to share them effectively with my supervisors before formatting the manuscript according to the journal template.

The source codes in latex-template are edited with TeXstudio, which compiles them to produce main.pdf. The function to format the figures is written in Matlab. This work is under the MIT License and adapts these tips.

Table of Contents

How latex-template is structured?

.
|-- main.tex
|
|-- src/
|    |-- abstract.tex
|    |-- appendix/
|    |       |-- ffsp.tex
|    |-- bibliography.bib
|    |-- discussion.tex
|    |-- introduction.tex
|    |-- materials-and-methods.tex
|    |-- results.tex
|
|-- fig/
|    |-- nice-cat.jpg
|    |-- gscatter.eps
|    |-- spy.pdf

The idea is to keep this separated for a flexible and efficient management of the drafting process. If one has a lot of figures, the best strategy is to create an ad-hoc folder in fig. For instance, a fig/results folder for the figures in the Results section.

Typesetting

  • One sentence per line in your source file. For example

    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.
    Interdum velit laoreet id donec ultrices tincidunt.
    

    It is easier to source control and collaborate.

  • Select the correct Capitalization style for the title, subtitle, sections, and subsections with this tool.

  • Keep referenced object and reference number in the same line with the tilde ~ character.

    Section~\ref{sec:problem-statement} talks about ...
    

    It avoids ugly line breaks. Consider adding what you need in your preamble

    \newcommand{\refalg}[1]{Algorithm~\ref{#1}}
    \newcommand{\refapp}[1]{Appendix~\ref{#1}}
    \newcommand{\refchap}[1]{Chapter~\ref{#1}}
    \newcommand{\refeq}[1]{Equation~\ref{#1}}
    \newcommand{\reffig}[1]{Figure~\ref{#1}}
    \newcommand{\refsec}[1]{Section~\ref{#1}}
    \newcommand{\reftab}[1]{Table~\ref{#1}}
    

    Now you can write

    \refsec{sec:problem-statement} talks about ...
    
  • For tables, use booktabs package. Simple, minimalistic tables look nicer. Further details here.

  • Format number with the siunitx package. Use it to round up

    \usepackage{siunitx}
    
    % ...
    
    \sisetup{
        round-mode = places,
        round-precision = 3
    }  
    

    and to align numbers in tables.

    \usepackage{booktabs}
    \usepackage{siunitx}
    
    % ...
    
    \begin{table}
        \centering
        \begin{tabular}{lS}
            \toprule
            Letter & {Number} \\% headers of S columns have to be in {}
            \midrule
            A & 1.34092 \\
            B & 2.234000 \\
            C & 3.73333 \\
            \bottomrule
        \end{tabular}
        \caption{Numbers alignment with \texttt{siunitx}.}
    \end{table}
    

Math notation

  • Define variables with the fixmath package

    Scalars Vectors Matrices Random Varibales
    $x$ $\mathbold{x}$ $\mathbold{X}$ $X$
  • Add superscripts or subscripts to variables outside of the styling:

    Good Bad
    $\mathbold{x}_i$ $\mathbold{x_i}$
  • Define your custom commands to shortcut math notation and make the source LaTex more readable, especially if you have variables that you use a lot.

    \renewcommand{\vec}[1]{\mathbold{#1}} % for vector
    \newcommand{\mat}[1]{\mathbold{#1}}   % and matrices
    

Bibliography

For drafting purposes, set

\usepackage[backref=page]{hyperref}

It helps to track how many times and where you cite a reference. You can modify how it looks

\renewcommand*{\backref}[1]{}
\renewcommand*{\backrefalt}[4]{{\footnotesize [%
		\ifcase #1 Not cited.%
		\or Cited on page~#2%
		\else Cited on pages~#2%
		\fi%
		]}}

Figures

Write a comment above a particular figure with the command used to generate that figure in the LaTeX file. Very useful.

  • Many simple figures are better than one complex figure.

  • All figures should have the same fonts for labels and axes (define the size at the script level, avoid resizing it in the Tex document).

  • The format in which you save your figures depends on the data you want to represent, the script that generates it, and the Tex compiler you are using (latex or pdflatex).

    These are the most popular formats:

    • EPS and PDF are good choices for vector graphics content. However, PDF seems a better choice for compatibility, compilation speed, and overall results.
    • JPEG for photos, screenshots.
    • PNG for anything that does not fall in the previous two categories.

There exist many tools to format high-quality figures, like export_fig or plotly_matlab. However, if you are interested, I have written a basic version of such tools that achieve similar results. Check the documentation for ffsp. I have used it for the Matlab-generated figures showcased in this template.

paper-draft-tex's People

Contributors

tennets avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.