SlideShare a Scribd company logo
LaTeX with Git
Demo in Debian
By sppmg
Basic of git(incomplete)
git init
git add *.tex
git commit -m "msg"
edit your tex file.
edit your tex file.
git add -u
git commit -m "msg"
add all tracked file.
new file will not add . git commit -a -m "msg"
git push origin push(sync.) to remote
Compare two versions of tex
use latexdiff
$ latexdiff draft.tex revision.tex > diff.tex
$ latex diff.tex
https://www.inf.unibz.it/dis/wiki/doku.php?id=latex:diff
Combine git and latexdiff
$ git log --oneline --all --decorate --graph --color
$ git latexdiff --latexmk --latexopt "-xelatex"
--main main.tex master dev
$ git latexdiff --latexmk --latexopt "-xelatex"
--main main.tex 981a665 dev
Version history (GUI & CLI)
Compare last in 2 branch (master & dev) Compare 2 commit (981a665 & last)
LaTeX compiler
use xelatex
Tool list
1.git → VCS(Version Control System)
2.xelatex → LaTeX compiler, Chinese(if use unicode) need.
3.latexdiff → Compare two versions of tex.
4.latexpand → Expand input{} or include{} in tex.
5.git-latexdiff →It is a wrapper around git and latexdiff.
6.latexmk →It is a perl script for running LaTeX the
correct number of times to resolve cross references.
And use it bridge git-latexdiff and xelatex.
You should have it already. Or choose what you like.
Install tools in debian
# apt-get install latexdiff latexmk
$ git clone https://gitlab.com/git-latexdiff/git-latexdiff.git
$ cd git-latexdiff/
$ sudo make install-bin
git-latexdiff
latexdiff & latexmk
latexpand
debian 8(jessie)
texlive(2014.20141024-1) +
# apt-get install
texlive-extra-utils
debian 7(wheezy)
texlive(2012)
Download from ctan, put
under $PATH (eg. ~/bin)
git and xelatex
use apt, I don't
write here.
Try it now :D
Note, list difference in big project
In big project has many tex file, maybe you only want to know
which file changed.
So you can use below command:
$ git diff master dev --name-only
main.bib
main.tex
$ git diff master dev --name-status
A main.bib
M main.tex
Reference
●
http://stackoverflow.com/questions/6188780/git-latex-workflow
●
https://gitlab.com/git-latexdiff/git-latexdiff
Ad

More Related Content

What's hot (19)

Command cheatsheets mac
Command cheatsheets macCommand cheatsheets mac
Command cheatsheets mac
Paal Ringstad
 
Git cheat-sheet
Git cheat-sheetGit cheat-sheet
Git cheat-sheet
MarcoRodas9
 
Git
GitGit
Git
Johannes Thönes
 
GNU Make, Autotools, CMake 簡介
GNU Make, Autotools, CMake 簡介GNU Make, Autotools, CMake 簡介
GNU Make, Autotools, CMake 簡介
Wen Liao
 
kikstart journey of Golang with Hello world - Gopherlabs
kikstart journey of Golang with Hello world - Gopherlabs kikstart journey of Golang with Hello world - Gopherlabs
kikstart journey of Golang with Hello world - Gopherlabs
sangam biradar
 
Windows Cheatsheet
Windows CheatsheetWindows Cheatsheet
Windows Cheatsheet
Joy Seng
 
Hg version control bioinformaticians
Hg version control bioinformaticiansHg version control bioinformaticians
Hg version control bioinformaticians
Giovanni Marco Dall'Olio
 
Mastering git - Workflow
Mastering git - WorkflowMastering git - Workflow
Mastering git - Workflow
Tahsin Abrar
 
Tekton showcase - CDF Summit Kubecon Barcelona 2019
Tekton showcase - CDF Summit Kubecon Barcelona 2019Tekton showcase - CDF Summit Kubecon Barcelona 2019
Tekton showcase - CDF Summit Kubecon Barcelona 2019
Christie Wilson
 
Working in Team using Git in Unity
Working in Team using Git in UnityWorking in Team using Git in Unity
Working in Team using Git in Unity
Rifauddin Tsalitsy
 
Hg for bioinformatics, second part
Hg for bioinformatics, second partHg for bioinformatics, second part
Hg for bioinformatics, second part
Giovanni Marco Dall'Olio
 
A Quick Start - Version Control with Git
A Quick Start - Version Control with GitA Quick Start - Version Control with Git
A Quick Start - Version Control with Git
Dmitry Sheiko
 
Take the next step with git
Take the next step with gitTake the next step with git
Take the next step with git
Karin Taliga
 
Understanding about git
Understanding about gitUnderstanding about git
Understanding about git
Sothearin Ren
 
Git 101
Git 101Git 101
Git 101
Dimitris Tsironis
 
Introduction to Tekton
Introduction to TektonIntroduction to Tekton
Introduction to Tekton
Victor Iglesias
 
Mac Linux Commands cheatsheet
Mac Linux Commands cheatsheetMac Linux Commands cheatsheet
Mac Linux Commands cheatsheet
Joy Seng
 
Essential Git and Github commands
Essential Git and Github commandsEssential Git and Github commands
Essential Git and Github commands
Isham Rashik
 
Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615
Brian K. Vagnini
 
Command cheatsheets mac
Command cheatsheets macCommand cheatsheets mac
Command cheatsheets mac
Paal Ringstad
 
GNU Make, Autotools, CMake 簡介
GNU Make, Autotools, CMake 簡介GNU Make, Autotools, CMake 簡介
GNU Make, Autotools, CMake 簡介
Wen Liao
 
kikstart journey of Golang with Hello world - Gopherlabs
kikstart journey of Golang with Hello world - Gopherlabs kikstart journey of Golang with Hello world - Gopherlabs
kikstart journey of Golang with Hello world - Gopherlabs
sangam biradar
 
Windows Cheatsheet
Windows CheatsheetWindows Cheatsheet
Windows Cheatsheet
Joy Seng
 
Mastering git - Workflow
Mastering git - WorkflowMastering git - Workflow
Mastering git - Workflow
Tahsin Abrar
 
Tekton showcase - CDF Summit Kubecon Barcelona 2019
Tekton showcase - CDF Summit Kubecon Barcelona 2019Tekton showcase - CDF Summit Kubecon Barcelona 2019
Tekton showcase - CDF Summit Kubecon Barcelona 2019
Christie Wilson
 
Working in Team using Git in Unity
Working in Team using Git in UnityWorking in Team using Git in Unity
Working in Team using Git in Unity
Rifauddin Tsalitsy
 
A Quick Start - Version Control with Git
A Quick Start - Version Control with GitA Quick Start - Version Control with Git
A Quick Start - Version Control with Git
Dmitry Sheiko
 
Take the next step with git
Take the next step with gitTake the next step with git
Take the next step with git
Karin Taliga
 
Understanding about git
Understanding about gitUnderstanding about git
Understanding about git
Sothearin Ren
 
Mac Linux Commands cheatsheet
Mac Linux Commands cheatsheetMac Linux Commands cheatsheet
Mac Linux Commands cheatsheet
Joy Seng
 
Essential Git and Github commands
Essential Git and Github commandsEssential Git and Github commands
Essential Git and Github commands
Isham Rashik
 
Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615Intro to Git DevOps Tally Presentation 101615
Intro to Git DevOps Tally Presentation 101615
Brian K. Vagnini
 

Similar to Latex with git (20)

Git real slides
Git real slidesGit real slides
Git real slides
Lucas Couto
 
Git_real_slides
Git_real_slidesGit_real_slides
Git_real_slides
Khanh NL-bantoilatoi
 
Git Concepts, Commands and Connectivity
Git Concepts, Commands and ConnectivityGit Concepts, Commands and Connectivity
Git Concepts, Commands and Connectivity
Raja Soundaramourty
 
Git it on (includes git hub)
Git it on (includes git hub)Git it on (includes git hub)
Git it on (includes git hub)
Martin Bing
 
Exprimiendo GIT
Exprimiendo GITExprimiendo GIT
Exprimiendo GIT
betabeers
 
Git basic
Git basicGit basic
Git basic
Akbar Uddin
 
Presentation of sexy.rgtk
Presentation of sexy.rgtkPresentation of sexy.rgtk
Presentation of sexy.rgtk
tuxette
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
Senthilkumar Gopal
 
DrupalCafe5 VCS
DrupalCafe5 VCSDrupalCafe5 VCS
DrupalCafe5 VCS
Yuriy Gerasimov
 
Git cheat-sheet 2021
Git cheat-sheet 2021Git cheat-sheet 2021
Git cheat-sheet 2021
Rana Faisal Haroon
 
GIT Basics
GIT BasicsGIT Basics
GIT Basics
Tagged Social
 
Git Memento of basic commands
Git Memento of basic commandsGit Memento of basic commands
Git Memento of basic commands
Zakaria Bouazza
 
Git introduction
Git introductionGit introduction
Git introduction
satyendrajaladi
 
Git
GitGit
Git
Hanokh Aloni
 
Git and github
Git and githubGit and github
Git and github
Teodora Ahkozidou
 
Git and Github
Git and GithubGit and Github
Git and Github
Teodora Ahkozidou
 
HackMTY - GitHub Workshop
HackMTY - GitHub WorkshopHackMTY - GitHub Workshop
HackMTY - GitHub Workshop
Luis Lamadrid
 
Atlassian git cheatsheet
Atlassian git cheatsheetAtlassian git cheatsheet
Atlassian git cheatsheet
Abdul Basit
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?
9 series
 
The journey to GitOps
The journey to GitOpsThe journey to GitOps
The journey to GitOps
Nicola Baldi
 
Ad

Recently uploaded (20)

YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptxYSPH VMOC Special Report - Measles Outbreak  Southwest US 5-3-2025.pptx
YSPH VMOC Special Report - Measles Outbreak Southwest US 5-3-2025.pptx
Yale School of Public Health - The Virtual Medical Operations Center (VMOC)
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
How to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POSHow to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POS
Celine George
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
Operations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdfOperations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdf
Arab Academy for Science, Technology and Maritime Transport
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdfBiophysics Chapter 3 Methods of Studying Macromolecules.pdf
Biophysics Chapter 3 Methods of Studying Macromolecules.pdf
PKLI-Institute of Nursing and Allied Health Sciences Lahore , Pakistan.
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
How to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POSHow to Manage Opening & Closing Controls in Odoo 17 POS
How to Manage Opening & Closing Controls in Odoo 17 POS
Celine George
 
Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025Stein, Hunt, Green letter to Congress April 2025
Stein, Hunt, Green letter to Congress April 2025
Mebane Rash
 
Quality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdfQuality Contril Analysis of Containers.pdf
Quality Contril Analysis of Containers.pdf
Dr. Bindiya Chauhan
 
P-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 finalP-glycoprotein pamphlet: iteration 4 of 4 final
P-glycoprotein pamphlet: iteration 4 of 4 final
bs22n2s
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
How to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 WebsiteHow to Subscribe Newsletter From Odoo 18 Website
How to Subscribe Newsletter From Odoo 18 Website
Celine George
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
GDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptxGDGLSPGCOER - Git and GitHub Workshop.pptx
GDGLSPGCOER - Git and GitHub Workshop.pptx
azeenhodekar
 
The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...The ever evoilving world of science /7th class science curiosity /samyans aca...
The ever evoilving world of science /7th class science curiosity /samyans aca...
Sandeep Swamy
 
LDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini UpdatesLDMMIA Reiki Master Spring 2025 Mini Updates
LDMMIA Reiki Master Spring 2025 Mini Updates
LDM Mia eStudios
 
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - WorksheetCBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
CBSE - Grade 8 - Science - Chemistry - Metals and Non Metals - Worksheet
Sritoma Majumder
 
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulsepulse  ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
pulse ppt.pptx Types of pulse , characteristics of pulse , Alteration of pulse
sushreesangita003
 
Sinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_NameSinhala_Male_Names.pdf Sinhala_Male_Name
Sinhala_Male_Names.pdf Sinhala_Male_Name
keshanf79
 
apa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdfapa-style-referencing-visual-guide-2025.pdf
apa-style-referencing-visual-guide-2025.pdf
Ishika Ghosh
 
To study the nervous system of insect.pptx
To study the nervous system of insect.pptxTo study the nervous system of insect.pptx
To study the nervous system of insect.pptx
Arshad Shaikh
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
Ad

Latex with git

  • 1. LaTeX with Git Demo in Debian By sppmg
  • 2. Basic of git(incomplete) git init git add *.tex git commit -m "msg" edit your tex file. edit your tex file. git add -u git commit -m "msg" add all tracked file. new file will not add . git commit -a -m "msg" git push origin push(sync.) to remote
  • 3. Compare two versions of tex use latexdiff $ latexdiff draft.tex revision.tex > diff.tex $ latex diff.tex https://www.inf.unibz.it/dis/wiki/doku.php?id=latex:diff
  • 4. Combine git and latexdiff $ git log --oneline --all --decorate --graph --color $ git latexdiff --latexmk --latexopt "-xelatex" --main main.tex master dev $ git latexdiff --latexmk --latexopt "-xelatex" --main main.tex 981a665 dev Version history (GUI & CLI) Compare last in 2 branch (master & dev) Compare 2 commit (981a665 & last) LaTeX compiler use xelatex
  • 5. Tool list 1.git → VCS(Version Control System) 2.xelatex → LaTeX compiler, Chinese(if use unicode) need. 3.latexdiff → Compare two versions of tex. 4.latexpand → Expand input{} or include{} in tex. 5.git-latexdiff →It is a wrapper around git and latexdiff. 6.latexmk →It is a perl script for running LaTeX the correct number of times to resolve cross references. And use it bridge git-latexdiff and xelatex. You should have it already. Or choose what you like.
  • 6. Install tools in debian # apt-get install latexdiff latexmk $ git clone https://gitlab.com/git-latexdiff/git-latexdiff.git $ cd git-latexdiff/ $ sudo make install-bin git-latexdiff latexdiff & latexmk latexpand debian 8(jessie) texlive(2014.20141024-1) + # apt-get install texlive-extra-utils debian 7(wheezy) texlive(2012) Download from ctan, put under $PATH (eg. ~/bin) git and xelatex use apt, I don't write here.
  • 8. Note, list difference in big project In big project has many tex file, maybe you only want to know which file changed. So you can use below command: $ git diff master dev --name-only main.bib main.tex $ git diff master dev --name-status A main.bib M main.tex