Skip to content

Commit

Permalink
Cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
arbipher committed Jan 26, 2022
1 parent 901aed6 commit 41711a1
Show file tree
Hide file tree
Showing 10 changed files with 1,741 additions and 1,738 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ __latexindent_temp.tex
.texpadtmp/

reference

project-*
59 changes: 36 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,34 +1,47 @@
ARGS = \
# basic

BUILD = build

all:
mkdir -p $(BUILD)

clean :
rm -f $(BUILD)/*

# pandoc args

OPT-CITEPROC = \
--csl=acm-sig-proceedings.csl --citeproc \

OPT-PDF = \
--listings \
--template=template.tex \
--csl=acm-sig-proceedings.csl --citeproc \
--metadata-file default.yaml \
--pdf-engine=lualatex

# -V 'mainfont:DejaVuSerif' \
# -V 'sansfont:DejaVuSans' \
# -V 'monofont:DejaVuSansMono' \
# -V 'mathfont:TeXGyreDejaVuMath-Regular'

ARGS-INC = \
--filter pandoc-include \
$(ARGS)

ARGS-HTML = \
ARGS-BASIC = \
--filter pandoc-include \
--listings \
--metadata-file default.yaml

main-full : main-full.md
pandoc $< -o build/$@.pdf $(ARGS)
ARGS-HTML = \
$(OPT-CITEPROC) \
$(ARGS-BASIC)

# `--filter` should be ahead of `--citeproc`
main-outline : main-outline.md
pandoc $< -o build/$@.pdf $(ARGS-INC)
ARGS-PDF = \
$(ARGS-BASIC) \
$(OPT-CITEPROC) \
$(OPT-PDF)

debug : main.md
pandoc $< -o build/$@.tex $(ARGS-INC)
pandoc $< -o build/$@.html $(ARGS-HTML)
pandoc $< -o build/$@.pdf $(ARGS-INC)
# projects

clean :
rm -f build/*
demo : demo/main.md
pandoc $< -o $(BUILD)/$@.pdf $(ARGS-PDF) --resource-path=demo

# Not used
#
# -f markdown+implicit_header_references \
# -V 'mainfont:DejaVuSerif' \
# -V 'sansfont:DejaVuSans' \
# -V 'monofont:DejaVuSansMono' \
# -V 'mathfont:TeXGyreDejaVuMath-Regular'
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,15 @@ CONTENT

Or you can also config the listings as `\lstset{xleftmargin=.2\textwidth, xrightmargin=.2\textwidth}` which also centers the listing. See https://stackoverflow.com/questions/3106419/center-latex-lstlisting

https://github.com/jgm/pandoc/issues/719

## section link and number

It's sutble to have result like `section 2` in both pdf and html. The result is `2` in pdf is usually computed by `\ref{LABEL-FOR-THE-SECOND-SECTION}` while html cannot compute it. I don't find a nice way to solve it. The pandoc extension for html has a problem: I don't want it in the pdf result. The current solution is I have to repeat it somehow like
```
Section `\ref{LABEL-FOR-THE-SECOND-SECTION}`{=latex}[`2`{=html}](#LABEL-FOR-THE-SECOND-SECTION)`
```

# Reference

https://ulriklyngs.com/post/2018/07/18/how-to-write-acm-articles-with-r-markdown/
Expand Down
14 changes: 14 additions & 0 deletions TODO.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# To-do

- [ ] Try to use `algorithem2e`.
- [ ] Read https://www.flutterbys.com.au/stats/tut/tut17.3.html
- [ ] Test Definition list (See https://www.flutterbys.com.au/stats/tut/tut17.3.html)
- [ ] Support custom languages in `listings` (See https://github.com/jgm/pandoc/issues/4116)
- [ ] Testing embed latex with [--mathjax](https://pandoc.org/MANUAL.html#option--mathjax).
- [ ] Inline code `example` in the caption of code block (See https://github.com/jgm/pandoc/issues/4846#issuecomment-414493096).
- [ ] Section id referencing and generation `\ref`.
- [ ] Bugfix: `lstinline` doesn't break at page boundary.
- [ ] Bugfix: Unicode-to-latex cannot apply on inline code with only a leading unicode symbol, e.g. `` will result in `l.459 \passthrough{\lstinline!∪1!}`
- [ ] Bugfix: using `-f gfm`, email in the template `\email{$author.email$}` will render as `\email{\href{mailto:weng@cs.jhu.edu}{\nolinkurl{weng@cs.jhu.edu}}}` (the correct result is `\email{weng@cs.jhu.edu}`).
- [ ] explain more about `template.tex`
- [ ] read author details from a separate file, instead of hardcode it (however, change the template is easier)
2 changes: 1 addition & 1 deletion main-outline.md → demo/main.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ bibliography: references.bib
---

<!-- # Introduction -->
!include main-section-intro.md
!include demo/section-intro.md

# MMSN Protocol

Expand Down
Loading

0 comments on commit 41711a1

Please sign in to comment.