Latex and LyX

Below is a link to a custom debian (jessie) bootable iso file.   Students can pick up a completely installed USB stick with it installed  from Norm.

The purpose is to bring a usable LaTeX and LyX environment to people for use in creating documents.  Once booted, the MATE Desktop
Environment
will appear.  At the top of the desktop is a menu containing launchers for various programs.  LyX is installed along with some of the required class and style files used for lab reports for 74:2xx courses.

UPDATES: 30 August 2016, 13 October 2016, change and clarify instructions.
                      19 October 2015, persistent home directory possible with additional post-install configuration.
                     
Download link:
live-image-amd64-LyX_persist.hybrid.iso  size: 2,377,711,616 bytes, md5sum: a9019683478754baa4e6cd9cb9f10e2f (iso from 19 October)

The above iso can be written to either USB or DVD media using the appropriate tools.  It is a hybrid iso format and will boot from either.  Instructions for Windows can be found at http://wiki.linuxcnc.org/cgi-bin/wiki.pl?Hybrid_Iso.  It cannot be used to install to a hard disk.

In Linux, the dd (disk dump) command can be used to write the iso to a  USB stick.  All previous data on the USB stick will be over-written; no data will be preserved from before.  You will need access to root privileges to use dd. Care must be taken to get the destination correct, you can wipe any other disk media by getting the sdx destination incorrect.  No warnings are given. 


Below is an an example where it was determined that /dev/sdd was the device where the USB stick existed by using the dmesg command.  Alternatives commonly encountered are /dev/sdb, /dev/sdc, and so on, depending on the number of partitions and device nodes present.

Instructions:
  1. Carefully determined which device your USB stick appears as by reading the output of the dmesg command. An example is shown below, your output can be different. In this case the USB stick showed up as /dev/sdd.
  2. To create the bootable USB stick, in this case,
         dd if=live-image-amd64 of=/dev/sdd (not /dev/sdd1)
    as root will create the bootable USB media.  
  3. You will now have a bootable USB stick.  Configure your computer to boot off USB and press return when you see the boot menu.

Notes about using this bootable debian live distro

Permanent saving to the bootable USB stick created above is possible, persistence is implemented via boot option "persistence".  This option requires more configuration once booted from the live USB stick created above.  A second USB stick, dropbox, google drive, email, etc, can also be used to save files created in LyX.  If neither option is used, saving inside LyX will create temporary files in a tmpfs system, unless you specify saving to another media.  Although you will see your file saved in /home/user for example, that directory will be cleared and empty when you log out, shut down or reboot.

Option 1: Making /home persistent:
  This option involves creating a new partition in left-over space and making it persistent.
  1. Create the live USB stick as per above and boot the computer using it.
  2. Open a mate terminal and type in "sudo gparted" without quotes.
  3. Change devices to the USB stick.  You should see one partition of about 2GB label Debian jessie... Select the free space and create an extended partition.
  4. Inside the extended partition, create one or more partitions.  For example for a persistent /home, create one ext2 partition.  NB: Make the label "persistence" so that when first rebooted, these partition(s) are configured by the system.  Apply the changes and exit gparted.  This will create device /dev/sda5 for mounting later.  Mount the new partition. On the MATE desktop, click on Computer, and click on an object called persistence.
  5. The goal is to create a file called persistence.conf in the top directory of the newly created partition with contents explained below. In a mate terminal, become root using "sudo su -", no quotes. Change directories to the newly mounted volume, usually /media/user/persistence.
  6. Next enter "echo "/home" >> /mountpoint/persistence.conf".  Insure that the persistence.conf file is correctly located and has /home as its contents by catting it out using "cat /mountpoint/persistence.conf".  
  7. Reboot.  Once the machine is up again, open a mate terminal and type in mount.  You should see that /dev/sda5 mounted along with any other partitions created similarly.
 
Saving to another media:
  Open the file manager on the desktop, then insert a second USB stick, possibly formatted with the fat or vfat filesystem for using with the Windows OS.  This second USB stick will be auto-mounted and show up in the file manager.  Note the location of this mounted volume.  Inside LyX you can now use "save as" to navigate to this location and save a .lyx there.  Alternatively, you can copy the file out of /home/user to the second stick using the file manager.  You can test persistence by creating a file in /home/user.  If the file is there after rebooting, all is well.
   
Screensaver & password:
If you come back to see the desktop has been locked, use the password "live" to unlock the screensaver.  This is the password for the user named "user".
   
xmgrace: This installation does not have the template file that the computer lab machines have.  Thus xmgrace presents a different default scale, titles, axis labels etc.  Again, the above file saving techniques must be applied to preserve your graphs.

LyX:  The first time LyX is run, it will take a few seconds to come up while it scans the installation for LaTeX packages, viewers, etc.  If persistence of the /home directory is enabled, this happens just once, the configuration is saved.  You'll also have Document Settings remembered across reboots.




Output of "dmesg" command:
[3618705.842015] usb 2-1.3: new high-speed USB device number 51 using ehci-pci
[3618706.244697] usb 2-1.3: New USB device found, idVendor=0781, idProduct=5530
[3618706.244702] usb 2-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[3618706.244704] usb 2-1.3: Product: Cruzer
[3618706.244707] usb 2-1.3: Manufacturer: SanDisk
[3618706.244709] usb 2-1.3: SerialNumber: 1000200927112317465E
[3618706.245231] usb-storage 2-1.3:1.0: USB Mass Storage device detected
[3618706.245576] scsi22 : usb-storage 2-1.3:1.0
[3618707.994472] scsi 22:0:0:0: Direct-Access     SanDisk  Cruzer           1100 PQ: 0 ANSI: 4
[3618707.994885] sd 22:0:0:0: Attached scsi generic sg4 type 0
[3618707.996021] sd 22:0:0:0: [sdd] 15633408 512-byte logical blocks: (8.00 GB/7.45 GiB)
[3618707.996898] sd 22:0:0:0: [sdd] Write Protect is off
[3618707.996903] sd 22:0:0:0: [sdd] Mode Sense: 43 00 00 00
[3618707.998040] sd 22:0:0:0: [sdd] No Caching mode page found
[3618707.998046] sd 22:0:0:0: [sdd] Assuming drive cache: write through
[3618708.002563]  sdd: sdd1
[3618708.005620] sd 22:0:0:0: [sdd] Attached SCSI removable disk
[3619631.492119]  sdd: sdd1In this instance the USB media is showing up as /dev/sdd and contains one partitions sdd.

Website © Copyright hogan53.net 2015. All rights reserved.