Coder Social home page Coder Social logo

anhnguyendepocen / tex4econ Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fanwangecon/tex4econ

0.0 0.0 0.0 13.84 MB

Latex code examples (reference, equations, tikz, etc.) for research papers

Home Page: https://fanwangecon.github.io/Tex4Econ/

License: MIT License

TeX 71.04% R 0.25% CSS 14.80% JavaScript 13.92%

tex4econ's Introduction

HitCount Star Fork Star

This is a work-in-progress website of support files for writing various files with latex, produced by Fan. The project includes sample file for papers, exams, homeworks, etc.

From Fan's other repositories: For dynamic borrowing and savings problems, see Dynamic Asset Repository; For code examples, see also Matlab Example Code, R Example Code and Stata Example Code; For intro econ with Matlab, see Intro Mathematics for Economists, and for intro stat with R, see Intro Statistics for Undergraduates. See here for all of Fan's public repositories.

Materials gathered from various projects in which latex is used. The goal of this repository is to make it easier to find/re-use latex files produced for various projects.

1. Latex Bib, Equations, Tables, Figures

  1. Biblatex Citation and Bibliography: tex | pdf
    • biblatex-chicago; \textcite{becker_human_1986}; \autocite{becker_human_1986}
  2. Section References, Vary Link Colors by Section: tex | pdf
    • Section \ref{sec:intro} (Page \pageref{sec:intro}); \hypersetup{hidelinks=true}
  1. Multiple Lines: tex | pdf
    • split vs gathered
    • substack vs array
  2. Equation Cases: tex | pdf
    • cases
  1. Symbols and Accents: tex | pdf
    • underline vs overline, underaccent bar vs bar
    • boldsymbol vs mathbf
  1. Multi-Panel Estimation Table: tex | pdf
  2. Small Estimates Table: tex | pdf

1.5 TIKZ

  1. Tikz Page Layout: tex | pdf
    • relative positioning, proportional to textwidth
    • two or four subfigures
  2. Tikz Timeline: tex | pdf
    • straight and curved connected lines
  3. Tikz Dynamically Sized Eight Pane Model Timeline: tex | pdf
    • Dynamically sized panes for prior, current and next periods
    • Dynamically sized ext panes, graph panes and labeling areas
    • Parametrized proportioning of panes with dynamic adjustments
  4. Tikz Linear Spline Equation Plotting: tex | pdf
    • sum of linear equations
    • linear spline and inverted linear spline
    • def, domain, variable, plot
  5. Tikz Figure Annotation: tex | pdf
    • point to intercept and slope
  6. Tikz Game Strategy Graphs: tex | pdf
    • continuous and discrete strategies
    • strategy branches, curved and straight lines

2. Latex Layout etc.

2.1 Sizing

  1. Reduce Line-Gap: tex | pdf

2.2 Footer and Headers

  1. Repaginate Response for Referees: tex | pdf

2.3 Conversion

  1. Pandoc File Conversion: tex | pdf

3. Overleaf Integration and Template

In overleaf, click on New Project, choose upload project, then select zip below.

  1. Template Figure Table and Reference: tex | pdf | zip
  2. Template Figure Table and Reference Roman 12 Double Space: tex | pdf | zip
  3. Template Paper, Response to Referees, Section Numbering and Bib: tex | pdf | zip
    • figures, tables, references
    • separate page numbers for each section: \renewcommand{\thesection}{\arabic{section}}
    • separate heading count for responses to referees: \setcounter{section}{0}
    • separate bibliographies: refsection
  4. Template Recommendation Letter: tex | pdf | zip
    • recommendation letter with logo and signature
    • contact and address panel

3.4 Github Integration

This overleaf project is synced with this git repository. You can clone the project, pull project to overleaf, and compile in overleaf browser. Specifically: clone the repo; go to your overleaf account and create a project; click on menu under sync with git/github.

The writing/structure is to:

  1. Store latex formatting file etc in separate files away from paper tex.
  2. For papers, write in tex fragments stored in separate files. Main tex paper file mainly contains structure/outline.
  3. Files synced through git/github, pull from github to edit/share with co-authors on overleaf.com or edit locally.

Please contact FanWangEcon for issues or problems.

For papers that are not too long, we might write all tex contents on the same page. This is the example single-file paper tex file, and this is the pdf output. Even for single-file papers, various paper components listed below should be stored separately for clarity and convenience.

The paper preamble is stored in its own file, and loads in the packages and settings, statistics/phrases/math, and citation from tex fragments listed below. A clear separation should be kept between these files, with the main preamble only loading inputs in.

The preamble file can be inserted at the top of a full paper file, for example at the top of this multi-section file.

For one-file article, we could directly load in the various tex fragments below. For example, we load these packages below into this file.

  • Numbers/Phrases/Math: various tex fragments store key file components in separate files
    • Numbers: Sometimes, we want to use the same number if various spots in the paper, these numbers should be stored as newcommands so that the number can be updated in one spot.
    • Often Used Phrases: Generally, there are terms that are used often in a paper. To make it easy to change these terms or to avoid having to rewrite over and over again, these terms could be stored as new commands.
    • Often Used Math: We might need to reuse various Math Symbols or parts of equations, they should also be stored as newcommands.
    • The aggregate PDF file, compiling all subsection tex files together.
    • The overleaf file, allowing for live compilation.
  • Citation: structure to cite efficiently
    • Preamble Settings: One file to be loaded into preambles sets citation settings.
    • End File Citation Settings: One file to be loaded at the end of the paper that determines bibliography text display.
    • bib Files: Various bib files loaded from zotero stored in own folder. Sync directly to zotero via overleaf.
  • Packages and Settings: Package loading etc.

When a paper is longer, it could be difficult to manage long latex files. Compiling could take long periods of time if the full paper requires compilation for any edits in a subsection. The structure below allows for editing paper in subsections and compiling by sections. The structure works locally as well as remotely on browser based compiler.

We compile together two files with the same structure:

  1. Multi-section blank template has no contents in the sections, useful for copy/cloning when starting new projects
  2. Multi-section template with contents has sample contents in sections, demonstrates what the file looks like filled up.

Inside overleaf, the aggregate tex file that combines all sections together should be set as the main/default file under project options. Then as subsection text fragments are edited inside overleaf, the full pdf file is updated on the right showing current changes.

The same bib file structure and preamble fragments structure is used here as in the single file case above.

6. Program Installations

  1. Install Python, R, Latex, VSCode, Atom etc: Rmd | pdf | html
    • Conda base Python, R in and outside of Conda
    • Windows and Linux instructions
    • Install various editors: VSCode, Atom, etc.
    • conda update --all
    • Rtools, install.packages(), devtools::install_github()
  2. Atom, Git, Github, etc Set-up for Linux: Rmd | pdf | html
    • sudo apt-get install atom; install git
    • git init; config; git remote add; git pull
    • wget; bash; source
    • ssh-keygen -t rsa; cat
  3. Vim and Neovim Set-up: Rmd | pdf | html
    • vimrc file, Vim-Plug plugin setup
    • Plug 'vim-airline/vim-airline'
    • vim-airline, onedkar, Goyo, Limelight

7. gitpages and git

  1. Multiple git Repositories setup with Github: Rmd | pdf | html
    • set up ssh rsa security with github
    • initalize multiple repositories
    • secure ssh session to avoid passphrase entry
    • mkdir d1 d2; git config --global; git init; git remote add
    • eval "$(ssh-agent)"; ssh-add ~/.ssh/id_rsa
    • git pull github master; git pull -u github master
  2. Sample Githug page: md | html
    • Conda base Python, and Conda environment for R
    • conda update --all
    • Rtools, install.packages(), devtools::install_github()
  3. Git Subtree: Rmd | pdf | html
    • dropbox folder as main project git
    • subfolder also as git subtree synced to overleaf
    • git: git subtree add, push, pull

8 reveal.js

8.1 reveal.js Basic Examples

  1. Go to the latest reveal.js release
    • go to the end of the latest release's release info, look for zip file and download
    • just open the zipped folder, the index.html is already working.
  2. To allow multiple files to share the same css, js, lib, and plugin, create a folder to put these folders from the zipped file.
    • in a present folder that is parallel to the css, js, and other folders, put in there testing and other html files.
    • replace links to css, js, lib and plugin in the testing files

8.2 Default Tests

  1. Default Testing File
  2. Default Demo File
  3. Modified Math Presentation

8.3 Rmd and revealjs

  1. Revealjs Rmd and PDF: Rmd | pdf | html
    • R for revealjs, include pictures
    • convert to PDF using decktape
    • git: git subtree add, push, pull
  2. Revealjs Rmd, Tex and PDF: Rmd | pdf | html
    • R for revealjs, include equations, newcommands
    • Include child tex files that define a set of newcommands
    • convert to PDF using decktape
    • git: git subtree add, push, pull

Please contact for issues or problems.

RepoSize CodeSize Language Release License

tex4econ's People

Contributors

fanwangecon 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.