Visit Jeremy's Blog.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 06-10-2011, 09:47 PM   #16
Senior Member
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 4,682

Rep: Reputation: 1566Reputation: 1566Reputation: 1566Reputation: 1566Reputation: 1566Reputation: 1566Reputation: 1566Reputation: 1566Reputation: 1566Reputation: 1566Reputation: 1566

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.

I actually use a modified version of the script that is rewritten to use bash shell functions and can handle subdirectories within the directory for an additional layer of bookmark entries.

# 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
# Starting values for bookmark creation
# 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
  if [ "$PREFIX" != "$NEWPREFIX" ]; then

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

# Function to add all pdf files in current directory to the output file
add_pdf_files () {
for FILENAME in *.[Pp][Dd][Ff] ; do
  echo "\includepdf[pages=-,fitpaper]{"$PWD"/"$FILENAME"}" >> $OUTFILE

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

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

echo "\end{document}" >> $OUTFILE

# Now process the .tex file
# Do a second run so that bookmark entries are resolved
pdflatex $OUTFILE; pdflatex $OUTFILE

# 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 script
if [ -f combine.start ]; then rm combine.start; fi

# Remove this script
rm $0
1 members found this post helpful.
Old 06-11-2011, 12:40 AM   #17
Registered: Jul 2006
Location: Gießen, Germany
Distribution: Slackware64-14.2
Posts: 786

Rep: Reputation: 49
Originally Posted by mlpa View Post
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.
Old 06-12-2011, 10:32 AM   #18
Senior Member
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 3,881

Rep: Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918
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!)

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
rsync -avP rsync:// .
rsync -avP rsync:// .
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 02:18 PM. Reason: added sbopkg's log infos
1 members found this post helpful.
Old 06-13-2011, 02:44 PM   #19
Registered: Jun 2004
Location: India
Distribution: CLFS
Posts: 515

Rep: Reputation: 36
Wow, great, Ponce, thanks so much for making the TeXLive packages available
Old 06-13-2011, 06:10 PM   #20
Registered: Mar 2006
Location: Dyserth, Wales
Distribution: Slackware 14.0, Slackware 14.1, Slackware-current
Posts: 306

Rep: Reputation: 33
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.
Old 06-13-2011, 10:44 PM   #21
Registered: Jun 2011
Posts: 79

Rep: Reputation: Disabled
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.
Old 06-14-2011, 02:17 AM   #22
Senior Member
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 3,881

Rep: Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918Reputation: 1918
I missed this: Robby is already providing texlive packages himself

so I think I'll soon remove the ones above, sorry for not noticing earlier.

Last edited by ponce; 06-14-2011 at 02:19 AM.
Old 06-14-2011, 06:35 AM   #23
Registered: Apr 2004
Distribution: Slackware
Posts: 288

Rep: Reputation: 270Reputation: 270Reputation: 270
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.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Why tetex? donallen Slackware 26 04-13-2010 11:39 AM
fonts-problem with tetex ruh31 Debian 0 03-31-2006 06:49 AM
teTeX Question duvalgo Linux - General 2 01-13-2006 05:19 PM
is tetex needed? speel Linux - Newbie 2 01-30-2005 07:24 AM
teTex nautilus_1987 Linux - General 8 09-20-2002 12:12 AM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 10:21 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration