hplgit / latexslides Goto Github PK
View Code? Open in Web Editor NEWAutomatically exported from code.google.com/p/latexslides
Automatically exported from code.google.com/p/latexslides
Installing latexslides ====================== Installing latexslides is done by python setup.py install with the usual Distutils options available. Location of LaTeX files ======================= As part of latexslides, several style files (*.sty) are provided in the folder 'styles'. When running the above installation command, the style files are written to os.path.join(sys.prefix, 'share', 'texmf', 'tex', 'latex', 'latexslides') The location can be changed in the following ways: python setup.py install --install-data=/tmp The style files are now written to os.path.join('/tmp', 'share', 'texmf', 'tex', 'latex', 'latexslides') python setup.py install --home=/tmp and python setup.py install --prefix=/tmp work as usual, the style files are then written to os.path.join('/tmp', 'share', 'texmf', 'tex', 'latex', 'latexslides') as well. Note that the option --install-data only works for the style files, and overwrite the options --home and --prefix for these files (as it should). If none of these options behaves as required (for instance, you would like to install them to $HOME/texmf), then the variable 'styles_dir' in setup.py should be set to this directory. After the script finishes, you should make sure that the latex command can find the files. If the files are located in one of the directories where LaTeX knows about them, it should suffice to run the following command: texconfig rehash To check which directories are available to LaTeX, you can use one of the following two commands: texconfig conf or kpsepath tex As a last resort, it is possible to set the environment variable TEXINPUTS, demonstrated for the Bash shell: export TEXINPUTS=:.:/path/to/style_files Note the first semi-colon; it ensures that the systemwide directories are searched first. Handouts ======== To convert slides to handouts with multiple slides per page, use the psnup command from the psutils package. Here is an example of how to use this command: psnup -Pa4 -4 -l -m10 -b5 -d5 infile.pdf outfile.ps see 'man psnup' and 'psnup --help' Authors ======= Latexslides is based on a package now called oldlatexslides, developed by Hans Petter Langtangen and Åsmund Ødegård. Ilmar Wilbers redesigned and reimplemented that package partially based on changes already made by Arve Knudsen. New features were also added. All four authors work at Simula Research Laboratory in Norway, www.simula.no.
Hi.
Poppler's (http://poppler.freedesktop.org/) pdftocairo utility produces much
better png images than ghostscript and makes job faster. Also the best result
achieved when i put a higher resolution (i tried 1600 instead 300). Here is a
simple patch:
--- ./bin/pdf2odp 2012-12-09 13:55:26.789049070 +0400
+++ ./bin/pdf2odp.new 2012-12-09 15:25:28.543189800 +0400
@@ -27,21 +27,36 @@
print "%s only accepts pdf files, exiting." %sys.argv[0]
sys.exit(4)
-# Check for gs
+# converter engine: gs or pdftocairo
+engine = 'pdftocairo'
+resolution = 1600
+
+# Check for converter engine
try:
- subprocess.call(['gs', '-v'], stdout=subprocess.PIPE)
+ if engine == 'pdftocairo':
+ subprocess.call(['pdftocairo', '-v'], stdout=subprocess.PIPE)
+ else:
+ subprocess.call(['gs', '-v'], stdout=subprocess.PIPE)
except OSError:
- print "You need Ghostscript, exiting."
+ if engine == 'pdftocairo':
+ print "You need Poppler utils, exiting."
+ else:
+ print "You need Ghostscript, exiting."
sys.exit(5)
-gs_args = ['gs', '-dNOPAUSE', '-dSAFER', '-dBATCH', '-sDEVICE=pngalpha',
- '-r300', '-sOutputFile=tmp_%s_%%03d.png' %(file), filename]
+if engine == 'pdftocairo':
+ engine_args = ['pdftocairo', '-png', '-scale-to', '%s' %(resolution),
+ filename, 'tmp_%s_' %(file)]
+else:
+ engine_args = ['gs', '-dNOPAUSE', '-dSAFER', '-dBATCH',
+ '-sDEVICE=pngalpha', '-r%s' %(resolution),
+ '-sOutputFile=tmp_%s_%%03d.png' %(file), filename]
-# Try to run gs
-print 'Converting %s to images using gs\n' %filename
-result = subprocess.Popen(gs_args)
+# Try to run converter engine
+print 'Converting %s to images using %s\n' %(filename, engine)
+result = subprocess.Popen(engine_args)
if result.wait():
- print '\nRunning gs failed with the error above, exiting.'
+ print '\nRunning %s failed with the error above, exiting.' %engine
sys.exit(6)
print "\nDone..."
The patch offers choice between ghostscript and poppler engines using variable
engine, another choice - png resolution adjusted in variable resolution.
Probably it makes sense to implement optional arguments for them in the script
(but i do not program python scripts well)
What version of the product are you using? On what operating system?
latexslides: latest svn snapshot, Fedora 17
Cheers, Alexey.
Original issue reported on code.google.com by [email protected]
on 9 Dec 2012 at 12:33
What steps will reproduce the problem?
1. If I run:
jose@mafalda:~/latexslides-0.31/bin$ ./pdf2odp eca.pdf eca.odp
I get:
./pdf2odp only accepts pdf files, exiting.
What version of the product are you using? On what operating system?
0.31 over Ubuntu 9.04 AMD64, Python 2.6
Please provide any additional information below.
I solve this changing the line 26 for the following:
**********************
if ext != '.pdf':
**********************
I just added a dot :)
Original issue reported on code.google.com by [email protected]
on 11 Jun 2009 at 7:05
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.