Share your knowledge at the LQ Wiki.
 Home Forums HCL Reviews Tutorials Articles Register Search Today's Posts Mark Forums Read
 LinuxQuestions.org TeTeX Time for update?
 Slackware This Forum is for the discussion of Slackware Linux.

Notices

06-10-2011, 08:47 PM   #16
allend
Senior Member

Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 4,501

Rep:

Quote:
 Personally I've never used TeTex or TexLive but this line piqued my curiosity. Care to elaborate on this little gem
Where I work we have Windows systems that produce multiple printed reports that can run to hundreds of pages. I wanted a way to capture these as a single bookmarked PDF document. The details are here. http://slackwiki.org/PDF_Printing

I actually use a modified version of the combine.sh script that is rewritten to use bash shell functions and can handle subdirectories within the directory for an additional layer of bookmark entries.
Code:
#!/bin/bash

# Script to combine .pdf files into a single bookmarked .pdf file
# Intended to be run from within a directory containing files to be concatenated.
# The directory name is accepted as a parameter

# If the directory name has been passed, then make it the working directory.
if [[ $1 ]]; then cd$1; fi

# Filename for the .tex file that will be processed using pdflatex
OUTFILE=$PWD/out2.tex # Starting values for bookmark creation BKMK_TEXT=Contents BKMK_ANCHOR=Beginning BKMK_LEVEL=0 # Variable containing ASCII code for centre dot character CENTREDOT=$(echo -e "\xB7")

# Function to sanitise filenames by:
#  Changing space characters to underscore characters
#  and changing all but last period characters to centre dot (0xB7)
#  Necessary for \includepdf to parse filenames correctly
sanitise_filenames () {
for FILENAME in *.[Pp][Dd][Ff] ; do
PREFIX=${FILENAME%.*} SUFFIX=${FILENAME##*.}
NEWPREFIX=${PREFIX// /_} NEWPREFIX=${NEWPREFIX//./$CENTREDOT} if [ "$PREFIX" != "$NEWPREFIX" ]; then mv "$FILENAME" "$NEWPREFIX.$SUFFIX"
fi
done
return
}

# Function to create a bookmark entry
do_bookmark_entry () {
BKMK_TEXT=${FILENAME%.*} BKMK_TEXT=${BKMK_TEXT:15}
#  NB. Need to substitute 'space' for 'underscore' to be valid bookmark text.
BKMK_TEXT=${BKMK_TEXT//_/ } # Create a unique anchor point based on date and time prepended to filename BKMK_ANCHOR=${FILENAME:0:14}
echo "\pdfbookmark["$BKMK_LEVEL"]{"$BKMK_TEXT"}{"$BKMK_ANCHOR"}" >>$OUTFILE
return
}

# Function to add all pdf files in current directory to the output file
for FILENAME in *.[Pp][Dd][Ff] ; do
do_bookmark_entry
echo "\includepdf[pages=-,fitpaper]{"$PWD"/"$FILENAME"}" >> $OUTFILE done return } echo "\documentclass{article}" >$OUTFILE
echo "\usepackage{pdfpages}" >> $OUTFILE echo "\usepackage[bookmarks,bookmarksopen,bookmarksopenlevel=1,pdfpagelayout={SinglePage},pdfview={Fit}]{hyperref}" >>$OUTFILE

echo "\begin{document}" >> $OUTFILE echo "\pdfbookmark["$BKMK_LEVEL"]{"$BKMK_TEXT"}{"$BKMK_ANCHOR"}" >> $OUTFILE sanitise_filenames (( BKMK_LEVEL++ )) for FNAME in * ; do if [ -d$FNAME ]; then
FILENAME=$FNAME do_bookmark_entry cd$FNAME
(( BKMK_LEVEL++ ))
sanitise_filenames
(( BKMK_LEVEL-- ))
cd ..
elif [ -f $FNAME ] && [[${FNAME##*.} == [Pp][Dd][Ff] ]] ; then
FILENAME=$FNAME do_bookmark_entry echo "\includepdf[pages=-,fitpaper]{"$PWD"/"$FILENAME"}" >>$OUTFILE
fi
done

echo "\end{document}" >> $OUTFILE # Now process the .tex file # Do a second run so that bookmark entries are resolved pdflatex$OUTFILE; pdflatex $OUTFILE wait # Rename the created .pdf file mv${OUTFILE%.*}.pdf $(date +%Y%m%d%H%M%S)_All.pdf # Cleanup files left by pdflatex processing rm${OUTFILE%.*}*

# Cleanup trigger file if this script has been started from watch_for_combine_start.sh script
if [ -f combine.start ]; then rm combine.start; fi

# Remove this script
rm \$0

1 members found this post helpful.
06-10-2011, 11:40 PM   #17
tramni1980
Member

Registered: Jul 2006
Location: Gießen, Germany
Distribution: Slackware64-14.2
Posts: 765

Rep:
Quote:
 Originally Posted by mlpa I install TexLive, and i haven't ask for TexLive in slackware, simply said If TeTex is not supported, and maybe multiple users uninstall and install TexLive, why not remove TeTex and use that space for other features. Then each user is free to install TeTex or TexLive or other thing. Of course this is only my point of view.
Removing latex from default Slackware altogether would not be a good thing as there are a number packages depending on it to build their documentation. However, I do stand the view that obsolete tetex should be replaced with some minimal version of a supported latex distribution. When you write in LaTeX and call for help in some forum, the latter is automatically denied as soon as they realize that one is using a distribution as obsolete as tetex.

 06-12-2011, 09:32 AM #18 ponce Senior Member   Registered: Aug 2004 Location: Pisa, Italy Distribution: Slackware Posts: 3,530 Rep: preamble: just trying to share some slack... I built two texlive packages from slackbuilds' build scripts on freshly installed systems without tetex and tetex-doc, that you have to remove(pkg) before installing this (1,1 Gb compressed and 2.2 uncompressed!) http://ponce.cc/slackware/slackware-13.37/texlive/ http://ponce.cc/slackware/slackware64-13.37/texlive/ I've added the sbopkg (used for packaging) log too, so you can check the build phase. I haven't tested them myself (I don't use it) but if you want to do it you're welcome if you don't trust your "wget -c", you can also get them by rsync Code: rsync -avP rsync://ponce.cc/pub/slackware-13.37/texlive/texlive-20100722-i486-3ponce.txz . rsync -avP rsync://ponce.cc/pub/slackware64-13.37/texlive/texlive-20100722-x86_64-3ponce.txz . the . (dot) at the end is needed, it means "sync the remote [file] in the current folder". a curiosity: it's the biggest slackware package I've assembled (and it takes ages to install too ). Last edited by ponce; 06-12-2011 at 01:18 PM. Reason: added sbopkg's log infos 1 members found this post helpful.
 06-13-2011, 01:44 PM #19 corbis_demon Member   Registered: Jun 2004 Location: India Distribution: CLFS Posts: 515 Rep: Wow, great, Ponce, thanks so much for making the TeXLive packages available
 06-13-2011, 05:10 PM #20 bogzab Member   Registered: Mar 2006 Location: Dyserth, Wales Distribution: Slackware 14.0, Slackware 14.1, Slackware-current Posts: 306 Rep: Like many others posting here, I just got the TexLive package from Slackbuilds and built it with no problems. I think it is recommended to remove TeTex before you do this. In my case I needed some of the macro packages that were in TexLive but not in TeTex in order to contribute to a user manual (QGIS) which was being maintained as a LaTex document. Interesting project - got me to learn how svn works to download and upload the tex sources as well as bringing me up to date with what Tex / LaTex can do these days. Not reasonable to expect this really big package (TexLive) to be included in standard Slackware though. Like a lot of specialist stuff, that's what Slackbuilds are for and the recent survey here shows just how well that repository is used.
 06-13-2011, 09:44 PM #21 dwblas Member   Registered: Jun 2011 Posts: 75 Rep: I think a package that is maintained is a must as new formats will come along. Everyone will want to publish most things in e-pub format for example, and while there is no explicit conversion now (but there are LaTex to epub stand alones), it will almost certainly be part of TexLive in the future.
 06-14-2011, 01:17 AM #22 ponce Senior Member   Registered: Aug 2004 Location: Pisa, Italy Distribution: Slackware Posts: 3,530 Rep: I missed this: Robby is already providing texlive packages himself http://rlworkman.net/pkgs/13.37/i486...i486-1_rlw.txz http://rlworkman.net/pkgs/13.37/x86_...6_64-1_rlw.txz so I think I'll soon remove the ones above, sorry for not noticing earlier. Last edited by ponce; 06-14-2011 at 01:19 AM.
 06-14-2011, 05:35 AM #23 CTM Member   Registered: Apr 2004 Distribution: Slackware Posts: 252 Rep: To answer some earlier questions, yes, there are some things that TeX Live can do that teTeX can't - there are several packages on CTAN (for example, l3packages or anything that depends on it) that won't work because the version of pdftex that ships with the last version of teTeX is too old. I'd love to see TeX Live in Slackware but it's gigantic, and stripping functionality out of packages in order to make them smaller is counterproductive. I'm not really sure what the solution is - but for now, teTeX will still compile the majority of your documents so if you need something more complex then grab Robby's TeX Live build when necessary.

 Posting Rules You may not post new threads You may not post replies You may not post attachments You may not edit your posts BB code is On Smilies are On [IMG] code is Off HTML code is Off Forum Rules

 Similar Threads Thread Thread Starter Forum Replies Last Post donallen Slackware 26 04-13-2010 10:39 AM ruh31 Debian 0 03-31-2006 05:49 AM duvalgo Linux - General 2 01-13-2006 04:19 PM speel Linux - Newbie 2 01-30-2005 06:24 AM nautilus_1987 Linux - General 8 09-19-2002 11:12 PM

All times are GMT -5. The time now is 02:57 PM.

 Contact Us - Advertising Info - Rules - LQ Merchandise - Donations - Contributing Member - LQ Sitemap -