From bf31a793015dd9ddb95a99c40634c4041d43553e Mon Sep 17 00:00:00 2001 From: Wu Zhenyu Date: Thu, 3 Feb 2022 23:09:16 +0800 Subject: [PATCH] :memo: Update README.md Use autofancyhdr to replace fancyhdr --- .gitignore | 2 ++ .pre-commit-config.yaml | 54 +++++++++++++++++++++++++++++++++++++++++ README.md | 39 +++++++++++++++++++++++++++++ main.tex | 34 ++++++++++++++------------ 4 files changed, 113 insertions(+), 16 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.gitignore b/.gitignore index b466858..19384f5 100644 --- a/.gitignore +++ b/.gitignore @@ -288,3 +288,5 @@ TSWLatexianTemp* # Uncomment the next line to have this generated file ignored. #*Notes.bib +# autofancyhdr +*.headfootlength diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..360c44f --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,54 @@ +--- +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.1.0 + hooks: + - id: check-added-large-files + - id: fix-byte-order-marker + - id: check-case-conflict + - id: check-shebang-scripts-are-executable + - id: check-merge-conflict + - id: trailing-whitespace + - id: mixed-line-ending + - id: end-of-file-fixer + - id: detect-private-key + - id: check-symlinks + - id: check-ast + - id: debug-statements + - id: requirements-txt-fixer + - id: check-xml + - id: check-yaml + - id: check-toml + - id: check-json + - repo: https://github.com/Lucas-C/pre-commit-hooks + rev: v1.1.11 + hooks: + - id: remove-crlf + - repo: https://github.com/codespell-project/codespell + rev: v2.1.0 + hooks: + - id: codespell + - repo: https://github.com/jorisroovers/gitlint + rev: v0.17.0 + hooks: + - id: gitlint + args: [--ignore=body-is-missing, --msg-filename] + - repo: https://github.com/executablebooks/mdformat + rev: 0.7.13 + hooks: + - id: mdformat + args: [--number] + additional_dependencies: + - mdformat-gfm + - mdformat-tables + - mdformat-toc + - mdformat-frontmatter + - mdformat-deflist + - mdformat-black + - mdformat-shfmt + - repo: https://github.com/DavidAnson/markdownlint-cli2 + rev: v0.4.0 + hooks: + - id: markdownlint-cli2 + additional_dependencies: + - markdown-it-texmath@0.9.1 diff --git a/README.md b/README.md index 4252c09..68840d1 100644 --- a/README.md +++ b/README.md @@ -1 +1,40 @@ # Weekly Report Template + +[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit) +[![Gitmoji](https://img.shields.io/badge/gitmoji-%20%F0%9F%98%9C%20%F0%9F%98%8D-FFDD67.svg?style=flat-square)](https://gitmoji.dev) + +A weekly report template for ViLaB. + +## Settings + +``` tex +\geometry{% + noheadfoot, + margin={0.79in, 0.49in}, + headheight=0.26in, + headsep=0.04in, +} +``` + +![page](https://user-images.githubusercontent.com/32936898/152362381-c72c06a2-b257-4cf2-94e0-a7373a662147.png) + +## Others + +Some changes on the [original template](https://github.com/Freed-Wu/weekly-report-template/releases/tag/v0.0.1): + +- Fix typos. +- Remove the blank lines in header and contents. + +### Add PDF Meta Information + +``` tex +\usepackage[pdfusetitle, psdextra]{hyperref} +\title{main} +\author{wzy\thanks{USTC}} +``` + +``` shell +$ pdfinfo main.pdf|rg Title\|Author +Title: main +Author: wzy +``` diff --git a/main.tex b/main.tex index fc78a3c..63d00f2 100644 --- a/main.tex +++ b/main.tex @@ -1,27 +1,28 @@ -\documentclass{article} +\documentclass[a4paper]{article} +\usepackage{xcolor} +\usepackage{parskip} \usepackage{geometry} -\usepackage{color} -\geometry{ - left=0.79in, - right=0.79in, - voffset=-0.25in, - headheight=18pt, - headsep=21pt, - bottom=0.49in, +\geometry{% + noheadfoot, + margin={0.79in, 0.49in}, + headheight=0.26in, + headsep=0.04in, } -\usepackage{fancyhdr} +\usepackage{autofancyhdr} \pagestyle{fancy} \renewcommand{\headrulewidth}{0mm} -\renewcommand{\footrulewidth}{0mm} -\lhead{\textbf{\Large Weekly Report}} -\rhead{\textbf{\textcolor{blue}{\huge ViLaB}}} -\cfoot{} +\fancyhead[l]{\textbf{\Large Weekly Report}} +\fancyhead[r]{\textbf{\textcolor{blue}{\huge ViLaB}}} +\fancyfoot{} +\fancyfoot[r]{Page \thepage} \usepackage{tabu} -\newcommand{\Name}[1]{\textbf{\large #1}} \renewcommand\arraystretch{2} +\usepackage[pdfusetitle, psdextra]{hyperref} +\title{main} +\author{wzy\thanks{USTC}} +\newcommand{\Name}[1]{\textbf{\large #1}} \begin{document} -\noindent \begin{tabu}{|X[2.2]|X[4.64]|} \hline \Name{Name:} & \\ @@ -80,4 +81,5 @@ }\\ \hline \end{tabu} + \end{document}