Skip to content

Commit

Permalink
👷 Add latexindent
Browse files Browse the repository at this point in the history
  • Loading branch information
Freed-Wu committed Mar 11, 2023
1 parent ff39136 commit dda108f
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 51 deletions.
16 changes: 10 additions & 6 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ repos:
- id: check-toml
- id: check-json
- repo: https://github.com/Lucas-C/pre-commit-hooks
rev: v1.3.1
rev: v1.4.2
hooks:
- id: remove-crlf
- repo: https://github.com/codespell-project/codespell
Expand All @@ -32,21 +32,21 @@ repos:
additional_dependencies:
- tomli
- repo: https://github.com/jorisroovers/gitlint
rev: v0.18.0
rev: v0.19.0dev
hooks:
- id: gitlint
args:
- --msg-filename
- repo: https://github.com/editorconfig-checker/editorconfig-checker.python
rev: 2.6.2
rev: 2.7.1
hooks:
- id: editorconfig-checker
- repo: https://github.com/jumanjihouse/pre-commit-hooks
rev: 3.0.0
hooks:
- id: check-mailmap
- repo: https://github.com/adrienverge/yamllint
rev: v1.28.0
rev: v1.29.0
hooks:
- id: yamllint
- repo: https://github.com/executablebooks/mdformat
Expand All @@ -69,8 +69,12 @@ repos:
- id: markdownlint-cli2
additional_dependencies:
- markdown-it-texmath@0.9.1
- repo: https://github.com/Freed-Wu/pre-commit-make
rev: 0.0.1
- repo: https://github.com/cmhughes/latexindent.pl
rev: V3.20.3
hooks:
- id: latexindent
- repo: https://github.com/Freed-Wu/pre-commit-hooks
rev: 0.0.10
hooks:
- id: make

Expand Down
13 changes: 13 additions & 0 deletions latexindent.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env -S latexindent -l
---
defaultIndent: " "
indentPreamble: 1
onlyOneBackUp: 1
fileExtensionPreference:
.dtx: 1
.ins: 2
.tex: 3
.sty: 4
.cls: 5
.tikz: 6
.bib: 7
58 changes: 29 additions & 29 deletions main.tex
Original file line number Diff line number Diff line change
Expand Up @@ -31,55 +31,55 @@

\begin{longtable}{|p{2.2in}|p{4.64in}|}
\firsthline
\Item{Name:} & \Authorname\\
\Item{Name:} & \Authorname \\
\hline
\Item{Project Name:} & \\
\Item{Project Name:} & \\
\hline
\Item{Reporting Period:} & Week\\
\Item{Reporting Period:} & Week \\
\hline
\multicolumn{2}{|p{\linewidth}|}{\Item{Summary}}\\
\multicolumn{2}{|p{\linewidth}|}{\Item{Summary}} \\
\hline
\multicolumn{2}{|p{\linewidth}|}{%
Please provide a short overview (1--2 sentences) of the on-going project,
including research purpose, tasks mentioned in the past week,
progress/outputs in this week.
}\\
Please provide a short overview (1--2 sentences) of the on-going project,
including research purpose, tasks mentioned in the past week,
progress/outputs in this week.
} \\
\hline
\multicolumn{2}{|p{\linewidth}|}{\Item{Tasks and Progress}}\\
\multicolumn{2}{|p{\linewidth}|}{\Item{Tasks and Progress}} \\
\hline
\multicolumn{2}{|p{\linewidth}|}{%
Report on tasks outlined in the weekly meeting and describe any changes
to this, including the reasons for these. Do include any additional
activities undertaken that are not in the work plan, providing the
background to their inclusion.
}\\
Report on tasks outlined in the weekly meeting and describe any changes
to this, including the reasons for these. Do include any additional
activities undertaken that are not in the work plan, providing the
background to their inclusion.
} \\
\hline
\multicolumn{2}{|p{\linewidth}|}{\Item{Outputs and Deliverables}}\\
\multicolumn{2}{|p{\linewidth}|}{\Item{Outputs and Deliverables}} \\
\hline
\multicolumn{2}{|p{\linewidth}|}{%
Describe any preliminary results, outputs or deliverables (e.g.
presentations, studies, papers)? If no preliminary results are available,
state why.
}\\
Describe any preliminary results, outputs or deliverables (e.g.
presentations, studies, papers)? If no preliminary results are available,
state why.
} \\
\hline
\multicolumn{2}{|p{\linewidth}|}{\Item{Risk, Issues and Challenges}}\\
\multicolumn{2}{|p{\linewidth}|}{\Item{Risk, Issues and Challenges}} \\
\hline
\multicolumn{2}{|p{\linewidth}|}{%
Report on any issues or problems that have impacted on the development
and implementation of the project.
}\\
Report on any issues or problems that have impacted on the development
and implementation of the project.
} \\
\hline
\multicolumn{2}{|p{\linewidth}|}{\Item{Collaboration}}\\
\multicolumn{2}{|p{\linewidth}|}{\Item{Collaboration}} \\
\hline
\multicolumn{2}{|p{\linewidth}|}{%
Is there any collaboration you have with any parties to run the project
tasks? If any; please list them and what type of collaborations you have
}\\
Is there any collaboration you have with any parties to run the project
tasks? If any; please list them and what type of collaborations you have
} \\
\hline
\multicolumn{2}{|p{\linewidth}|}{\Item{Next Steps}}\\
\multicolumn{2}{|p{\linewidth}|}{\Item{Next Steps}} \\
\hline
\multicolumn{2}{|p{\linewidth}|}{%
}\\
} \\
\lasthline
\end{longtable}

Expand Down
2 changes: 1 addition & 1 deletion scripts/generate-template.tex.pl
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/usr/bin/env -S perl -0777 -p
s/(?<=\\multicolumn\{2\}\{\|p\{\\linewidth\}\|\}\{%\n)(.|\n)*?(?= \}\\\\)//g
s/(?<=\\multicolumn\{2\}\{\|p\{\\linewidth\}\|\}\{%\n)(.|\n)*?(?= \}\s*\\\\)//g
30 changes: 15 additions & 15 deletions template.tex
Original file line number Diff line number Diff line change
Expand Up @@ -31,41 +31,41 @@

\begin{longtable}{|p{2.2in}|p{4.64in}|}
\firsthline
\Item{Name:} & \Authorname\\
\Item{Name:} & \Authorname \\
\hline
\Item{Project Name:} & \\
\Item{Project Name:} & \\
\hline
\Item{Reporting Period:} & Week\\
\Item{Reporting Period:} & Week \\
\hline
\multicolumn{2}{|p{\linewidth}|}{\Item{Summary}}\\
\multicolumn{2}{|p{\linewidth}|}{\Item{Summary}} \\
\hline
\multicolumn{2}{|p{\linewidth}|}{%
}\\
} \\
\hline
\multicolumn{2}{|p{\linewidth}|}{\Item{Tasks and Progress}}\\
\multicolumn{2}{|p{\linewidth}|}{\Item{Tasks and Progress}} \\
\hline
\multicolumn{2}{|p{\linewidth}|}{%
}\\
} \\
\hline
\multicolumn{2}{|p{\linewidth}|}{\Item{Outputs and Deliverables}}\\
\multicolumn{2}{|p{\linewidth}|}{\Item{Outputs and Deliverables}} \\
\hline
\multicolumn{2}{|p{\linewidth}|}{%
}\\
} \\
\hline
\multicolumn{2}{|p{\linewidth}|}{\Item{Risk, Issues and Challenges}}\\
\multicolumn{2}{|p{\linewidth}|}{\Item{Risk, Issues and Challenges}} \\
\hline
\multicolumn{2}{|p{\linewidth}|}{%
}\\
} \\
\hline
\multicolumn{2}{|p{\linewidth}|}{\Item{Collaboration}}\\
\multicolumn{2}{|p{\linewidth}|}{\Item{Collaboration}} \\
\hline
\multicolumn{2}{|p{\linewidth}|}{%
}\\
} \\
\hline
\multicolumn{2}{|p{\linewidth}|}{\Item{Next Steps}}\\
\multicolumn{2}{|p{\linewidth}|}{\Item{Next Steps}} \\
\hline
\multicolumn{2}{|p{\linewidth}|}{%
}\\
} \\
\lasthline
\end{longtable}

Expand Down

0 comments on commit dda108f

Please sign in to comment.