Text Formattingstarting from scratch with atom

Information and discussion about LaTeX's general text formatting features (e.g. bold, italic, enumerations, ...)
ExecutorElassus
Posts: 94
Joined: Wed Sep 07, 2011 3:14 pm

starting from scratch with atom

Post by ExecutorElassus »

I'm dipping my toes into the (I expect long) process of migrating from producing documents with Lyx to writing straight LaTeX using atom. My first task is the relatively simple invoice environment within an scrlttr2 class. I have the following .tex file:

Code: Select all

\documentclass{scrlttr2}
\usepackage{invoice}
%%\usepackage{polyglossia}
%%\setdefaultlanguage[variant=german,spelling=new,babelshorthands=true]{german}

%%\setkomavar{toaddress}

\begin{document}

\begin{letter}{addressee}
  \opening{Dear Mrs~Canary}

  This is an imaginary letter.

  This is the second paragraph of the letter.

  \begin{invoice}{Euro}{0}
    \ProjectTitle{,,text``}%
    %      contents     rate/unit       count
    \Fee{translation}   {0.08}          {1465}

  \end{invoice}

  \closing{Yours sincerely}

  \ps PS: this is a postscript.

  \encl{Photocopy of something interesting\\
   Photocopy of something rather dull}

  \cc{Prof Important Person\\
   Dr Bor Ing}
\end{letter}

\end{document}
That compiles fine, until I uncomment the line for polyglossia, at which point atom returns the following errors:

Code: Select all

/usr/share/texmf-dist/tex/latex/l3packages/xparse/xparse.sty:26: LaTeX Error: Missing \begin{document}. [\RequirePackage{expl3}[]
/usr/share/texmf-dist/tex/latex/l3packages/xparse/xparse.sty:27: Missing number, treated as zero. [\@ifpackagelater{expl3}{2017/04/01}]
/usr/share/texmf-dist/tex/latex/l3packages/xparse/xparse.sty:27: Missing = inserted for \ifnum. [\@ifpackagelater{expl3}{2017/04/01}]
/usr/share/texmf-dist/tex/latex/l3packages/xparse/xparse.sty:27: Missing number, treated as zero. [\@ifpackagelater{expl3}{2017/04/01}]
/usr/share/texmf-dist/tex/latex/l3packages/xparse/xparse.sty:38: Package xparse Error: Supportpackagel3kerneltooold. [ }]
from the log, the specific error is:

Code: Select all

(/usr/share/texmf-dist/tex/latex/l3packages/xparse/xparse.sty

! LaTeX Error: Missing \begin{document}.

See the LaTeX manual or LaTeX Companion for explanation.
Type  H <return>  for immediate help.
 ...

l.26 \RequirePackage{expl3}[
                          2017/04/01]
You're in trouble here.  Try typing  <return>  to proceed.
If that doesn't work, type  X <return>  to quit.

! Missing number, treated as zero.
<to be read again>
\ver@expl3.sty
So, I think my general problem is setting up a document to load classes and definitions explicitly (rather than having Lyx handle it in the background), but I'm not sure how to set this up properly. Atom is set to use `latexmk` to build, and using lualatex as the latex variant. But atom also gave me some error about not being able to convert to latex format when I first saved the file that I didn't catch.

For those with experience setting up .tex files to edit from scratch (or anybody else, really), what am I doing wrong here?

Cheers,

EE

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

starting from scratch with atom

Post by Johannes_B »

Make an update of your TeX distribution.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
ExecutorElassus
Posts: 94
Joined: Wed Sep 07, 2011 3:14 pm

starting from scratch with atom

Post by ExecutorElassus »

all right, I've now installed the texlive distribution separately from my distro's own texlive packages (fwiw I'm on gentoo). I have my local texlive distribution in /usr/local/tex. How do I set atom to use this, and not my system-wide tex distribution?

Cheers,

EE
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

starting from scratch with atom

Post by Johannes_B »

Honestly, I don't know. I never used atom.
I suggest looking at an atom forum. It is certainly somewhere in the preferences.
You could also remove the old path from the system variable and add the new path. But this operation dependent.
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
ExecutorElassus
Posts: 94
Joined: Wed Sep 07, 2011 3:14 pm

starting from scratch with atom

Post by ExecutorElassus »

I've done a bit of digging through the logfile, and have found this:

The file as it is in the first post compiles fine, but if I invoke \usepackage{polyglossia} I get errors on the following files:

csquotes.sty
xkeyval.sty
fontspec.sty
xparse.sty
fontspec-luatex.sty

in the case of the first three, the error is "Missing \begin{document}" at:

\NeedsTeXFormat{LaTeX2e}[
2005/12/01]

In xparse, the error is:

xparse.sty:38: Package xparse Error: Supportpackagel3kerneltooold.

the fontspec package returns three different errors:

Code: Select all

\l__fontspec_tmpa_dim=\dimen136
\l__fontspec_tmpb_dim=\dimen137
\l__fontspec_tmpc_dim=\dimen138
\g__file_internal_ior=\read1

~/tex-local/texlive/2017/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty:452: I can't find file `[.sty'.
\FP@in@ ...es {\FP@loadedfiles ,#1} \input #1.sty 
                                                  
l.452 \RequirePackage[
                    \g_fontspec_encoding_tl]{fontenc}
(Press Enter to retry, or Control-D to exit)
Please type another input file name
~/tex-local/texlive/2017/texmf-dist/tex/latex/fontspec/fontspec-luatex.sty:452: Emergency stop.
\FP@in@ ...es {\FP@loadedfiles ,#1} \input #1.sty 
                                                  
l.452 \RequirePackage[
                    \g_fontspec_encoding_tl]{fontenc}
*** (job aborted, file error in nonstop mode)
So at least now it's loading the local distribution, but so far as I can tell with tlmg, everything is up to date. Am I perhaps mistaken?

Cheers

Addendum: also, my texlive installation is the 2017 release, which has apparently been frozen and is no longer updating. Is that the reason for the errors about old versions, and the reason why you say I should "update" my distribution?
Last edited by ExecutorElassus on Tue Mar 20, 2018 4:32 pm, edited 1 time in total.
User avatar
Stefan Kottwitz
Site Admin
Posts: 10323
Joined: Mon Mar 10, 2008 9:44 pm

starting from scratch with atom

Post by Stefan Kottwitz »

Hi,

perhaps post your .log file here, as attachment. When you write a post, the "Attachments" link is below the text edit field, next to the "Options".

Stefan
LaTeX.org admin
ExecutorElassus
Posts: 94
Joined: Wed Sep 07, 2011 3:14 pm

starting from scratch with atom

Post by ExecutorElassus »

here's the logfile. enjoy?

Cheers
Attachments
rechnung 2018-03-05 - blogpost 21.log
updated log file
(17.73 KiB) Downloaded 452 times
User avatar
Stefan Kottwitz
Site Admin
Posts: 10323
Joined: Mon Mar 10, 2008 9:44 pm

starting from scratch with atom

Post by Stefan Kottwitz »

I had a quick look, this looks like an issue:

(/home/.../texlive/2017/texmf-dist/tex/latex/xkeyval/xke
yval.sty

! LaTeX Error: Missing \begin{document}.
...
\GenericError ...
\endgroup
<to be read again>
[
l.36 \NeedsTeXFormat{LaTeX2e}[
1995/12/01]


Either xkeyval is broken, or there's an issue in your document preamble. Can you post the preamble too?

Stefan
LaTeX.org admin
ExecutorElassus
Posts: 94
Joined: Wed Sep 07, 2011 3:14 pm

starting from scratch with atom

Post by ExecutorElassus »

I have no preamble; this is from the MWE I posted at the top. That's the error I get just for uncommenting '\usepackage{polyglossia}'.

If that's the case, then csquotes, xkeyval, fontspec, xparse, and fontspec-luatex are all broken.

If I'm using a local (ie, manually installed directly from ctan, using the now-frozen texlive-2017 release) texlive installation, how do I go about "fixing" these packages?

Cheers,

EE
User avatar
Johannes_B
Site Moderator
Posts: 4182
Joined: Thu Nov 01, 2012 4:08 pm

starting from scratch with atom

Post by Johannes_B »

Reproducable with latest update before frozen:

Code: Select all

\documentclass{article}
\usepackage{invoice}
\usepackage{polyglossia}
\begin{document}
\end{document}
It should be mentioned, the very very first error is important. I didn't look any closer into this, but the rest of the error messages are just ramblings of a confused computer program. The first one is important.

Edit: David Carlisle already answered how to fix this in invoice package and graphicx
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.
Post Reply