Latex, Octave and Interest in COVID-19 Science

Puppy related raves and general interest that doesn't fit anywhere else
Post Reply
Message
Author
s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

Latex, Octave and Interest in COVID-19 Science

#1 Post by s243a »

I've taken a bit of a break from puppy in part because I got stuck trying to figure out some ssl related stuff and also because of interest in the science of COVID-19. As I dig into things more it won't be enough just to quote relevant sections of a given paper but I will want to try to either repeat some of the math or do some of the related math of my own.

Some forums have good support for math formulas via latex but if something takes a long time to write (e.g. I'm working out the ideas) then I would rather generate the latex localy than via some forum software. I googled "latex linux" and read, "9 Best LaTeX Editors For Linux".

The first program that caught my eye was gummi. I found the split window showing the preview on the right and the latex code on the left appealing. I intially couldn't get gummi to work so also installed lyx and kile. Kile is more of an IDE and lyx is a WYSIWYG (What you see is what you get) editor. Lyx might be a good candidate to replace the word processor in a math/science oriented version of puppylinux.

I had the same issues with lyx as I did with gummi and the issue was related to missing configuration files for texlive. After failing to resolve this via installing multiple tex/tek/latex related packages from the debian repos, I discovered there was an installation script for a so-called vanilla version of texlive that one could install that was independent of the debian repos. I was able to use this vanilla version of texlive to get gummi working with only a few files borrowed from the debian repos and in general this small hack/fix to get it to work might not be typically necessary and might only be due to a random error that occured during installation. I won't know of course until I here if others have experienced the same problem and if so they will be fortunate to have my small fixes available.

Prior to installing the Vanilla version first install the following debian packages

Code: Select all

 tex-common, texinfo, and perhaps lmodern
**As mentioned at: https://www.tug.org/texlive/debian.html

The vanilla version of tex live can be downloaded from:
http://ctan.mirror.globo.tech/systems/texlive/Source/
** other mirrors can be found at: https://ctan.org/mirrors

Download the file install-tl-unx.tar.gz

Extract the file and and in the extracted directory run:

Code: Select all

perl install-tl
** As mentioned at: https://www.tug.org/texlive/quickinstall.html

the software will be installed to the following directory:

Code: Select all

/usr/local/texlive/2020
prepend this path to your path variable (e.g. edit /etc/profile)

Now update the files by first
downloading the script "update-tlmgr-latest.sh"
and then running it in the following directory "/usr/local/texlive/2020" with the code:

Code: Select all

sh update-tlmgr-latest.sh -- --upgrade
**As mentioned at https://www.tug.org/texlive/upgrade.html

Assuming that your path variable is set correctly and you are in a terminal with the working directory at "/usr/local/texlive/2020" then you can test your upgrade with the following code:

Code: Select all

tlmgr -gui
** As mentioned here https://www.tug.org/texlive/doc/texlive ... tlportable

If the upgrade worked then when you click the load default button the local versions shouldmatch the remote repo.

Now assuming you are running the terminal in the same directory and the PATH variable is still correct, try starting gummi. Check to see if there are any missing files. I was missing pdftexconfig.tex hyphen.tex. I identified which debian package these were located in:

Code: Select all

$ grep -rn /var/packages -e pdftexconfig.tex
/var/packages/texlive-base_2018.20190227-2_all.files:1524:/usr/share/texlive/texmf-dist/tex/generic/tex-ini-files/pdftexconfig.tex
$ grep -rn /var/packages -e hyphen.tex
/var/packages/texlive-base_2018.20190227-2_all.files:1511:/usr/share/texlive/texmf-dist/tex/generic/hyphen/hyphen.tex
and then copied the missing files into the directories

Code: Select all

/usr/local/texlive/2020/texmf-dist/tex/latex/latexconfig
#and
/usr/local/texlive/2020/texmf-dist/tex/generic/hyphen
#respectively.
In the latexconfig directory only one file was missing but in the hyphen directory, multiple files were missing. I copied all the missing files for the hyphen directory. I didn't attempt to do a general merge because the directories might be structured differently and there also might be compatibility issues. Coping these few missing files has appeared to make gummi work but more testing is required. To simplify this for other people I could create an sfs file.

I was also able to get octave working both on dupupbuster32 and fatdog64. For fatdog64 you must load devx for octave to work. On dpupbuster you can install the files that are part of devX in pkg using the HIDE_BUILTINS=false option. You might also need the -f option. I recommend using the latest version of pkg rather than the one that come with dpupubuster. You can also on fatdog64 install packages that are part of devX but I advise against this because depending on the package it might cause compatibility issue.

As a final note if you are installing texlive in PUPMODE=13 (i.e. pmedia=usbflash) you might run out of memory on an older laptop. One could get around this by saving during installation or creating a swap file. Alternatively one could reboot in PUPMODE=12 (i.e. pmedia=usbhd). Perhaps it was the saving during installation that caused me to miss a few files that I had to obtain from the debian repos.

More complete installation instructions can be found at:
https://www.tug.org/texlive/doc/texlive ... stallation
Find me on [url=https://www.minds.com/ns_tidder]minds[/url] and on [url=https://www.pearltrees.com/s243a/puppy-linux/id12399810]pearltrees[/url].

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#2 Post by s243a »

I had some issues getting hyperlinks to work in my LaTex documents.
https://www.overleaf.com/learn/latex/hyperlinks

As discussed this might be due to an error in the installation process rather than anything that was fundamentally missing under normal installation.

Anyway, the troubleshooting stategy is to search for the missing file in either your system or at:
https://packages.debian.org/search?suit ... echeck.sty

For instance if I search for it on my dpup system I might type:

Code: Select all

cd /var/packages
grep -rn . -e 'rerunfilecheck.sty'
to see where the debian version of the file is and then I coppy the missing folder contents to the vanilla installation. After doing this several times I identified the following folders that I had to copy missing contents from in order to get the hyperref package working in the vinella version of texlive:

Code: Select all

Copy contents of :
/usr/share/texlive/texmf-dist/tex/latex/hyperref/
to
/usr/local/texlive/2020/texmf-dist/tex/latex/hyperref

/usr/share/texlive/texmf-dist/tex/generic/oberdiek/
to 
/usr/local/texlive/2020/texmf-dist/tex/generic/oberdiek/

/usr/share/texlive/texmf-dist/tex/generic/ifxetex/
to (new folder)
/usr/local/texlive/2020/texmf-dist/tex/generic/ifxetex/

/usr/share/texlive/texmf-dist/tex/latex/url/
to
/usr/local/texlive/2020/texmf-dist/tex/latex/url/

/usr/share/texlive/texmf-dist/tex/latex/oberdiek/
to 
/usr/local/texlive/2020/texmf-dist/tex/latex/oberdiek/
Currently I'm using gummi to write some stuff up about the Pareto distribution. This distribution is often used to model income and wealth inequality.
Last edited by s243a on Wed 08 Jul 2020, 02:25, edited 1 time in total.
Find me on [url=https://www.minds.com/ns_tidder]minds[/url] and on [url=https://www.pearltrees.com/s243a/puppy-linux/id12399810]pearltrees[/url].

User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#3 Post by tallboy »

emacs. I have the full texlive on my old Debian box, some 4Gb if I am not mistaken. I have not needed to make a LaTex document for a little more than a year, but I used LaTex almost daily at the uni from 2000 onwards, and I still think LaTex. From time to time, some GUI editors turned up, and were promptly dismissed. Nothing compared to emacs. It has/had a steep learning curve, requires a lot from the user's memory about how everything works, and it may be considered a little old-fashioned today. I still think it is the best tool for producing LaTex documents. They were both made in the same time period, and they both bear the marks of the influence from the major nerds of those days. But, they work.
True freedom is a live Puppy on a multisession CD/DVD.

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#4 Post by s243a »

tallboy wrote:emacs. I have the full texlive on my old Debian box, some 4Gb if I am not mistaken. I have not needed to make a LaTex document for a little more than a year, but I used LaTex almost daily at the uni from 2000 onwards, and I still think LaTex. From time to time, some GUI editors turned up, and were promptly dismissed. Nothing compared to emacs. It has/had a steep learning curve, requires a lot from the user's memory about how everything works, and it may be considered a little old-fashioned today. I still think it is the best tool for producing LaTex documents. They were both made in the same time period, and they both bear the marks of the influence from the major nerds of those days. But, they work.
I now again wonder about all the cool things that One might be able to do with emacs but never invested the time to learn it. Since, I'm not strong at the really powerful editors emacs and VI/VIM In the near term I will be using mostly GUI style editors but perhaps one day I will step up to a more powerful CLI based editor.
Find me on [url=https://www.minds.com/ns_tidder]minds[/url] and on [url=https://www.pearltrees.com/s243a/puppy-linux/id12399810]pearltrees[/url].

s243a
Posts: 2580
Joined: Tue 02 Sep 2014, 04:48
Contact:

#5 Post by s243a »

I was having some issues adding figures to my latex document. As I mentioned in "another post" The solution was to specify the driver (i.e.pdftex) in the usepackage statement as follows:

Code: Select all

\usepackage[pdftex]{graphicx} 
texlive comes with a bunch of scripts, I'm not sure if they are important to how texlive runs or not but the broken symlinks were bugging me. The scripts (or symlinks to them?) are found in the package, texlive-extra-utils but I think this package is mostly symlinks from the bin director, which is for the vanilla version of texlive:
/usr/local/texlive/2020/bin/i386-linux

The actual scripts are contained in separate package. To troubleshoot, I looked to see where there broken symlinks were pointed and searched for the file name of the target. For example:
https://packages.debian.org/search?sear ... s=pdfbook2

and then copy the missing script file from the system version of texlive to the vanilla version. I only was concerned about copying over the scrips and didn't check to see if anything else in the package was missing but could write a script to do this.

Another thing worth checking to see if ones borken verison of texlive is missing any necessary configuration files. For instance, "[url=https://packages.debian.org/search?suit ... pdftex.def]pdftex.def[/uirl]", which for the vanilla version of texlive is found at:
/usr/local/texlive/2020/texmf-dist/tex/latex/graphics-def/pdftex.def

If a configuration file is missing -- like this one was (i.e. pdftex.def) -- then one could copy them over from the system version of texlive. If one is using pkg then reinstalling the package might leave around the package file which can be extracted or if it is installed properly then the files should be on your system.

If you are missing a configuration file you should notice it in your error log of your latex editor (e.g. gummi). Also if an error is reported in a given tex script file (e.g. graphics.sty) you might see in the script file what it is looking for. For instance in graphics.sty. it noteced that default drives are specified in graphics.cfg. If this file is missing you might want to copy a version of it and then edit it accordingly.
Find me on [url=https://www.minds.com/ns_tidder]minds[/url] and on [url=https://www.pearltrees.com/s243a/puppy-linux/id12399810]pearltrees[/url].

User avatar
tallboy
Posts: 1760
Joined: Tue 21 Sep 2010, 21:56
Location: Drøbak, Norway

#6 Post by tallboy »

The downside to Tex, LaTex, emacs, vim, is that they are so f..ing massive, that when you at last feel that you start to master them, you have to read up on a whole lot of new info to make some small changes, and then it is very easy to get lost! :shock:
True freedom is a live Puppy on a multisession CD/DVD.

Post Reply