James-Yu / LaTeX-Workshop

Boost LaTeX typesetting efficiency with preview, compile, autocomplete, colorize, and more.
MIT License
10.51k stars 520 forks source link

TikZ picture new feature doesn't really work #1528

Closed joulev closed 5 years ago

joulev commented 5 years ago

Disable all the other extensions except for LaTeX Workshop, and check that you still see this issue. [Required]
Done.

Make sure to visit the wiki FAQ before filling an issue.
Done.

Describe the bug [Required]
I was (and am) literally very surprised to see the "View TikzPicture" a few days ago – never thought that such a feature will ever be implemented. After some days of using and checking, I think there are still some problems to be considered:

Last, but not least, could you please change "TikzPicture" to "TikZ picture", or even better "TikZ picture"? The official "logo" of the package is "TikZ".

Expected behavior Exactly what we all expect.

Logs [Required]

LaTeX Workshop Output [Required] I paste the related part (everything that is shown after I pressing the button). The other lines are not related IMHO. ``` [15:26:24] Serving PDF file at http://localhost:51814/viewer.html?file=pdf..QyUzQSU1Q1VzZXJzJTVDQU5IVEFOfjElNUNBcHBEYXRhJTVDTG9jYWwlNUNUZW1wJTVDdnNjb2RlLWxhdGV4d29ya3Nob3AlNUN0aWt6cHJldmlldy1wcm9ibGVtLXR2d3RsNSU1Q3Rpa3pwaWN0dXJlLTcwMzgwODQwLnBkZg [15:26:24] The encoded path is C:\Users\ANHTAN~1\AppData\Local\Temp\vscode-latexworkshop\tikzpreview-problem-tvwtl5\tikzpicture-70380840.pdf [15:26:25] Open PDF tab for C:\Users\ANHTAN~1\AppData\Local\Temp\vscode-latexworkshop\tikzpreview-problem-tvwtl5\tikzpicture-70380840.pdf [15:26:26] No PDF viewer connected for C:\Users\ANHTAN~1\AppData\Local\Temp\vscode-latexworkshop\tikzpreview-problem-tvwtl5\tikzpicture-70380840.pdf [15:26:26] Serving PDF file at http://localhost:51814/viewer.html?file=pdf..QyUzQSU1Q1VzZXJzJTVDQU5IVEFOfjElNUNBcHBEYXRhJTVDTG9jYWwlNUNUZW1wJTVDdnNjb2RlLWxhdGV4d29ya3Nob3AlNUN0aWt6cHJldmlldy1wcm9ibGVtLXR2d3RsNSU1Q3Rpa3pwaWN0dXJlLTcwMzgwODQwLnBkZg [15:26:26] The encoded path is C:\Users\ANHTAN~1\AppData\Local\Temp\vscode-latexworkshop\tikzpreview-problem-tvwtl5\tikzpicture-70380840.pdf [15:26:26] Open PDF tab for C:\Users\ANHTAN~1\AppData\Local\Temp\vscode-latexworkshop\tikzpreview-problem-tvwtl5\tikzpicture-70380840.pdf [15:26:28] Handle data type: open [15:26:28] Handle data type: open [15:26:28] Preview PDF file: c:\Users\ANHTAN~1\AppData\Local\Temp\vscode-latexworkshop\tikzpreview-problem-tvwtl5\tikzpicture-70380840.pdf [15:26:28] Preview PDF file: c:\Users\ANHTAN~1\AppData\Local\Temp\vscode-latexworkshop\tikzpreview-problem-tvwtl5\tikzpicture-70380840.pdf [15:26:28] Handle data type: loaded [15:26:28] Handle data type: loaded ```
Developer Tools Console [Required] `latexmkrc` seems to have trouble compiling the Ti*k*Z pictures. ![a](https://i.stack.imgur.com/oTwLo.png)

Screenshots In the following screenshot, there are no buttons. a

In the following screenshot, the middle TikZ picture is not recognized. a

In the following screenshot, it is expected to be a graph. a

\begin{tikzpicture}[font=\footnotesize,>=stealth]
    \draw[<->] (3.5,0) -| (0,2.5) node[at start,below] {$d$} node[at end,left] {$V$};
    \path (0,0) node[below] {$X$} (1.5,0) node[below] {$P$} (3,0) node[below] {$Y$};
    \fill (0,0) circle (1.5pt) (1.5,0) circle (1.5pt) (3,0) circle (1.5pt);
    \draw[thick] (0,.5) -- (3,2);
\end{tikzpicture}

Desktop [Required]:

Additional context If necessary, this is my mysterious \centertikz command. It is a workaround for centering elements in the middle of the baseline. I can't figure out how it affects the feature, but as I can see, it does affect the feature.

\newbox\mybox
\def\centertikz#1{%
    \setbox\mybox\hbox{#1}%
    \raisebox{-0.5\dimexpr\ht\mybox+\dp\mybox}{\copy\mybox}%
}
tecosaur commented 5 years ago

Hi, @joulev thanks for making this issue. I should be able to help with those points.

  1. Tikz pictures not being recognised.

That's due to a mistake that slipped in earlier where whenever \end{tikzpicture} is unindented the tikzpicture isn't recognised (fixed in 7a1871543477ea89d0daf1d281be67ab2ea9a030). Hopefully this should be fine in the next release.

  1. Tikzpictures after \centertikz being recognised

I imagine that's because the \end{tikzpicture} there is indented.

  1. View tikzpicture button is buggy

That's very dodgy. I did try your example though, and it seemed to work (Using the HEAD version of this extension though). It's worth noting that I am on linux.

image

  1. please change "TikzPicture" to "TikZ picture", or even better "TikZ picture"

Sure! I'll make a commit for that soon.

p.s. Thanks for a rather nicely structured issue with examples :smiley:

Helpful troubleshooting steps

The temp file used (in your case) looks like C:\Users\ANHTAN~1\AppData\Local\Temp\vscode-latexworkshop\tikzpreview-problem-tvwtl5\ (though the letters/numbers at the end change each session). You should find the files for the tikzpreview in this folder.

e.g. image

It would be very helpful if you would be able to

joulev commented 5 years ago

Hi @tecosaur.

Thanks for your reply. I am trying to reproduce the problems. In fact, I think indentation is the cause here:

a

As you have fixed, I am looking forward to the next release!


However, even when the environment is indented, if they are nested in something e.g. enumerate, it seems that only the 1st, 3rd, 5th, etc. are recognized:

a


As of the output preview, I see nothing actually. latexmkrc is still reporting that it can't compile. Following your advice, I go to the directory and found

preamble.tex

\documentclass{standalone}

\usepackage{tikz}

\pdfcompresslevel=0
\pdfobjcompresslevel=0

\begin{document}\end{document}

tikzpicture-76543465.tex (just for example)

%&preamble
\begin{document}
\begin{tikzpicture}[font=\footnotesize,>=stealth]
        \draw (0,0) -- (1,1);
    \end{tikzpicture}
\end{document}

texput.log

This is pdfTeX, Version 3.14159265-2.6-1.40.20 (MiKTeX 2.9.7050 64-bit) (INITEX)  23 JUL 2019 17:08
**"&pdflatex" mylatexformat.ltx "C:\Users\ANHTAN~1\AppData\Local\Temp\vscode-la
texworkshop\tikzpreview-check-Ou9Dix\preamble.tex"

! Emergency stop.
<*> "&pdflatex" 
                mylatexformat.ltx "C:\Users\ANHTAN~1\AppData\Local\Temp\vsco...
*** (job aborted, file error in nonstop mode)

No pages of output.

It seems that the files is somehow written incorrectly perhaps, which leads to compilation errors.

Full MWE source file I used in the above example (if necessary) ```latex \documentclass{article} \usepackage{tikz} \newbox\mybox \def\centertikz#1{% \setbox\mybox\hbox{#1}% \raisebox{-0.5\dimexpr\ht\mybox+\dp\mybox}{\copy\mybox}% } \begin{document} This is a normal TikZ picture \begin{tikzpicture}[font=\footnotesize,>=stealth] \draw (0,0) -- (1,1); \end{tikzpicture} This is an indented TikZ picture \begin{center} \begin{tikzpicture}[font=\footnotesize,>=stealth] \draw (0,0) -- (1,1); \end{tikzpicture} \end{center} Using \verb|\centertikz| but not indented \centertikz{\begin{tikzpicture}[font=\footnotesize,>=stealth] \draw (0,0) -- (1,1); \end{tikzpicture}} Using \verb|\centertikz| but indented \centertikz{\begin{tikzpicture}[font=\footnotesize,>=stealth] \draw (0,0) -- (1,1); \end{tikzpicture}} Using many different TikZ pictures and indented \begin{enumerate} \item \centertikz{\begin{tikzpicture}[font=\footnotesize,>=stealth] \draw (0,0) -- (1,1); \end{tikzpicture}} \item \centertikz{\begin{tikzpicture}[font=\footnotesize,>=stealth] \draw (0,0) -- (1,1); \end{tikzpicture}} \item \centertikz{\begin{tikzpicture}[font=\footnotesize,>=stealth] \draw (0,0) -- (1,1); \end{tikzpicture}} \item \centertikz{\begin{tikzpicture}[font=\footnotesize,>=stealth] \draw (0,0) -- (1,1); \end{tikzpicture}} \item \centertikz{\begin{tikzpicture}[font=\footnotesize,>=stealth] \draw (0,0) -- (1,1); \end{tikzpicture}} \end{enumerate} \end{document} ```
joulev commented 5 years ago

Although in my computer it can't compile yet, but by some tests, I found another problem. It seems that \tikzset in preamble is not recognized.

For example, with the following MWE,

\documentclass{article}
\usepackage{tikz}
\usetikzlibrary{decorations.markings}

\tikzset{
    ->-/.style={
        postaction=decorate,
        decoration={markings,mark=at position #1 with \arrow{>}}
    }
}

\begin{document}
\begin{center}
    \begin{tikzpicture}
        \draw[->-=0.5] (0,0) -- (3,-2);
    \end{tikzpicture}
\end{center}
\end{document}

the \tikzset line is crucial to compile the figure. However, in both preamble.tex and tikzpicture-XXX.tex, I don't see any \tikzset, i.e. all settings I have in these global \tikzsets are lost. I think this should also be fixed.

tecosaur commented 5 years ago

Ok. Seems like the \tikzset may be the root of all the compile issues. I have a feeling that the regex for it may not deal with nested brackets well. I'll have a look at that and the code lenses and report back.

tecosaur commented 5 years ago

Update 1

Have fixed the code lense issue. image

tecosaur commented 5 years ago

Update 2

Think I fixed the \tikzset issue. Just had to make some regex that matched up to 3rd level nested brackets β€” {(?:[^\{\}]+|{(?:[^\{\}]+|{(?:[^\{\}]+|{[^\{\}]+})+})+})+}. I find it easier spread out over a few lines.

image

@joulev would you mind testing https://github.com/tecosaur/LaTeX-Workshop/tree/tikzpreview-fixes and letting me know how that goes?

Just in case you havent seen this before, the steps are:

joulev commented 5 years ago

@tecosaur In fact, I haven't done this before, and I have a bit trouble with it. πŸ˜„

a

Could you please explain the steps more? I don't think I can get it yet.

seragunn commented 5 years ago

@joulev Edit: The easiest way to download the code is to download it as a .zip file through Github. I wrote about how to clone repositories earlier which you may feel free to skip.

The procedure to clone a repository is with the git command (https://git-scm.com/). Normally this would just be git clone https://github.com/tecosaur/LaTeX-Workshop.git but since you want a different branch, you want to specify that as well:

git clone --single-branch --branch tikzpreview-fixes https://github.com/tecosaur/LaTeX-Workshop.git
cd LaTeX-Workshop
npm install

Also possible is to clone the whole thing and then checkout to the correct branch:

git clone https://github.com/tecosaur/LaTeX-Workshop.git
cd LaTex-Workshop
git checkout tikzpreview-fixes

Once you're there, you can type git log to check that "Expand maximum bracket nesting in tikzpreview regex" was the latest commit (so you know you have the right branch. Press q to exit the log.


Now you can try npm install and hopefully that works. (It might produce a couple warnings, that is to be expected.) Check that you now have a directory called node_modules. Note: you must run this command from inside the LaTeX-Workshop source directory. Use the cd (change directory) command to get to it. E.g. if you unzipped inside your Downloads folder: cd C:\User\Username\Downloads\LaTeX-Workshop. The command also accept relative paths. E.g. cd Downloads\LaTeX-Workshop will work if your current directory is C:\User\Username\.

You can now open up the directory in VSCode and launch, but you may also find it easier to instead run npm run compile which will produce a folder called out which you can copy to C:\User\Username\.vscode\extensions\james-yu.latex-workshop-7.2.0\. (This is what launching does except launching restores the original extension when it closes.)

joulev commented 5 years ago

@trevorgunn Thank you very much for your detailed instructions! I think I just succeeded.

@tecosaur In fact, all TikZ pictures are now recognized πŸ˜ƒ. But there are still some problems with compilations in my computer.

a

I see that preamble.tex, tikzpicture-XXX.tex and texput.log are not different from yesterday.


Checking out the \tikzset MWE, I can see that \tikzset is still not recognized.

The log file of the compilation ``` This is pdfTeX, Version 3.14159265-2.6-1.40.20 (MiKTeX 2.9.7050 64-bit) (preloaded format=pdflatex 2019.7.24) 24 JUL 2019 10:02 entering extended mode **./tikzpicture-37352611.tex (tikzpicture-37352611.tex LaTeX2e <2018-12-01> (tikzpicture-37352611.aux) \openout1 = `tikzpicture-37352611.aux'. LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 2. LaTeX Font Info: ... okay on input line 2. LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 2. LaTeX Font Info: ... okay on input line 2. LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 2. LaTeX Font Info: ... okay on input line 2. LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 2. LaTeX Font Info: ... okay on input line 2. LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 2. LaTeX Font Info: ... okay on input line 2. LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 2. LaTeX Font Info: ... okay on input line 2. ! LaTeX Error: The font size command \normalsize is not defined: there is probably something wrong with the class file. See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ... l.2 \begin{document} Your command was ignored. Type I to replace it with another command, or to continue without it. ! LaTeX Error: Environment tikzpicture undefined. See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ... l.3 \begin{tikzpicture} Your command was ignored. Type I to replace it with another command, or to continue without it. ! Undefined control sequence. l.4 \draw [->-=0.5] (0,0) -- (3,-2); The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. Missing character: There is no [ in font nullfont! Missing character: There is no - in font nullfont! Missing character: There is no > in font nullfont! Missing character: There is no - in font nullfont! Missing character: There is no = in font nullfont! Missing character: There is no 0 in font nullfont! Missing character: There is no . in font nullfont! Missing character: There is no 5 in font nullfont! Missing character: There is no ] in font nullfont! Missing character: There is no ( in font nullfont! Missing character: There is no 0 in font nullfont! Missing character: There is no , in font nullfont! Missing character: There is no 0 in font nullfont! Missing character: There is no ) in font nullfont! Missing character: There is no - in font nullfont! Missing character: There is no - in font nullfont! Missing character: There is no ( in font nullfont! Missing character: There is no 3 in font nullfont! Missing character: There is no , in font nullfont! Missing character: There is no - in font nullfont! Missing character: There is no 2 in font nullfont! Missing character: There is no ) in font nullfont! Missing character: There is no ; in font nullfont! ! LaTeX Error: \begin{document} ended by \end{tikzpicture}. See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ... l.5 \end{tikzpicture} Your command was ignored. Type I to replace it with another command, or to continue without it. ! LaTeX Error: The font size command \normalsize is not defined: there is probably something wrong with the class file. See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ... l.6 \end{document} Your command was ignored. Type I to replace it with another command, or to continue without it. [1] (tikzpicture-37352611.aux) ) Here is how much of TeX's memory you used: 14 strings out of 492891 622 string characters out of 3122622 57124 words of memory out of 3000000 4026 multiletter control sequences out of 15000+200000 3640 words of font info for 14 fonts, out of 3000000 for 9000 1141 hyphenation exceptions out of 8191 22i,4n,15p,69b,109s stack positions out of 5000i,500n,10000p,200000b,50000s Output written on tikzpicture-37352611.pdf (1 page, 870 bytes). PDF statistics: 6 PDF objects out of 1000 (max. 8388607) 0 named destinations out of 1000 (max. 500000) 1 words of extra memory for PDF output out of 10000 (max. 10000000) ```
tecosaur commented 5 years ago

@joulev I find it interesting that this \tikzset still isn't recognised. You can see your document and the updated regex here https://regex101.com/r/1xix9x/1 and it looks like it should be included.

Using your \tikzset MWE it seems to work for me.

image

Preamble.tex

\documentclass{standalone}

\usepackage{tikz}
\usetikzlibrary{decorations.markings}
\tikzset{
    ->-/.style={
        postaction=decorate,
        decoration={markings,mark=at position #1 with \arrow{>}}
    }
}

\pdfcompresslevel=0
\pdfobjcompresslevel=0

\begin{document}\end{document}

tikzpicture-XYZ.tex

%&preamble
\begin{document}
\begin{tikzpicture}
        \draw[->-=0.5] (0,0) -- (3,-2);
    \end{tikzpicture}
\end{document}

Some Thoughts

I notice in your compilation log that you are using MiKTeX and have the following line

! LaTeX Error: Environment tikzpicture undefined.

as such my current suspicion is that the preamble.fmt file isn't being used for the compilation.

For comparison with texlive on Linux I get this:

My compilation log ```log Latexmk: This is Latexmk, John Collins, 17 Jan. 2018, version: 4.55. Latexmk: applying rule 'pdflatex'... Rule 'pdflatex': Rules & subrules not known to be previously run: pdflatex Rule 'pdflatex': The following rules & subrules became out-of-date: 'pdflatex' ------------ Run number 1 of rule 'pdflatex' ------------ ------------ Running 'pdflatex -recorder "tikzpicture-39616869.tex"' ------------ This is pdfTeX, Version 3.14159265-2.6-1.40.19 (TeX Live 2018) (preloaded format=preamble) restricted \write18 enabled. entering extended mode (./tikzpicture-39616869.tex LaTeX2e <2018-04-01> patch level 2 Babel <3.18> and hyphenation patterns for 84 language(s) loaded. ============================================================================== JOB NAME : "tikzpicture-39616869" CUSTOMISED FORMAT: "preamble" PRELOADED FILES: standalone.cls 2018/03/26 v1.3a Class to compile TeX sub-files standalone shellesc.sty 2016/06/07 v0.02a unified shell escape interface for LaTeX ifluatex.sty 2016/05/16 v1.4 Provides the ifluatex switch (HO) ifpdf.sty 2017/03/15 v3.2 Provides the ifpdf switch ifxetex.sty 2010/09/12 v0.6 Provides ifxetex conditional xkeyval.sty 2014/12/03 v2.7a package option processing (HA) xkeyval.tex 2014/12/03 v2.7a key=value parser (HA) standalone.cfg 2018/03/26 v1.3a Default configuration file for 'standalone' class article.cls 2014/09/29 v1.4h Standard LaTeX document class size10.clo 2014/09/29 v1.4h Standard LaTeX file (size option) bmc-color.sty 2019/06/09 Colour functionality used in the BMC class etoolbox.sty 2018/02/11 v2.5e e-TeX tools for LaTeX (JAW) kvoptions.sty 2016/05/16 v3.12 Key value format for package options (HO) ltxcmds.sty 2016/05/16 v1.23 LaTeX kernel commands for general use (HO) kvsetkeys.sty 2016/05/16 v1.17 Key value parser (HO) infwarerr.sty 2016/05/16 v1.4 Providing info/warning/error messages (HO) etexcmds.sty 2016/05/16 v1.6 Avoid name clashes with e-TeX commands (HO) ifdraft.sty 2016/05/16 v1.4 Detect class options draft and final (HO) xcolor.sty 2016/05/11 v2.12 LaTeX color extensions (UK) color.cfg 2016/01/02 v1.6 sample color configuration pdftex.def 2018/01/08 v1.0l Graphics/color driver for pdftex colortbl.sty 2012/02/13 v1.0a Color table columns (DPC) array.sty 2018/04/07 v2.4g Tabular extension package (FMi) dvipsnam.def 2016/06/17 v3.0m Driver-dependent file (DPC,SPQR) svgnam.def 2016/05/11 v2.12 Predefined colors according to SVG 1.1 (UK) bmc-maths.sty 2019/06/09 Maths functionality used in the BMC class amsmath.sty 2017/09/02 v2.17a AMS math features amstext.sty 2000/06/29 v2.01 AMS text amsgen.sty 1999/11/30 v2.0 generic functions amsbsy.sty 1999/11/29 v1.2d Bold Symbols amsopn.sty 2016/03/08 v2.02 operator names amssymb.sty 2013/01/14 v3.01 AMS font symbols amsfonts.sty 2013/01/14 v3.01 Basic AMSFonts support xfrac.sty 2018/02/21 L3 Experimental split-level fractions expl3.sty 2018/03/05 L3 programming layer (loader) expl3-code.tex 2018/03/05 L3 programming layer l3pdfmode.def 2017/03/18 v L3 Experimental driver: PDF mode graphicx.sty 2017/06/01 v1.1a Enhanced LaTeX Graphics (DPC,SPQR) graphics.sty 2017/06/25 v1.2c Standard LaTeX Graphics (DPC,SPQR) trig.sty 2016/01/03 v1.10 sin cos tan (DPC) graphics.cfg 2016/06/04 v1.11 sample graphics configuration l3keys2e.sty 2018/02/21 LaTeX2e option processing using LaTeX3 keys textcomp.sty 2017/04/05 v2.0i Standard LaTeX package ts1enc.def 2001/06/05 v3.0e (jk/car/fm) Standard LaTeX file ts1enc.dfu 2018/04/05 v1.2c UTF-8 support for inputenc xparse.sty 2018/02/21 L3 Experimental document command parser xtemplate.sty 2018/02/21 L3 Experimental prototype document functions cancel.sty 2013/04/12 v2.2 Cancel math terms mathtools.sty 2018/01/08 v1.21 mathematical typesetting tools calc.sty 2017/05/25 v4.3 Infix arithmetic (KKT,FJ) mhsetup.sty 2017/03/31 v1.3 programming setup (MH) tikz.sty 2015/08/07 v3.0.1a (rcs-revision 1.151) pgf.sty 2015/08/07 v3.0.1a (rcs-revision 1.15) pgfrcs.sty 2015/08/07 v3.0.1a (rcs-revision 1.31) everyshi.sty 2001/05/15 v3.00 EveryShipout Package (MS) pgfrcs.code.tex pgfcore.sty 2010/04/11 v3.0.1a (rcs-revision 1.7) pgfsys.sty 2014/07/09 v3.0.1a (rcs-revision 1.48) pgfsys.code.tex pgfsyssoftpath.code.tex 2013/09/09 (rcs-revision 1.9) pgfsysprotocol.code.tex 2006/10/16 (rcs-revision 1.4) pgfcore.code.tex pgfcomp-version-0-65.sty 2007/07/03 v3.0.1a (rcs-revision 1.7) pgfcomp-version-1-18.sty 2007/07/23 v3.0.1a (rcs-revision 1.1) pgffor.sty 2013/12/13 v3.0.1a (rcs-revision 1.25) pgfkeys.sty pgfkeys.code.tex pgfmath.sty pgfmath.code.tex pgffor.code.tex tikz.code.tex umsa.fd 2013/01/14 v3.01 AMS symbols A umsb.fd 2013/01/14 v3.01 AMS symbols B ============================================================================== (mylatexformat)Info: start reading document "tikzpicture-39616869" (mylatexformat) on input line 2. (\begin{document}) ============================================================================== (./tikzpicture-39616869.aux) (/usr/share/texmf-dist/tex/latex/base/ts1cmr.fd) (/usr/share/texmf-dist/tex/context/base/mkii/supp-pdf.mkii [Loading MPS to PDF converter (version 2006.09.02).] ) (/usr/share/texmf-dist/tex/latex/oberdiek/epstopdf-base.sty (/usr/share/texmf-dist/tex/latex/oberdiek/grfext.sty (/usr/share/texmf-dist/tex/generic/oberdiek/kvdefinekeys.sty)) (/usr/share/texmf-dist/tex/generic/oberdiek/pdftexcmds.sty) (/usr/share/texmf-dist/tex/latex/latexconfig/epstopdf-sys.cfg)) ABD: EveryShipout initializing macros [1] (./tikzpicture-39616869.aux) ) Output written on tikzpicture-39616869.pdf (1 page, 1585 bytes). Transcript written on tikzpicture-39616869.log. === TeX engine is 'pdfTeX' Latexmk: Log file says output to 'tikzpicture-39616869.pdf' Latexmk: All targets (tikzpicture-39616869.pdf) are up-to-date ```

Of particular note to me is the line CUSTOMISED FORMAT: "preamble " which doesn't appear on your log.

I'll have a look and see if MiKTeX works differently and come back. Thanks for being a willing test subject :stuck_out_tongue:

@trevorgunn thank you for helping with instructions on how to run the branch.

tecosaur commented 5 years ago

Ok. @joulev I have no clue why it's not working. I installed MiKTeX on a Win7 VM, pasted the files described in my last comment, and the ran.

  1. pdftex -ini -interaction=nonstopmode -shell-escape -file-line-error -jobname="preamble" "&pdflatex" mylatexformat.ltx "preamble.tex"
  2. latexmk -interaction=batchmode -quiet -pdf tikzpicture-XYZ.tex

And it all worked.

Could you verify that if you do the same that it works for you? If it does can you make sure that the preamble and tikzpicture files that you said were the same are indeed from after you tried my branch. The contents of the files should be the same.

seragunn commented 5 years ago

@tecosaur Calling pdftex from the command line works, calling it with child_process does not. I have no idea why. pdftex doesn't produce a log either when run from the extension so I don't think it even tried to run.

What does work:

I'm out of ideas as to why launching pdftex with child_process isn't working.

You do have to run pdftex.exe rather than pdftex from the command line, but I'm pretty sure that isn't the issue.

EDIT: There is one more thing. If I uninstall the mylatexformat package and standalone class from MikTeX, Running pdftex with child_process.spawn does not prompt to install either package. Running pdftex with child_process.exec prompts to install mylatexformat but not standalone class. This means that pdftex sees the mylatexformat argument but not the standalone class which is contained in the preamble. (Possibly I set up the parameters to child_process.exec wrong.)

This also means that with child_process.spawn, the command doesn't run at all because if it did, it would prompt to install mylatexformat even if it can't find the preamble file.

tecosaur commented 5 years ago

This is strange. I do hope the way it currently is it isn't a Linux-only feature. @James-Yu @jlelong @tamuratak have any of you tested this feature on windows?

joulev commented 5 years ago

@tecosaur @trevorgunn I haven't tested anything yet (today I am a bit busy), but I am sure I don't use latexmk. Maybe that is the issue?

Tonight I will try uninstall all LaTeX-Workshop and your branch and start all over again, but use your approach (latexmk). Hope it works. It is not probable that the feature is Linux-only.

But it is also worth noting that not all users use latexmk, so it should also work without latexmk.

seragunn commented 5 years ago

We should add documentation about what the requirements are for this feature: standalone class, mylatexformat package and latexmk (which on Windows requires installing perl). Some log messages if these are not present might be beneficial too.

tecosaur commented 5 years ago

I think it might be possible to switch to pdflatex (from latexmnk). Not sure if a single tikz picture could ever need more than one run. This could help with compatibility.

joulev commented 5 years ago

@tecosaur I just checked, and both latexmk and pdftex inside VSCode don't work 😞.

If I run the commands from the command line, both produce no error messages, but there are nothing in the PDF file. But \tikzset is recognized!

What I have done 1. Run `latexmk` in the editor. 2. Run `pdftex` from the command line. 3. Run `latexmk` from the command line.

These are the relevant files I think. Ask me if you want more information.

preamble.tex – \tikzset is recognized! ```latex \documentclass{standalone} \usepackage{tikz} \usetikzlibrary{decorations.markings} \tikzset{ ->-/.style={ postaction=decorate, decoration={markings,mark=at position #1 with \arrow{>}} } } \pdfcompresslevel=0 \pdfobjcompresslevel=0 \begin{document}\end{document} ```
tikzpicture-XYZ.tex ```latex %&preamble \begin{document} \begin{tikzpicture} \draw[->-=0.5] (0,0) -- (3,-2); \end{tikzpicture} \end{document} ```
Log output of pdftex command (preamble.log) ``` This is pdfTeX, Version 3.14159265-2.6-1.40.20 (MiKTeX 2.9.7050 64-bit) (INITEX) entering extended mode ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/latex/mylatexformat\my latexformat.ltx" LaTeX2e <2018-12-01> ) (preamble.tex ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/latex/standalone\stand alone.cls" Document Class: standalone 2018/03/26 v1.3a Class to compile TeX sub-files stan dalone ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/latex/tools\shellesc.s ty") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/oberdiek\iflua tex.sty") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/oberdiek\ifpdf .sty") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/ifxetex\ifxete x.sty") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/latex/xkeyval\xkeyval. sty" ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/xkeyval\xkeyva l.tex" ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/xkeyval\xkvuti ls.tex" ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/xkeyval\keyval .tex")))) ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/latex/standalone\stand alone.cfg") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/latex/base\article.cls " Document Class: article 2018/09/03 v1.4i Standard LaTeX document class ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/latex/base\size10.clo" ))) ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/latex/pgf/frontendlaye r\tikz.sty" ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/latex/pgf/basiclayer\p gf.sty" ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/latex/pgf/utilities\pg frcs.sty" ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/utilities\ pgfutil-common.tex" ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/utilities\ pgfutil-common-lists.tex")) ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/utilities\ pgfutil-latex.def" ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/latex/ms\everyshi.sty" )) ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/utilities\ pgfrcs.code.tex" ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf\pgf.revisi on.tex"))) ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/latex/pgf/basiclayer\p gfcore.sty" ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/latex/graphics\graphic x.sty" ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/latex/graphics\graphic s.sty" ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/latex/graphics\trig.st y") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/latex/graphics-cfg\gra phics.cfg") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/latex/graphics-def\pdf tex.def"))) ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/latex/pgf/systemlayer\ pgfsys.sty" ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/systemlaye r\pgfsys.code.tex" ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/utilities\ pgfkeys.code.tex" ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/utilities\ pgfkeysfiltered.code.tex")) ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/systemlaye r\pgf.cfg") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/systemlaye r\pgfsys-pdftex.def" ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/systemlaye r\pgfsys-common-pdf.def"))) ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/systemlaye r\pgfsyssoftpath.code.tex") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/systemlaye r\pgfsysprotocol.code.tex")) ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/latex/xcolor\xcolor.st y" ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/latex/graphics-cfg\col or.cfg")) ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/basiclayer \pgfcore.code.tex" ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/math\pgfma th.code.tex" ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/math\pgfma thcalc.code.tex" ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/math\pgfma thutil.code.tex") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/math\pgfma thparser.code.tex") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/math\pgfma thfunctions.code.tex" ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/math\pgfma thfunctions.basic.code.tex") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/math\pgfma thfunctions.trigonometric.code.tex") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/math\pgfma thfunctions.random.code.tex") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/math\pgfma thfunctions.comparison.code.tex") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/math\pgfma thfunctions.base.code.tex") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/math\pgfma thfunctions.round.code.tex") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/math\pgfma thfunctions.misc.code.tex") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/math\pgfma thfunctions.integerarithmetics.code.tex"))) ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/math\pgfma thfloat.code.tex")) ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/math\pgfin t.code.tex") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/basiclayer \pgfcorepoints.code.tex") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/basiclayer \pgfcorepathconstruct.code.tex") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/basiclayer \pgfcorepathusage.code.tex") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/basiclayer \pgfcorescopes.code.tex") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/basiclayer \pgfcoregraphicstate.code.tex") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/basiclayer \pgfcoretransformations.code.tex") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/basiclayer \pgfcorequick.code.tex") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/basiclayer \pgfcoreobjects.code.tex") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/basiclayer \pgfcorepathprocessing.code.tex") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/basiclayer \pgfcorearrows.code.tex") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/basiclayer \pgfcoreshade.code.tex") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/basiclayer \pgfcoreimage.code.tex" ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/basiclayer \pgfcoreexternal.code.tex")) ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/basiclayer \pgfcorelayers.code.tex") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/basiclayer \pgfcoretransparency.code.tex") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/basiclayer \pgfcorepatterns.code.tex") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/basiclayer \pgfcorerdf.code.tex"))) ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/modules\pg fmoduleshapes.code.tex") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/modules\pg fmoduleplot.code.tex") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/latex/pgf/compatibilit y\pgfcomp-version-0-65.sty") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/latex/pgf/compatibilit y\pgfcomp-version-1-18.sty")) ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/latex/pgf/utilities\pg ffor.sty" ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/latex/pgf/utilities\pg fkeys.sty" ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/utilities\ pgfkeys.code.tex")) ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/latex/pgf/math\pgfmath .sty" ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/math\pgfma th.code.tex")) ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/utilities\ pgffor.code.tex" ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/math\pgfma th.code.tex"))) ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/frontendla yer/tikz\tikz.code.tex" ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/libraries\ pgflibraryplothandlers.code.tex") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/modules\pg fmodulematrix.code.tex") ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/frontendla yer/tikz/libraries\tikzlibrarytopaths.code.tex"))) ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/frontendla yer/tikz/libraries\tikzlibrarydecorations.markings.code.tex" ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/frontendla yer/tikz/libraries\tikzlibrarydecorations.code.tex" ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/modules\pg fmoduledecorations.code.tex")) ("C:\Users\Anh Tan\AppData\Local\Programs\MiKTeX 2.9\tex/generic/pgf/libraries/ decorations\pgflibrarydecorations.markings.code.tex")) ) Beginning to dump on file preamble.fmt (preloaded format=preamble 2019.7.26) 19105 strings of total length 380363 279571 memory locations dumped; current usage is 218&275909 15459 multiletter control sequences \font\nullfont=nullfont \font\OMX/cmex/m/n/5=cmex10 \font\tenln=line10 \font\tenlnw=linew10 \font\tencirc=lcircle10 \font\tencircw=lcirclew10 \font\OT1/cmr/m/n/5=cmr5 \font\OT1/cmr/m/n/7=cmr7 \font\OT1/cmr/m/n/10=cmr10 \font\OML/cmm/m/it/5=cmmi5 \font\OML/cmm/m/it/7=cmmi7 \font\OML/cmm/m/it/10=cmmi10 \font\OMS/cmsy/m/n/5=cmsy5 \font\OMS/cmsy/m/n/7=cmsy7 \font\OMS/cmsy/m/n/10=cmsy10 \font\OT1/cmr/m/it/10=cmti10 \font\OT1/cmtt/m/n/10=cmtt10 \font\OT1/cmss/m/n/10=cmss10 \font\OT1/cmr/bx/n/10=cmbx10 \font\OT1/cmr/bx/it/10=cmbxti10 \font\OT1/cmr/bx/it/12=cmbxti10 at 12.0pt \font\OT1/cmr/bx/it/14.4=cmbxti10 at 14.4pt \font\OT1/cmr/bx/it/17.28=cmbxti10 at 17.28pt \font\OT1/cmr/bx/it/24.88=cmbxti10 at 24.88pt \font\OT1/cmr/bx/it/9=cmbxti10 at 9.0pt \font\OT1/cmr/bx/it/8=cmbxti10 at 8.0pt \font\OT1/cmr/bx/it/5=cmbxti10 at 5.0pt 7632 words of font info for 26 preloaded fonts 1141 hyphenation exceptions Hyphenation trie of length 374709 has 8776 ops out of 35111 143 for language 81 377 for language 80 110 for language 79 138 for language 78 224 for language 77 7 for language 76 12 for language 75 53 for language 74 460 for language 71 127 for language 70 183 for language 69 71 for language 68 248 for language 67 62 for language 66 66 for language 65 119 for language 63 43 for language 62 58 for language 61 7 for language 60 194 for language 59 37 for language 58 23 for language 54 852 for language 53 475 for language 52 235 for language 51 18 for language 50 21 for language 49 38 for language 48 206 for language 45 77 for language 44 58 for language 43 25 for language 42 27 for language 41 37 for language 39 229 for language 38 38 for language 37 21 for language 36 147 for language 35 148 for language 34 185 for language 33 50 for language 30 478 for language 29 207 for language 28 39 for language 27 76 for language 26 40 for language 25 89 for language 24 31 for language 23 113 for language 20 145 for language 19 265 for language 18 60 for language 17 63 for language 16 19 for language 15 14 for language 14 105 for language 13 21 for language 11 54 for language 10 852 for language 9 36 for language 7 5 for language 6 97 for language 2 137 for language 1 181 for language 0 0 words of pdfTeX memory 3 indirect objects No pages of output. Transcript written on preamble.log. ```
texput.log ``` This is pdfTeX, Version 3.14159265-2.6-1.40.20 (MiKTeX 2.9.7050 64-bit) (INITEX) 26 JUL 2019 09:41 **"&pdflatex" mylatexformat.ltx "C:\Users\ANHTAN~1\AppData\Local\Temp\vscode-la texworkshop\tikzpreview-check-75D2Lg\preamble.tex" ! Emergency stop. <*> "&pdflatex" mylatexformat.ltx "C:\Users\ANHTAN~1\AppData\Local\Temp\vsco... *** (job aborted, file error in nonstop mode) No pages of output. ```
tikzpicture-XYZ.log ``` This is pdfTeX, Version 3.14159265-2.6-1.40.20 (MiKTeX 2.9.7050 64-bit) (preloaded format=pdflatex 2019.7.24) 26 JUL 2019 09:41 entering extended mode **./tikzpicture-8899512.tex (tikzpicture-8899512.tex LaTeX2e <2018-12-01> (tikzpicture-8899512.aux) \openout1 = `tikzpicture-8899512.aux'. LaTeX Font Info: Checking defaults for OML/cmm/m/it on input line 2. LaTeX Font Info: ... okay on input line 2. LaTeX Font Info: Checking defaults for T1/cmr/m/n on input line 2. LaTeX Font Info: ... okay on input line 2. LaTeX Font Info: Checking defaults for OT1/cmr/m/n on input line 2. LaTeX Font Info: ... okay on input line 2. LaTeX Font Info: Checking defaults for OMS/cmsy/m/n on input line 2. LaTeX Font Info: ... okay on input line 2. LaTeX Font Info: Checking defaults for OMX/cmex/m/n on input line 2. LaTeX Font Info: ... okay on input line 2. LaTeX Font Info: Checking defaults for U/cmr/m/n on input line 2. LaTeX Font Info: ... okay on input line 2. ! LaTeX Error: The font size command \normalsize is not defined: there is probably something wrong with the class file. See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ... l.2 \begin{document} Your command was ignored. Type I to replace it with another command, or to continue without it. ! LaTeX Error: Environment tikzpicture undefined. See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ... l.3 \begin{tikzpicture} Your command was ignored. Type I to replace it with another command, or to continue without it. ! Undefined control sequence. l.4 \draw [->-=0.5] (0,0) -- (3,-2); The control sequence at the end of the top line of your error message was never \def'ed. If you have misspelled it (e.g., `\hobx'), type `I' and the correct spelling (e.g., `I\hbox'). Otherwise just continue, and I'll forget about whatever was undefined. Missing character: There is no [ in font nullfont! Missing character: There is no - in font nullfont! Missing character: There is no > in font nullfont! Missing character: There is no - in font nullfont! Missing character: There is no = in font nullfont! Missing character: There is no 0 in font nullfont! Missing character: There is no . in font nullfont! Missing character: There is no 5 in font nullfont! Missing character: There is no ] in font nullfont! Missing character: There is no ( in font nullfont! Missing character: There is no 0 in font nullfont! Missing character: There is no , in font nullfont! Missing character: There is no 0 in font nullfont! Missing character: There is no ) in font nullfont! Missing character: There is no - in font nullfont! Missing character: There is no - in font nullfont! Missing character: There is no ( in font nullfont! Missing character: There is no 3 in font nullfont! Missing character: There is no , in font nullfont! Missing character: There is no - in font nullfont! Missing character: There is no 2 in font nullfont! Missing character: There is no ) in font nullfont! Missing character: There is no ; in font nullfont! ! LaTeX Error: \begin{document} ended by \end{tikzpicture}. See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ... l.5 \end{tikzpicture} Your command was ignored. Type I to replace it with another command, or to continue without it. ! LaTeX Error: The font size command \normalsize is not defined: there is probably something wrong with the class file. See the LaTeX manual or LaTeX Companion for explanation. Type H for immediate help. ... l.6 \end{document} Your command was ignored. Type I to replace it with another command, or to continue without it. [1] (tikzpicture-8899512.aux) ) Here is how much of TeX's memory you used: 14 strings out of 492891 612 string characters out of 3122622 57124 words of memory out of 3000000 4026 multiletter control sequences out of 15000+200000 3640 words of font info for 14 fonts, out of 3000000 for 9000 1141 hyphenation exceptions out of 8191 22i,4n,15p,68b,109s stack positions out of 5000i,500n,10000p,200000b,50000s Output written on tikzpicture-8899512.pdf (1 page, 870 bytes). PDF statistics: 6 PDF objects out of 1000 (max. 8388607) 0 named destinations out of 1000 (max. 500000) 1 words of extra memory for PDF output out of 10000 (max. 10000000) ```
tikzpicture-XYZ.fdb_latexmk ``` # Fdb version 3 ["pdflatex"] 1564108901 "tikzpicture-8899512.tex" "tikzpicture-8899512.pdf" "tikzpicture-8899512" 1564109277 "C:/Users/Anh Tan/AppData/Local/MiKTeX/2.9/miktex/data/le/pdftex/pdflatex.fmt" 1563936935 4283774 8c4341f120c3cde54a45d2a9402ec97e "" "tikzpicture-8899512.aux" 1564108901 9 a94a2480d3289e625eea47cd1b285758 "pdflatex" "tikzpicture-8899512.tex" 1564108960 126 9c47054585ea89a08a40800ad63a756a "" (generated) "tikzpicture-8899512.aux" "tikzpicture-8899512.log" "tikzpicture-8899512.pdf" ```
tecosaur commented 5 years ago

@joulev I am able to reproduce your experience with the preamble (but I don't know where texput.log came from). However when it comes to running latexmk -pdf {file} or pdflatex {file} MiKTeX succeeds to compile. I am afraid I am unable to reproduce your issue. I still have no idea why it looks like the format file isn't loaded.

I'm going to open a PR with the fixes I have made, but with this part of the issue I'm not sure how to proceed.

Since we have dealt with all of the original bullet points, I'll open a new issue dedicated to this compilation issue for the sake of simplicity.