f-klubben / sangbog

6 stars 6 forks source link

Problem building PDF (continuous) with debian #45

Open JakobTopholt opened 1 month ago

JakobTopholt commented 1 month ago

Currently I (On a completely "clean" Debian Virtual Machine) cannot build pdf.

It seems that the process gets stuck on line 17 of Makefile given the message after cancelling the build (giving it plenty of time to complete) "^Cmake: *** [Makefile:17: pdf] Interrupt"

It reaches all the way to the last song "lilleprinsesse" but not outputting the PDF.

Booklet builds without issues.

Naitsabot commented 1 month ago

(har btw ikke set om det er fuldstændig optimal, eller om der er nogle fejl) Det her virker for mig: Plus, en lille cleanup metode make clean

sudo apt-get install dvipdfmx

makefile:

FILE=main.tex
OUTPUT_DIR=output

all: pdf

dvi:
    @echo "Compiling .tex to .dvi"
    mkdir -p $(OUTPUT_DIR)
    latex -output-directory=$(OUTPUT_DIR) $(FILE)
    makeindex $(OUTPUT_DIR)/main
    latex -output-directory=$(OUTPUT_DIR) $(FILE)

ps: dvi
    @echo "Converting .dvi to .ps"
    dvips $(OUTPUT_DIR)/main.dvi -o $(OUTPUT_DIR)/main.ps

#pdf:
#   @echo "Compiling .tex to .pdf with A5 paper size"
#   mkdir -p $(OUTPUT_DIR)
#   pdflatex -output-directory=$(OUTPUT_DIR) -interaction=nonstopmode "\def\papersize{a5paper} \input{$(FILE)}"
#   makeindex $(OUTPUT_DIR)/main
#   pdflatex -output-directory=$(OUTPUT_DIR) -interaction=nonstopmode "\def\papersize{a5paper} \input{$(FILE)}"
#   @echo "PDF should be generated in the $(OUTPUT_DIR) directory: $(OUTPUT_DIR)/main.pdf"

pdf: dvi
    @echo "Compiling .dvi to .pdf with A4 paper size"
    mkdir -p $(OUTPUT_DIR)
    dvipdfmx -p a4 -o $(OUTPUT_DIR)/main.pdf $(OUTPUT_DIR)/main.dvi
    @echo "PDF should be generated in the $(OUTPUT_DIR) directory: $(OUTPUT_DIR)/main.pdf"

booklet: ps
    @echo "Creating booklet"
    ./ps2book.sh $(OUTPUT_DIR)/main.ps
    ps2pdf $(OUTPUT_DIR)/main_book.ps $(OUTPUT_DIR)/main_book.pdf
    rm $(OUTPUT_DIR)/main.ps $(OUTPUT_DIR)/main_book.ps $(OUTPUT_DIR)/main.dvi

clean:
    rm -rf $(OUTPUT_DIR) *.aux *.log *.idx *.ilg *.ind *.toc *.out *.dvi *.ps *.pdf
JakobTopholt commented 1 month ago

Den tester jeg nok lige lidt senere, nice med clean feature.