SlideShare a Scribd company logo
1 of 9
Download to read offline
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

More Related Content

What's hot

Command cheatsheets mac
Command cheatsheets macCommand cheatsheets mac
Command cheatsheets macPaal 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 CheatsheetJoy Seng
 
Mastering git - Workflow
Mastering git - WorkflowMastering git - Workflow
Mastering git - WorkflowTahsin 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 2019Christie 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 UnityRifauddin 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 GitDmitry Sheiko
 
Take the next step with git
Take the next step with gitTake the next step with git
Take the next step with gitKarin Taliga
 
Understanding about git
Understanding about gitUnderstanding about git
Understanding about gitSothearin Ren
 
Mac Linux Commands cheatsheet
Mac Linux Commands cheatsheetMac Linux Commands cheatsheet
Mac Linux Commands cheatsheetJoy Seng
 
Essential Git and Github commands
Essential Git and Github commandsEssential Git and Github commands
Essential Git and Github commandsIsham 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 101615Brian K. Vagnini
 

What's hot (19)

Command cheatsheets mac
Command cheatsheets macCommand cheatsheets mac
Command cheatsheets mac
 
Git cheat-sheet
Git cheat-sheetGit cheat-sheet
Git cheat-sheet
 
Git
GitGit
Git
 
GNU Make, Autotools, CMake 簡介
GNU Make, Autotools, CMake 簡介GNU Make, Autotools, CMake 簡介
GNU Make, Autotools, CMake 簡介
 
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
 
Windows Cheatsheet
Windows CheatsheetWindows Cheatsheet
Windows Cheatsheet
 
Hg version control bioinformaticians
Hg version control bioinformaticiansHg version control bioinformaticians
Hg version control bioinformaticians
 
Mastering git - Workflow
Mastering git - WorkflowMastering git - Workflow
Mastering git - Workflow
 
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
 
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
 
Hg for bioinformatics, second part
Hg for bioinformatics, second partHg for bioinformatics, second part
Hg for bioinformatics, second part
 
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
 
Take the next step with git
Take the next step with gitTake the next step with git
Take the next step with git
 
Understanding about git
Understanding about gitUnderstanding about git
Understanding about git
 
Git 101
Git 101Git 101
Git 101
 
Introduction to Tekton
Introduction to TektonIntroduction to Tekton
Introduction to Tekton
 
Mac Linux Commands cheatsheet
Mac Linux Commands cheatsheetMac Linux Commands cheatsheet
Mac Linux Commands cheatsheet
 
Essential Git and Github commands
Essential Git and Github commandsEssential Git and Github commands
Essential Git and Github commands
 
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
 

Similar to Latex with git

Similar to Latex with git (20)

Git real slides
Git real slidesGit real slides
Git real slides
 
Git_real_slides
Git_real_slidesGit_real_slides
Git_real_slides
 
Git Concepts, Commands and Connectivity
Git Concepts, Commands and ConnectivityGit Concepts, Commands and Connectivity
Git Concepts, Commands and Connectivity
 
Git it on (includes git hub)
Git it on (includes git hub)Git it on (includes git hub)
Git it on (includes git hub)
 
Exprimiendo GIT
Exprimiendo GITExprimiendo GIT
Exprimiendo GIT
 
Git basic
Git basicGit basic
Git basic
 
Presentation of sexy.rgtk
Presentation of sexy.rgtkPresentation of sexy.rgtk
Presentation of sexy.rgtk
 
Git and github 101
Git and github 101Git and github 101
Git and github 101
 
DrupalCafe5 VCS
DrupalCafe5 VCSDrupalCafe5 VCS
DrupalCafe5 VCS
 
Git cheat-sheet 2021
Git cheat-sheet 2021Git cheat-sheet 2021
Git cheat-sheet 2021
 
GIT Basics
GIT BasicsGIT Basics
GIT Basics
 
Git Memento of basic commands
Git Memento of basic commandsGit Memento of basic commands
Git Memento of basic commands
 
Git introduction
Git introductionGit introduction
Git introduction
 
Git
GitGit
Git
 
Git and github
Git and githubGit and github
Git and github
 
Git and Github
Git and GithubGit and Github
Git and Github
 
HackMTY - GitHub Workshop
HackMTY - GitHub WorkshopHackMTY - GitHub Workshop
HackMTY - GitHub Workshop
 
Atlassian git cheatsheet
Atlassian git cheatsheetAtlassian git cheatsheet
Atlassian git cheatsheet
 
Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?Git Commands Every Developer Should Know?
Git Commands Every Developer Should Know?
 
The journey to GitOps
The journey to GitOpsThe journey to GitOps
The journey to GitOps
 

Recently uploaded

Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxnegromaestrong
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.MateoGardella
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterMateoGardella
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfSanaAli374401
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingTeacherCyreneCayanan
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 

Recently uploaded (20)

Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.Gardella_Mateo_IntellectualProperty.pdf.
Gardella_Mateo_IntellectualProperty.pdf.
 
Gardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch LetterGardella_PRCampaignConclusion Pitch Letter
Gardella_PRCampaignConclusion Pitch Letter
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
An Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdfAn Overview of Mutual Funds Bcom Project.pdf
An Overview of Mutual Funds Bcom Project.pdf
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
fourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writingfourth grading exam for kindergarten in writing
fourth grading exam for kindergarten in writing
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 

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