mszep / pandoc_resume

The Markdown Resume
http://mszep.github.io/pandoc_resume/
MIT License
1.62k stars 756 forks source link

"make pdf" fails with "make: *** [Makefile:9: pdf] Error 1" in Fedora 34 #78

Open yuokada126 opened 3 years ago

yuokada126 commented 3 years ago

Expected Behavior

Actual Behavior

for f in markdown/*.md; do \ FILE_NAME=basename $f | sed 's/.md//g'; \ echo $FILE_NAME.pdf; \ pandoc --standalone --template styles/chmduquesne.tex \ --from markdown --to context \ --variable papersize=A4 \ --output output/$FILE_NAME.tex $f > /dev/null; \ mtxrun --path=output --result=$FILE_NAME.pdf --script context $FILENAME.tex > output/context$FILE_NAME.log 2>&1; \ done resume.pdf make: *** [Makefile:9: pdf] Error 1

- The log shows 'context.lua' or 'mtx-context.lua' cannot be found.

$ cat output/context_resume.log mtxrun | unknown script 'context.lua' or 'mtx-context.lua'```

- Runing `mtxrun --generate` command guided in README.md didn't resolve the issue.
- Other commands such as `make html`, `make docx` and `make rtf` works as expected. (Generates output files without error)

### Steps to reproduce the behavior
1. Install Fedora 34 Workstation
2. git clone https://github.com/mszep/pandoc_resume
3. cd pandoc_resume
4. sudo dnf install pandoc texlive-collection-context
5. make pdf

### Versions

$ context --version mtx-context | ConTeXt Process Management 1.03 mtx-context | mtx-context | main context file: /usr/share/texlive/texmf-dist/tex/context/base/mkiv/context.mkiv mtx-context | current version: 2020.03.10 14:44 mtx-context | main context file: /usr/share/texlive/texmf-dist/tex/context/base/mkiv/context.mkxl mtx-context | current version: 2020.03.10 14:44

$ pandoc --version pandoc 2.9.2.1 Compiled with pandoc-types 1.20, texmath 0.12.0.2, skylighting 0.8.5 Default user data directory: /home/yuokada/.local/share/pandoc or /home/yuokada/.pandoc Copyright (C) 2006-2020 John MacFarlane Web: https://pandoc.org This is free software; see the source for copying conditions. There is no warranty, not even for merchantability or fitness for a particular purpose.

$ rpm -qa | grep -e pandoc -e texlive-collection-context pandoc-common-2.9.2.1-9.fc34.noarch texlive-collection-context-svn54074-38.fc34.noarch pandoc-2.9.2.1-9.fc34.x86_64

$ cat /etc/os-release NAME=Fedora VERSION="34 (Workstation Edition)" ID=fedora VERSION_ID=34 VERSION_CODENAME="" PLATFORM_ID="platform:f34" PRETTY_NAME="Fedora 34 (Workstation Edition)" ANSI_COLOR="0;38;2;60;110;180" LOGO=fedora-logo-icon CPE_NAME="cpe:/o:fedoraproject:fedora:34" HOME_URL="https://fedoraproject.org/" DOCUMENTATION_URL="https://docs.fedoraproject.org/en-US/fedora/34/system-administrators-guide/" SUPPORT_URL="https://fedoraproject.org/wiki/Communicating_and_getting_help" BUG_REPORT_URL="https://bugzilla.redhat.com/" REDHAT_BUGZILLA_PRODUCT="Fedora" REDHAT_BUGZILLA_PRODUCT_VERSION=34 REDHAT_SUPPORT_PRODUCT="Fedora" REDHAT_SUPPORT_PRODUCT_VERSION=34 PRIVACY_POLICY_URL="https://fedoraproject.org/wiki/Legal:PrivacyPolicy" VARIANT="Workstation Edition" VARIANT_ID=workstation

yuokada126 commented 3 years ago

context.lua file exists in the following path and is contained in texlive-context package.

$ ls -l /usr/share/texlive/texmf-dist/scripts/context/lua/context.lua 
-rw-r--r--. 1 root root 1274 Feb  3 03:35 /usr/share/texlive/texmf-dist/scripts/context/lua/context.lua

$ rpm -qf /usr/share/texlive/texmf-dist/scripts/context/lua/context.lua
texlive-context-20200327-28.fc34.noarch
mszep commented 3 years ago

I'm really sorry, but I don't know what's going wrong here; I haven't seen this error before. One thing that potentially might work is replacing mtxrun with context?

Other than that I'm afraid I don't understand why mtxrun can't find the context.lua. Could it maybe be two installations interfering with each other?

yuokada126 commented 3 years ago

Thanks for the reply! Unfortunately, replacing mtxrun with context in Makefile didn't work.

$ make pdf
mkdir -p output
PANDOC_VERSION=`pandoc --version | head -1 | cut -d' ' -f2 | cut -d'.' -f1`; \
if [ "$PANDOC_VERSION" -eq "2" ]; then \
    SMART=-smart; \
else \
    SMART=--smart; \
fi \

for f in markdown/*.md; do \
    FILE_NAME=`basename $f | sed 's/.md//g'`; \
    echo $FILE_NAME.pdf; \
    pandoc --standalone --template styles/chmduquesne.tex \
        --from markdown --to context \
        --variable papersize=A4 \
        --output output/$FILE_NAME.tex $f > /dev/null; \
#       mtxrun --path=output --result=$FILE_NAME.pdf --script context $FILE_NAME.tex > output/context_$FILE_NAME.log 2>&1; \
    context --path=output --result=$FILE_NAME.pdf --script context $FILE_NAME.tex > output/context_$FILE_NAME.log 2>&1; \
done
resume.pdf
make: *** [Makefile:9: pdf] Error 1

$ cat output/context_resume.log 
mtx-context     | warning: no format found, forcing remake (commandline driven)
resolvers       | resolving | configuration files already identified
resolvers       | resolving | loading configuration file '/usr/share/texlive/texmf-dist/web2c/texmfcnf.lua'
resolvers       | resolving |
resolvers       | resolving | locating list of '/usr/share/texlive/texmf-dist' (runtime) (tree:////usr/share/texlive/texmf-dist)
resolvers       | methods | resolving, method 'locators', how 'uri', handler 'tree', argument 'tree:////usr/share/texlive/texmf-dist'
resolvers       | trees | locator '/usr/share/texlive/texmf-dist' found
resolvers       | resolving | hash '/usr/share/texlive/texmf-dist' appended
resolvers       | resolving |
resolvers       | methods | resolving, method 'generators', how 'uri', handler 'file', argument '/usr/share/texlive/texmf-dist'
resolvers       | expansions | using cached scan of path '/usr/share/texlive/texmf-dist', branch '/usr/share/texlive/texmf-dist'
resolvers       | methods | resolving, method 'generators', how 'uri', handler 'file', argument '/usr/share/texlive/texmf-dist'
resolvers       | expansions | using cached scan of path '/usr/share/texlive/texmf-dist', branch '/usr/share/texlive/texmf-dist'
resolvers       | resolving |
resolvers       | resolving | not saving runtime tree '/usr/share/texlive/texmf-dist'
resolvers       | resolving | not saving runtime tree '/usr/share/texlive/texmf-dist'
resolvers       | resolving | using given filetype 'tex'
resolvers       | methods | resolving, method 'concatinators', how 'tag', tag 'default'
resolvers       | methods | resolving, method 'concatinators', how 'tag', tag 'default'
resolvers       | resolving | remembering file 'cont-en.mkiv' using hash 'tex::cont-en.mkiv'
resolvers       | formats | using tex source file '/usr/share/texlive/texmf-dist/tex/context/base/mkiv/cont-en.mkiv'
resolvers       | resolving | forcing filetype 'tex'
resolvers       | methods | resolving, method 'concatinators', how 'tag', tag 'default'
resolvers       | methods | resolving, method 'concatinators', how 'tag', tag 'default'
resolvers       | resolving | remembering file 'context.lus' using hash 'lus::context.lus'
resolvers       | formats | using specification file '/usr/share/texlive/texmf-dist/tex/context/base/mkiv/context.lus'
resolvers       | formats | using tex source path '/usr/share/texlive/texmf-dist/tex/context/base/mkiv'
resolvers       | formats | changing to format path '/home/yuokada/.cache/texlive/luatex-cache/context/c8ffba5311d077c16376bba44d5fa793/formats/luatex'
resolvers       | formats | executing runner 'make luatex format': /usr/bin/luatex --ini  --lua=/usr/share/texlive/texmf-dist/tex/context/base/mkiv/luat-cod.lua /usr/share/texlive/texmf-dist/tex/context/base/mkiv/cont-en.mkiv  \dump 
This is LuaTeX, Version 1.12.0 (TeX Live 2020)  (INITEX)
 system commands enabled.

:
:
:
[snip]
:
:
:

tex error       > tex error on line 8 in file /usr/share/texlive/texmf-dist/tex/context/base/mkiv/cont-yes.mkiv: ! I can't find file `./context'.

l.8 }

l.97 \getvalue{clf_processjob}
                             % from cont-run.lua

 1     %D \module
 2     %D   [       file=cont-yes,
 3     %D        version=2012.06.01,
 4     %D          title=\CONTEXT\ Miscellaneous Macros,
 5     %D       subtitle=Startup Stub,
 6     %D         author=Hans Hagen,
 7     %D           date=\currentdate,
 8 >>  %D      copyright={PRAGMA ADE \& \CONTEXT\ Development Team}]
 9     %C
10     %C This module is part of the \CONTEXT\ macro||package and is
11     %C therefore copyrighted by \PRAGMA. See mreadme.pdf for
12     %C details.
13     
14     % At some point I will reconsider the \starttext .. \stoptext
15     % wraping as we can assume proper styling. It's a left-over from
16     % mkii that we need to get rid of.
17     
18     % now moved to cont-run.lua

mtx-context     | fatal error: return code: 256

Could it maybe be two installations interfering with each other?

What do you mean by "two installations"?

I'll do some more research when I have time.

mszep commented 3 years ago

I meant perhaps you have installed texlive once from source and once with your package manager or something like that?

I admit, it's a long shot...

I think the only viable workaround is using the docker-compose workflow.

BryanQuigley commented 3 years ago

I reproduced this with my quite fresh install of Fedora 34 - have not manually installed anything. Will debug more later this week.

mszep commented 3 years ago

Okay, so then it quite clearly looks like the new Fedoras have a difference in how they install the context/mtx tools -- maybe they're available under a different name? Happy to add a patch to fix this if you do figure this out...

BryanQuigley commented 3 years ago

In just playing around with it.. Switching to generate from html was the easiest. may look deeper later pandoc --standalone --include-in-header $(STYLES_DIR)/$(STYLE).css \ --from markdown --to html \ --pdf-engine wkhtmltopdf \ --variable papersize=A4 \ --output $(OUT_DIR)/$$FILE_NAME.pdf $$f > /dev/null; \

willemsk commented 3 years ago

The problem lies witch /startenumerate and /stopenumerate, see this discussion. My current fix is to replace the enumerate with itemize using sed.

pdf: init
    for f in $(IN_DIR)/*.md; do \
        FILE_NAME=`basename $$f | sed 's/.md//g'`; \
        echo $$FILE_NAME.pdf; \
        pandoc --standalone --template $(STYLES_DIR)/$(STYLE).tex \
            --from markdown --to context \
            --variable papersize=A4 \
            --output $(OUT_DIR)/$$FILE_NAME.tex $$f > /dev/null; \
        sed 's/startenumerate/startitemize/g' $(OUT_DIR)/$$FILE_NAME.tex --in-place; \
        sed 's/stopenumerate/stopitemize/g' $(OUT_DIR)/$$FILE_NAME.tex --in-place; \
        mtxrun --path=$(OUT_DIR) --result=$$FILE_NAME.pdf --script context $$FILE_NAME.tex > $(OUT_DIR)/context_$$FILE_NAME.log 2>&1; \
    done
mszep commented 3 years ago

Good find @willemsk! I guess the style.tex needs to be updated to conform with recent versions of Context and pandoc. I'm busy this week, but will try to fix this soon.

Hnasar commented 2 years ago

On fedora mtxrun doesn't look in the right places for the scripts. With the system install of context, setting export TEXMF=/usr/share/texlive/texmf-dist fixed it for me.

snowskeleton commented 1 month ago

I was having a similar issue on macOS Sequoia, and it was fixed by running

mtxrun --generate

as noted here