LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices



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

Rep: Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874Reputation: 874

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
add_pdf_files () {
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
    add_pdf_files
    (( 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.
Old 06-11-2011, 12:40 AM   #17
tramni1980
Member
 
Registered: Jul 2006
Location: Tübingen, Germany
Distribution: Slackware64-13.37
Posts: 737

Rep: Reputation: 37
Quote:
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
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 2,501

Rep: Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912
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 02:18 PM. Reason: added sbopkg's log infos
 
1 members found this post helpful.
Old 06-13-2011, 02:44 PM   #19
corbis_demon
Member
 
Registered: Jun 2004
Location: India
Distribution: Slack 13
Posts: 497

Rep: Reputation: 35
Wow, great, Ponce, thanks so much for making the TeXLive packages available
 
Old 06-13-2011, 06:10 PM   #20
bogzab
Member
 
Registered: Mar 2006
Location: Dyserth, Wales
Distribution: Slackware 13.37, Slackware 14.0
Posts: 270

Rep: Reputation: 31
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
dwblas
Member
 
Registered: Jun 2011
Posts: 58

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
ponce
Senior Member
 
Registered: Aug 2004
Location: Pisa, Italy
Distribution: Slackware
Posts: 2,501

Rep: Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912Reputation: 912
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 02:19 AM.
 
Old 06-14-2011, 06:35 AM   #23
CTM
Member
 
Registered: Apr 2004
Distribution: Slackware64 14.0 / 14.1
Posts: 131

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


Reply


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


All times are GMT -5. The time now is 09:45 PM.

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