-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace everything to use markdown as input to generate pdf
Signed-off-by: Luiz Oliveira <[email protected]>
- Loading branch information
Showing
27 changed files
with
2,663 additions
and
1,345 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
name: LaTeX Build | ||
|
||
on: | ||
push: | ||
paths: | ||
- "*.tex" | ||
- "*.ttf" | ||
- ".github/workflows/*" | ||
- "*.md" | ||
- "**/*.md" | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
container: thomasweise/docker-texlive-full | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v2 | ||
|
||
- name: Install TexLive and other dependencies | ||
run: | | ||
apt-get update -qq | ||
# apt-get install -y texlive-full | ||
apt-get install -y latexmk pandoc | ||
- name: Copy fonts and update font cache | ||
run: | | ||
cp -v *.ttf /usr/local/share/fonts | ||
fc-cache -fv | ||
- name: Build LaTeX files | ||
run: | | ||
make convert | ||
make | ||
- id: commit | ||
uses: prompt/actions-commit-hash@v3 | ||
- name: Upload PDF artifacts | ||
uses: actions/upload-artifact@v2 | ||
with: | ||
name: pdf-files | ||
path: | | ||
- name: Release | ||
uses: softprops/action-gh-release@v2 # in the future, try ncipollo/release-action@v1 | ||
if: startsWith(github.ref, 'refs/tags/') | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
tag_name: ${{ steps.commit.outputs.short }} | ||
name: Release ${{ steps.commit.outputs.short }} | ||
draft: false | ||
prerelease: false | ||
files: | | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
|
||
BIBTEX = bibtex | ||
# LATEX = pdflatex | ||
LATEX = xelatex | ||
DVIPS = dvips | ||
PS2PDF = ps2pdf | ||
TEMPLATE = ieee | ||
|
||
VERSION = 0.1.0 | ||
|
||
SOURCES = $(wildcard ./*.*) | ||
|
||
NPROCS := 1 | ||
OS := $(shell uname) | ||
export NPROCS | ||
|
||
ifeq ($J,) | ||
|
||
ifeq ($(OS),Linux) | ||
NPROCS := $(shell grep -c ^processor /proc/cpuinfo) | ||
else ifeq ($(OS),Darwin) | ||
# NPROCS := $(shell system_profiler | awk '/Number of CPUs/ {print $$4}{next;}') | ||
NPROCS := 1 | ||
endif # $(OS) | ||
|
||
else | ||
NPROCS := $J | ||
endif # $J | ||
|
||
.PHONY: all clean dist-clean | ||
|
||
TEX_FILES := $(shell find . -type f -name "*.tex") | ||
MD_FILES := $(shell find . -type f -name "*.md" | grep -v "README.md") | ||
|
||
all: convert | ||
@echo "Using" $(NPROCS) "jobs" | ||
@for file in $(TEX_FILES); do \ | ||
echo "Processing $$file"; \ | ||
latexmk -xelatex $$file; \ | ||
done | ||
@for file in $(shell find . -type f -name "*.pdf"); do \ | ||
echo "----- $$file"; \ | ||
pdfinfo $$file; \ | ||
done | ||
|
||
convert: | ||
@echo files: $(MD_FILES) | ||
@for file in $(MD_FILES); do \ | ||
echo "Converting $$file" using $(TEMPLATE); \ | ||
output=$${file%.md}.tex; \ | ||
pandoc --read=markdown --write=latex --output=testdoc.tex --template=$(TEMPLATE).latex $$file -o $$output --listings --biblatex --csl abnt.csl ; \ | ||
done | ||
|
||
$(TARGET): $(MAIN_FILE) $(SOURCES) | ||
$(MAKE) clean | ||
$(LATEX) $(MAIN_FILE) | ||
$(LATEX) -interaction=batchmode $(MAIN_FILE) | ||
@mv $(PDF_FILE) $(TARGET) | ||
|
||
clean: | ||
rm -rf *~ *.dvi *.ps *.backup *.aux *.log *.out *.xdv *.fls *.fdb_latexmk | ||
rm -f *.lof *.lot *.bbl *.blg *.brf *.toc *.idx *.lol *.bcf *.xml | ||
|
||
install: | ||
apt update -qq | ||
apt install -y pandoc pandoc-citeproc latexmk | ||
cp -v *.ttf /usr/local/share/fonts | ||
fc-cache -fv |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.