aidanscannell / my-org-resume

Personal CV/Resume written in Org-mode with the LaTeX AltaCV template.
http://www.aidanscannell.com/post/org-mode-resume/
59 stars 43 forks source link

user-error: Unknown LaTeX class 'altacv' #2

Closed zenny closed 2 years ago

zenny commented 2 years ago

@aidanscannell Thanks for the altacv org hack.

I cloned your repo and tried to export the org file by executing C-c C-e l o, but dies with "user-error: Unknown LaTeX class 'altacv' ".

Tried to figure out any LaTeX package called altacv, but not available. Can you elaborate a bit how do you export this to pdf besides above method?

Thanks!

aidanscannell commented 2 years ago

Hi @zenny,

You need to add the altacv LaTeX class to the org-latex-classes variable. Have a read of the Local Configuration for Org-Mode CV File section here. Essentially you need to run one of the code blocks in the org file (to add altacv to org-latex-classes) before you can export the org file.

I hope that helps. Good luck with your applications!

zenny commented 2 years ago

Hi @zenny,

Thanks for the prompt response.

You need to add the altacv LaTeX class to the org-latex-classes variable. Have a read of the Local Configuration for Org-Mode CV File section here. Essentially you need to run one of the code blocks in the org file (to add altacv to org-latex-classes) before you can export the org file.

Yep, but the code snippet has already been in place in your curriculum-vitae.org (https://github.com/aidanscannell/my-org-resume/blob/master/curriculum-vitae.org) file, right? I didn't modify a thing, just trying to export it to PDF and check what it looks first. Yet there was a no go.

I have even appended the code snippet to the user.el:

(after! org
  (use-package! ox-extra
    :config
    (ox-extras-activate '(latex-header-blocks ignore-headlines))))

Yet no go. Or did I miss something?

I hope that helps. Good luck with your applications!

aidanscannell commented 2 years ago

You need to run the src block in the LaTeX config section (with C-c C-c) before you can export it to pdf.

zenny commented 2 years ago

src block

Thanks @aidanscannell , but there is an issue with pdfx.sty:

This is pdfTeX, Version 3.141592653-2.6-1.40.23 (TeX Live 2021) (preloaded format=pdflatex 2021.10.22)  6 NOV 2021 12:00
entering extended mode
 restricted \write18 enabled.
 %&-line parsing enabled.
**./curriculum-vitae.tex
(.//./curriculum-vitae.tex
LaTeX2e <2021-06-01> patch level 1
L3 programming layer <2021-10-18> (.//altacv.cls
Document Class: altacv 2020/05/17 AltaCV v1.3.2, yet another alternative class 
for a resume/curriculum vitae.
(/opt/texlive/2021/texmf-dist/tex/latex/base/article.cls
Document Class: article 2021/02/12 v1.4n Standard LaTeX document class
(/opt/texlive/2021/texmf-dist/tex/latex/base/size10.clo
File: size10.clo 2021/02/12 v1.4n Standard LaTeX file (size option)
)
\c@part=\count182
\c@section=\count183
\c@subsection=\count184
\c@subsubsection=\count185
\c@paragraph=\count186
\c@subparagraph=\count187
\c@figure=\count188
\c@table=\count189
\abovecaptionskip=\skip47
\belowcaptionskip=\skip48
\bibindent=\dimen138
)

! LaTeX Error: File `pdfx.sty' not found.

Type X to quit or <RETURN> to proceed,
or enter new name. (Default extension: sty)

Enter file name: 
! Emergency stop.
<read *> 

l.41 \RequirePackage
                    [margin=2cm]{geometry}^^M
*** (cannot \read from terminal in nonstop modes)

Here is how much of TeX's memory you used:
 254 strings out of 480030
 3069 string characters out of 5889895
 292176 words of memory out of 5000000
 18031 multiletter control sequences out of 15000+600000
 403430 words of font info for 27 fonts, out of 8000000 for 9000
 319 hyphenation exceptions out of 8191
 48i,0n,55p,165b,36s stack positions out of 5000i,500n,10000p,200000b,80000s
!  ==> Fatal error occurred, no output PDF file produced!

While I checked, pdfx.sty is available in texlive-latexextra-2020.57067_1 pacakge.

# xlocate pdfx.sty
xlocate: database outdated, please run xlocate -S.
texlive-core-2020.57066_1       /usr/share/texmf-dist/tex/latex/lwarp/lwarp-pdfx.sty
texlive-latexextra-2020.57067_1 /usr/share/texmf-dist/tex/latex/pdfx/pdfx.sty
texlive-publishers-2020.57058_1 /usr/share/texmf-dist/tex/lualatex/novel/novel-pdfx.sty

The texlive-latexextra-2020.57067_1 is already installed:

]# vpm search texlive-latexextra
[vpm]  Searching for: texlive-latexextra (xbps-query -v -Rs texlive-latexextra)
[*] texlive-latexextra-2020.57067_1 TeX Live - Collection of LaTeX addon packages

Yet it reports in the above log that pdfx.sty is not available! Hmmm....

aidanscannell commented 2 years ago

This sounds like an issue with your LaTeX setup. I am using latexmk with the following config,

(setq org-latex-pdf-process
          '("latexmk -f -silent -output-directory=./tex %f \n cp ./tex/%b.pdf ./%b.pdf"))

You can check what latex command emacs is using by running describe-variable and seeing what you have set for org-latex-pdf-process. It looks like you are using pdftex so I would recommend trying latexmk with my config. If emacs has generated the .tex file for you (just not the .pdf), you should be able to build .pdf from the .tex using latexmk in the command line.

zenny commented 2 years ago

(setq org-latex-pdf-process '("latexmk -f -silent -output-directory=./tex %f \n cp ./tex/%b.pdf ./%b.pdf"))

Thanks.

describe-variable shows:

Value
("latexmk -f -silent -output-directory=./tex %f \n cp ./tex/%b.pdf ./%b.pdf")

Original Value
("latexmk -f -pdf -%latex -interaction=nonstopmode -output-directory=%o %f")

Set Customize

Whereas trying to output a pdf says:

Latexmk: Run number 1 of rule 'latex'
This is pdfTeX, Version 3.141592653-2.6-1.40.23 (TeX Live 2021) (preloaded format=latex)
 restricted \write18 enabled.
entering extended mode
Latexmk: Log file says no output from latex
Latexmk: For rule 'latex', no output was made
Failure to make 'tex/curriculum-vitae.dvi'
Collected error summary (may duplicate other messages):
  latex: Command for 'latex' gave return code 1
      Refer to 'tex/curriculum-vitae.log' for details
cp: cannot stat './tex/curriculum-vitae.pdf': No such file or directory

But while pulling your repo, there exists tex directory:

$ ls -la
total 5.1M
drwxr-sr-x 5 zenny zenny   14 Nov  7 02:05 .
drwxr-sr-x 6 zenny zenny    6 Nov  6 11:51 ..
drwxr-sr-x 7 zenny zenny   12 Nov  6 11:54 .git
drwxr-sr-x 2 zenny zenny    6 Nov  7 02:05 tex
-rw-r--r-- 1 zenny zenny  14K Nov  3 15:47 #altacv.cls#
-rw-r--r-- 1 zenny zenny  17K Nov  3 14:43 README.org
-rw-r--r-- 1 zenny zenny 2.0K Nov  3 14:43 aidan.bib
-rw-r--r-- 1 zenny zenny  34K Nov  3 14:43 aidan_portrait.jpeg
-rw-r--r-- 1 zenny zenny  14K Nov  3 14:43 altacv.cls
-rw-r--r-- 1 zenny zenny 1.7K Nov  7 01:58 curriculum-vitae.log
-rw-r--r-- 1 zenny zenny  19K Nov  6 11:13 curriculum-vitae.org
-rw-r--r-- 1 zenny zenny  11K Nov  7 02:05 curriculum-vitae.tex

I also tried to output in scimax (https://github.com/jkitchin/scimax) configuration which has org-latex-pdf-process configured as:

(defcustom org-latex-pdf-process
  '("%latex -interaction nonstopmode -output-directory %o %f"
    "%latex -interaction nonstopmode -output-directory %o %f"
    "%latex -interaction nonstopmode -output-directory %o %f")
  "Commands to process a LaTeX file to a PDF file.

This is a list of strings, each of them will be given to the
shell as a command.  %f in the command will be replaced by the
relative file name, %F by the absolute file name, %b by the file
base name (i.e. without directory and extension parts), %o by the
base directory of the file, %O by the absolute file name of the
output file, %latex is the LaTeX compiler (see
`org-latex-compiler'), and %bib is the BibTeX-like compiler (see
`org-latex-bib-compiler').

The reason why this is a list is that it usually takes several
runs of `pdflatex', maybe mixed with a call to `bibtex'.  Org
does not have a clever mechanism to detect which of these
commands have to be run to get to a stable result, and it also
does not do any error checking.

Consider a smart LaTeX compiler such as `texi2dvi' or `latexmk',
which calls the \"correct\" combinations of auxiliary programs.

Alternatively, this may be a Lisp function that does the
processing, so you could use this to apply the machinery of
AUCTeX or the Emacs LaTeX mode.  This function should accept the
file name as its single argument."
  :group 'org-export-pdf
  :type '(choice
      (repeat :tag "Shell command sequence"
          (string :tag "Shell command"))
      (const :tag "2 runs of latex"
         ("%latex -interaction nonstopmode -output-directory %o %f"
          "%latex -interaction nonstopmode -output-directory %o %f"))
      (const :tag "3 runs of latex"
         ("%latex -interaction nonstopmode -output-directory %o %f"
          "%latex -interaction nonstopmode -output-directory %o %f"
          "%latex -interaction nonstopmode -output-directory %o %f"))
      (const :tag "latex,bibtex,latex,latex"
         ("%latex -interaction nonstopmode -output-directory %o %f"
          "%bib %b"
          "%latex -interaction nonstopmode -output-directory %o %f"
          "%latex -interaction nonstopmode -output-directory %o %f"))
      (const :tag "texi2dvi"
         ("cd %o; LATEX=\"%latex\" texi2dvi -p -b -V %b.tex"))
      (const :tag "latexmk"
         ("latexmk -g -pdf -pdflatex=\"%latex\" -outdir=%o %f"))
      (function)))

Did I miss something? Thanks!