EEVblog Electronics Community Forum

Products => Computers => Programming => Topic started by: Cloud on December 28, 2020, 08:42:52 am

Title: LaTeX document doesn't build using Visual Studio
Post by: Cloud on December 28, 2020, 08:42:52 am
I am experiencing a problem using Visual Studio Code and LaTeX. I would build my document normaly but suddenly it has stopped working. It just comes to the page 5 and spinss Build wheel. It shows 0 errors or problems. And if I left it all night building it will still be the same. What seems to be the problem?
Title: Re: LaTeX document doesn't build using Visual Studio
Post by: PKTKS on December 28, 2020, 02:01:01 pm
Last thing in the world MS wants is people suddenly
discovering they can publish documents orders of
magnitude better and more practical using TeX.

So why in hell Visual Studio would be by any means expected
to work with TeX?  I doubt they will do that comfy ...
They will not let go their Word Cloud cash cow..

Try in your Tex live distribution to the PERL companion
latex automated builder:  latexmk (links to latexmk.pl)

usually a handy --help (like all good PERL )
Code: [Select]
Latexmk 4.45: Automatic LaTeX document generation routine

Usage: latexmk [latexmk_options] [filename ...]

  Latexmk_options:
   -aux-directory=dir or -auxdir=dir
                 - set name of directory for auxiliary files (aux, log)
                 - Currently this only works with MiKTeX
   -bibtex       - use bibtex when needed (default)
   -bibtex-      - never use bibtex
   -bibtex-cond  - use bibtex when needed, but only if the bib files exist
   -bm <message> - Print message across the page when converting to postscript
   -bi <intensity> - Set contrast or intensity of banner
   -bs <scale> - Set scale for banner
   -commands  - list commands used by latexmk for processing files
   -c     - clean up (remove) all nonessential files, except
            dvi, ps and pdf files.
            This and the other clean-ups are instead of a regular make.
   -C     - clean up (remove) all nonessential files
            including aux, dep, dvi, postscript and pdf files
            and file of database of file information
   -CA     - clean up (remove) all nonessential files.
            Equivalent to -C option.
   -CF     - Remove file of database of file information before doing
            other actions
   -cd    - Change to directory of source file when processing it
   -cd-   - Do NOT change to directory of source file when processing it
   -dependents or -deps - Show list of dependent files after processing
   -dependents- or -deps- - Do not show list of dependent files
   -deps-out=file - Set name of output file for dependency list,
                    and turn on showing of dependency list
   -dF <filter> - Filter to apply to dvi file
   -dvi   - generate dvi
   -dvi-  - turn off required dvi
   -e <code> - Execute specified Perl code (as part of latexmk start-up
               code)
   -f     - force continued processing past errors
   -f-    - turn off forced continuing processing past errors
   -gg    - Super go mode: clean out generated files (-CA), and then
            process files regardless of file timestamps
   -g     - process regardless of file timestamps
   -g-    - Turn off -g
   -h     - print help
   -help - print help
   -jobname=STRING - set basename of output file(s) to STRING.
            (Like --jobname=STRING on command line for many current
            implementations of latex/pdflatex.)
   -l     - force landscape mode
   -l-    - turn off -l
   -latex=<program> - set program used for latex.
                      (replace '<program>' by the program name)
   -latexoption=<option> - add the given option to the (pdf)latex command
   -logfilewarninglist or -logfilewarnings
               give list of warnings after run of (pdf)latex
   -logfilewarninglist- or -logfilewarnings-
               do not give list of warnings after run of (pdf)latex
   -M     - Show list of dependent files after processing
   -MF file - Specifies name of file to receives list dependent files
   -MP    - List of dependent files includes phony target for each source file.
   -new-viewer    - in -pvc mode, always start a new viewer
   -new-viewer-   - in -pvc mode, start a new viewer only if needed
   -nobibtex      - never use bibtex
   -nodependents  - Do not show list of dependent files after processing
   -norc          - omit automatic reading of system, user and project rc files
   -output-directory=dir or -outdir=dir
                  - set name of directory for output files
   -pdf   - generate pdf by pdflatex
   -pdfdvi - generate pdf by dvipdf
   -pdflatex=<program> - set program used for pdflatex.
                      (replace '<program>' by the program name)
   -pdfps - generate pdf by ps2pdf
   -pdf-  - turn off pdf
   -ps    - generate postscript
   -ps-   - turn off postscript
   -pF <filter> - Filter to apply to postscript file
   -p     - print document after generating postscript.
            (Can also .dvi or .pdf files -- see documentation)
   -print=dvi     - when file is to be printed, print the dvi file
   -print=ps      - when file is to be printed, print the ps file (default)
   -print=pdf     - when file is to be printed, print the pdf file
   -pv    - preview document.  (Side effect turn off continuous preview)
   -pv-   - turn off preview mode
   -pvc   - preview document and continuously update.  (This also turns
                on force mode, so errors do not cause latexmk to stop.)
            (Side effect: turn off ordinary preview mode.)
   -pvc-  - turn off -pvc
   -quiet    - silence progress messages from called programs
   -r <file> - Read custom RC file
               (N.B. This file could override options specified earlier
               on the command line.)
   -recorder - Use -recorder option for (pdf)latex
               (to give list of input and output files)
   -recorder- - Do not use -recorder option for (pdf)latex
   -rules    - Show list of rules after processing
   -rules-   - Do not show list of rules after processing
   -showextraoptions  - Show other allowed options that are simply passed
               as is to latex and pdflatex
   -silent   - silence progress messages from called programs
   -time     - show CPU time used
   -time-    - don't show CPU time used
   -use-make - use the make program to try to make missing files
   -use-make- - don't use the make program to try to make missing files
   -v        - display program version
   -verbose  - display usual progress messages from called programs
   -version      - display program version
   -view=default - viewer is default (dvi, ps, pdf)
   -view=dvi     - viewer is for dvi
   -view=none    - no viewer is used
   -view=ps      - viewer is for ps
   -view=pdf     - viewer is for pdf
   -lualatex     - use lualatex for processing files to pdf
                   and turn pdf mode on, dvi/ps modes off
   -xelatex      - use xelatex for processing files to pdf
                   and turn pdf mode on, dvi/ps modes off

   filename = the root filename of LaTeX document

-p, -pv and -pvc are mutually exclusive
-h, -c and -C override all other options.
-pv and -pvc require one and only one filename specified
All options can be introduced by '-' or '--'.  (E.g., --help or -help.)
 
In addition, latexmk recognizes many other options that are passed to
latex and/or pdflatex without interpretation by latexmk.  Run latexmk
with the option -showextraoptions to see a list of these

Report bugs etc to John Collins <jcc8 at psu.edu>.



In short this should do the trick with parsing messages and
errors on console.. a good shell with color coding will help

Code: [Select]
latexmk -pdf -pdflatex="pdflatex --shell-escape %O %S" myfoo.tex


Paul
Title: Re: LaTeX document doesn't build using Visual Studio
Post by: Cloud on December 30, 2020, 09:40:50 am
Thanks I'll try this.

I was told this was company policy to use Visual Studio for LaTex and of course all coworkers that know how to use it are currently on vacation and IT department has no idea what LaTeX.  |O

Visual Studio has one good feature: you can generate preview for Circuitikz image directly so you dont't have to compile whole document. But of course this is microsoft so this previews are opening randomly every 10 seconds  :scared:
Title: Re: LaTeX document doesn't build using Visual Studio
Post by: PKTKS on December 30, 2020, 11:21:31 am
Thanks I'll try this.

I was told this was company policy to use Visual Studio for LaTex and of course all coworkers that know how to use it are currently on vacation and IT department has no idea what LaTeX.  |O

Visual Studio has one good feature: you can generate preview for Circuitikz image directly so you dont't have to compile whole document. But of course this is microsoft so this previews are opening randomly every 10 seconds  :scared:

Kinda odd...  using "VisualStudio"  for anything only will
sound or make sense to MS employees or someone totally
out this world...

In a pinch any TikZ code should compile straight out of the
box using latexmk ..

I had done this countless times  and it is really simple
doing so on a terminal  where a good color parser does
a lot of help when tracking dependencies...

My stuff still compiles directly .. using external binds
to gnuplot  and Bode plots metalatex via TikZ

Attached  fancy stuff.. done today in less than1 second..

Paul
Title: Re: LaTeX document doesn't build using Visual Studio
Post by: newbrain on January 01, 2021, 05:23:11 pm
Cloud,
it's not clear from your posts what tool you are using.
Visual Studio and Visual Studio Code are very different environments, the latter being open source (-ish, still Microsoft, after all...) and available on Windows, Linux and Mac.

While most of PKTKS comments are just pointless anti-MS rambling, they gave some interesting suggestions.

If you are using Visual Studio Code, there are also a number of LaTeX extensions, such as this (https://marketplace.visualstudio.com/items?itemName=James-Yu.latex-workshop), which might prove helpful.

I don't use LaTeX myself, but I routinely use VS Code to compile my embedded projects, and, e.g. from yang to puml (with preview) using a mix of extensions and compile tasks.
Title: Re: LaTeX document doesn't build using Visual Studio
Post by: PKTKS on January 02, 2021, 08:27:06 am
no ramblings...

is pointless to insist in putting MS
in picture where you can and should
use the right tools...

MS is no longer an option..
this is not rambling..
just see that perspective
Paul
Title: Re: LaTeX document doesn't build using Visual Studio
Post by: mansaxel on January 02, 2021, 09:12:26 am
You need to work on style. Or your comments will be seen as ramble, even if you largely are right.

I would never, ever, think of something so rubegoldbergish as to try using VS for LaTeX, but that's probably because I haven't had a Windows computer as my main working environment for 20 years now.

I'd try the Aarhus University TeX package (auctex) for Emacs if I was the poster. And a Makefile if I wanted to get a bit fancy.

No, it does not solve the problem as presented, but it is the fastest and leanest way of making LaTeX documents I've found. Worth considering.

Edit: Do try to compile into DVI from the command line, to see if there's some build step or code construct that VS barfs on.
Title: Re: LaTeX document doesn't build using Visual Studio
Post by: newbrain on January 02, 2021, 03:38:05 pm
I would never, ever, think of something so rubegoldbergish as to try using VS for LaTeX
Visual Studio? Neither would I (as much as I like it as an IDE).
Visual Studio Code?
Probably. It's a beast of a completely different species.
And, as said, you do not need Windows - it's the only editor which managed to pry emacs from my old hands on Windows, Linux and FreeBSD.
I sometimes prepare docs in asciidoc, plantuml and markdown, I have no problems with VSC.

Quote
Last thing in the world MS wants is people suddenly
discovering they can publish documents orders of
magnitude better and more practical using TeX.
This stuff is pointless, unsubstantiated, and quite certainly false (the overlap in market and target users is a niche of a niche), does not help the OP and IMHO disqualifies the otherwise interesting information.
But, hey, to each their own.
Title: Re: LaTeX document doesn't build using Visual Studio
Post by: PKTKS on January 02, 2021, 04:33:36 pm
You need to work on style. Or your comments will be seen as ramble, even if you largely are right.
(..)

perhaps... 
I am definitely at home in a garage service bench ...
in any language...  :-+

Imagine what will be the world without
VisualStudio and Word...  :palm:

 :-+
Paul

Title: Re: LaTeX document doesn't build using Visual Studio
Post by: TheAmmoniacal on January 02, 2021, 04:43:04 pm
My LaTeX workflow is MikTeX (https://miktex.org/ (https://miktex.org/)) + TexMaker (https://www.xm1math.net/texmaker/ (https://www.xm1math.net/texmaker/)).

Why anyone would use Visual Studio is beyond me..
Title: Re: LaTeX document doesn't build using Visual Studio
Post by: mathsquid on January 02, 2021, 08:06:23 pm
I would never, ever, think of something so rubegoldbergish as to try using VS for LaTeX...

That does seem like a crazy way to do things.
Title: Re: LaTeX document doesn't build using Visual Studio (Code)
Post by: larsdenmark on January 06, 2021, 09:11:56 am
People do not seem to know that there's a difference between Visual Studio and Visual Studio Code.

Visual Studio Code is free and multi platform and has an addins for LaTeX (and a lot of other programming languages)

https://code.visualstudio.com/

The reason for using VS Code for everything is that you can then do all your programming using one environment.
Title: Re: LaTeX document doesn't build using Visual Studio (Code)
Post by: PKTKS on January 06, 2021, 12:47:05 pm

Visual Studio Code is free and multi platform and has an addins for LaTeX (and a lot of other programming languages)

https://code.visualstudio.com/

Been there since early days of MS...

the 2 cents of jambo are required to be spoken...

There is absolute nothing free or multi or portable related to MS

There is only one single directive of business in MS:
 - dead shorting every possible way out from their products.

ditto.  they crapped every  sort of compiler competitor and
library competitor and framework competitor along the last
decades..

the utmost  funny asshole jerk joke is:
- the future of  desktop *NIX is MS *NIX.

assume that is not a joke - indeed it underlies the proper goals

Been there along decades..  they cause me several prejudice
problems and time waste with their crappy products..

Dumped their garbage products in the potty...



The reason for using VS Code for everything is that you can then do all your programming using one environment.

Never  worked for me not even close as being a solution.

Reason being is that such thing is not sustainable...

Operating System vendors and hardware manuft.  go to bed
without telling us... and they deprecate things at will turning
that into a very expensive  nightmare ..

Along the timeline we are required to shift the environment
to adapt new trends and formats and that is not possible
if blocked by their products and formats..

In short what works better:
- use the proper tools native to your OS and open code available
- format free.. royalty free because you will need to change them
  some time in the near future..
- never ever trust that crappy shit MS sells - they will stick your back asap
- the formats in which your stuff is contained must be easily changeable


 the latter issue is the most important one to me ..

I've been required to change the whole paradigm several times
in the last decades... and MS never ever succeed a single one time..

*NIX  succeeded  every single time I needed
 because we have options and it is not related to
a single  one **** greedy jerk vendor... 

Even when I changed from SCO to Slackware things went smooth

No rant no rambling.. 2 cents  of jambo

Paul
Title: Re: LaTeX document doesn't build using Visual Studio
Post by: RoGeorge on January 06, 2021, 01:23:55 pm
"Microsoft evil" is an unrelated topic.  VS Code is free and open source and can be used for any non-Microsoft products, I doubt it does any kind of "sabotaging".  There is nothing hidden in VS Code to stop or cripple other's products.

About LaTeX, what exactly do you use?  There are so many TeX/LaTeX tools out there.  Are you sure you don't use some LaTeX tools that depend on a 3rd party online processing, and the 3rd party stopped working?
Title: Re: LaTeX document doesn't build using Visual Studio
Post by: PKTKS on January 06, 2021, 01:59:52 pm
"Microsoft evil" is an unrelated topic.  VS Code is free and open source and can be used for any non-Microsoft products, I doubt it does any kind of "sabotaging".  There is nothing hidden in VS Code to stop or cripple other's products.

About LaTeX, what exactly do you use?  There are so many TeX/LaTeX tools out there.  Are you sure you don't use some LaTeX tools that depend on a 3rd party online processing, and the 3rd party stopped working?

I don't think they are evil..   I have used their shit quite a lot.
They are just a bunch of crap shit

They are just a bad bad bad bad really bad product vendors.
In early 90s I had invested time and effort in compilers like
the excellent Borland and quite amazing fast WATCOM ...

MS doomed them all in their vertical stack of "property".

The code compiled (being ASM/C/C++/RTF/TeX/whatever) in those
"VISUAL SHIT" thingos  from them is unportable.. they crap the
rules and hide several critical tools to allow proper code dependency

in short they use a patented GUI strategic lockdown.
Once you have your assets locked into the GUI you are crapped.

On the other hand .. makefiles and proper native tools which can
deal with system wide open proper methods (like  PERL /SH based
automake) or alternatives like  cmake or others... can be easily
ported to other systems..

TeX is no exception.

TeX is already  with the proper tools to compile and check the
code base.. you just have to manage them.

In the 90s...  I have used quite a lot NEDIT in which the MACRO
and SHELL  escape capabilities can do pretty much any thing
in which EMACS  can plus the MOTIF GUI (which EMACS lacks)

My MOTIF GUI still works.. ( i drag my system as needed)

TODAY I CHANGED MY TEX to LYX in which i can manage
far better the import export simple features...

But as some features probably  are not in LyX .. TeXmaker
is my first choice ...

but as I have posted before... 

LATEXMK  is still my first  and preferable tool for that..

GUIs  just keep in the way...   

fancy shots attached
Paul