I have a program that generates a variable number of pictures, ordered like that: 1.jpg, 2.jpg [...] 10.jpg..etc  I can't use *.jpg as input because the 10 will be processed before 2, 3, etc. so I want to use:  convert page_{1..$N}.jpg out.pdf   but does not work. How should the command be?
4389
I want to use $var in a shell brace expansion with a range, in bash. Simply putting {$var1..$var2} doesn't work, so I went "lateral"...   The following works, but it's a bit kludgey.    # remove the split files echo rm foo.{$ext0..$extN} rm-segments &gt; rm-segments source rm-segments   Is there a more "normal" way?
33934
My goal is to combine several documents into one, so maybe someone can recommend a different solution. More specifically, I need to input about 20 files in a master file, all from line 4 to the second-to-last line, inclusive (I am excluding the \documentclass tag, an \input{header} tag, and \begin and \end{document} tags).  I would like to have a command, very similar to @mpg's , except where the second number is relative to the number of lines in the file. For instance, something like   \partialinput{4}{-1}{pitest}   would be great. Or maybe  \partialinput{4}{\linenumber{pitest}-1}{pitest}    or similar (where \linenumber could be some command that gets the number of lines in the argument file). I would prefer not to use `subfiles', as that would require changing all the headers of the individual files. So, my questions are,   Is there a command that gives back the number of lines in another file, or Can the \partialinput command be modified to include all but the last line in a document?   I'm not very proficient at TeX or e-TeX, so the structure of the \partialinput command is not clear to me. I initially thought that making the counter look one line ahead and stop when it reaches the end would do it, but again, I don't know enough TeX to make that happen.
39647
Have got about 500 PDFs to go through and extract the first page of.  They then need to go through some time consuming conversion process so was hoping to try and save some time by have a batch process to extract just the first page from the 500 pdfs and place it in a new pdf.  Have had a poke around Acrobat but can find no real method of doing this for multiple files.  Does anyone know any other programs or methods that this could be achieved?  Free and open source are obviously more favourable :)  EDIT:  Have actually had some success using GhostScript to extract just one page.  Am now looking at how to batch that and take the list of files and use those.
111551
I have found a nicely working script to convert pdf files into txt format, with ocr.   But it converts only one pdf file each time. I need to mass-convert them.   I have no knowledge of script writing. The script is at below.   How can I mass convert them?  #!/bin/bash  ## script to: ##   *  split a PDF up by pages ##   *  convert them to an image format ##   *  read the text from each page ##   *  concatenate the pages   ## pass name of PDF file to script INFILE=$1  ## split PDF file into pages, resulting files will be ## numbered: pg_0001.pdf  pg_0002.pdf  pg_0003.pdf pdftk $INFILE burst  for i in pg*.pdf ; do      ## convert it to a PNG image file     convert -density 200 -quality 100 $i ${i%.pdf}.png      ## read text from each page     tesseract ${i%.pdf}.png ${i%.pdf}.txt  done  ## concatenate the pages into a single text file cat pg*.txt &gt; ${INFILE%.pdf}.txt  exit   Note: I have read the similar questions but couldn't figure it out.
20405
All of my images are in a single folder which are in excess of 1.6K. I want to make a batch of 30 images from the folder, and copy that batch over to its respective separate folder. The names of these folders can be anything, like folder1, folder2, fodler3, and so on. I have no idea how to approach the problem. I thought about writing a Python script to copy the files one by one and, as soon as the count reaches 30, change the folder. But I thought that maybe you guys have a better idea on how to do it with Bash.
87415
I have a set of pictures in my working directory and I want to make a PDF report using these images. I want to include all of them, but the number of the pictures changes in each case. I would like to make a "for" loop to insert each picture one after the other sequentially. Can anyone help me? At the moment the code I have is the following:   \begin{figure}[h!] \begin{centering} \includegraphics[width=10cm,height=10cm]{Figure1.png} \caption[Sèries temporals de vent i direccions]{Sèries temporals velocitat de vent i     direccions. filtratge de pics i glaçades de velocitat.} \label{Serie} \end{centering}  \end{figure}   I would like to do it for every .png image in the directory. Thanks for your questions: I am using Windows 7 and the file names follow the pattern Figura1.png, Figura2.png and so forth. So which of these possibilities would fit best?
52585
I have a bunch of text files, images and pdf files which I want to convert into a single pdf file. How do I do it?
39130
Is there a way, maybe a script, that would help me cut an image into say 50 images?  I have a massive panorama I would like to print on normal stock photo paper and I am using Photoshop.    The output of this operation needs to be images, not PDFs, not printer. There is still work to be done with each of these cut-outs later.  How can I slice a large image into many smaller images with an automated, or relatively fast method?
31534
I'd like to be able to create a TeX file that will output multiple PDF files with one compilation.  I'm not even sure if this is possible.  Here is the setup:  I am writing dozens of cover letters for job applications, and wish for them to all look "personalized".  So I defined a function which calls multiple variables, such as the address, name of the institution, open position, etc., and outputs a "personalized" cover letter for each function call.  The problem is that compilation of the TeX file outputs just one file.  Since I will be submitting all of these files online eventually, I would like each letter to be in its own file.  Is there a way to do this at the TeX level?
86513
In order to separate the content structure from the style, I decided to implement commands for denoting random variables:  \newcommand{\myrv}[1]{\mathbf{#1}} \newcommand{\rvA}{\myrv{A}} \newcommand{\rvB}{\myrv{B}} \newcommand{\rvC}{\myrv{C}} ...   This way, if I ever decide to change the style of random variables from \mathbf to say \mathbb, all I need to do is to change the definition of \myrv. Is a way to generate the commands \rvA, \rvB, \rvC, ... automatically?
85220
I have a directory of files such as:  file.1.png file.2.png … file.10.png … file.1000.png file.1001.png …   How can I pad the number to 4 digits? It should end up like this:  file.0001.png file.0002.png … file.0010.png … file.1000.png file.1001.png …
36975
I have a PDF file with multiple figures; each figure is a separate page in the PDF file.  I am using pdflatex, and I would like to use \includegraphics or equivalent to include some of the figures.  Of course I could use an external tool to split the PDF file into multiple one-page PDF files. Then I could use \includegraphics as usual. However, I would have a much simpler workflow if I could avoid this extra step. Hence the question:  How can I include, e.g., page 3 of foo.pdf as a figure?  I am aware that there is a Latex package called pdfpages, but it seems to be designed for something else: with pdfpages, each page in the input file will produce a full page in the final document, not just a box.
43969
A commonly asked question on this site is how to embed images directly in a .tex source file, without the need for the image to exist in a separate file. Examples of such questions (often marked as duplicate) are         ...   Unfortunately, the answers are all quite a bit outdated. In particular,    Many users responded (years ago) that "the user should simply not want this" and send multiple files as a zip/tar archive instead. However, in this time and age where automatic generation of .tex file becomes more frequent, and single-file text-only generation is much easier (especially when using predefined frameworks) than multifile and/or binary, that argument no longer holds. A package providing such functionality  no longer exists. Another package  provides this functionality but only for bitmap images (png/jpg), not for svg/eps/pdf/other vector formats, and encodes it as HEX which is pretty wasteful compared to base64.   Therefore I would like to reopen this question and ask this again: how can one create a command \includebase64image such that   \includebase64image{png}{iVBORw0KGgokIA...} \includebase64image{pdf}{weEGE2ewFWE58q...}   yields the result of \includegraphicx{a file with content type #1 and contents #2}, namely the image whose content and type are given, appearing at the current location in the generated PDF file?
91419
I'm trying to tidy-up my photos which are, for various historic reasons, scattered all over my system. To enable me to make a start on this task, I've been trying to use the command line to construct a list of all directories that contain one or more jpg files.  I'm certain that I don't have to be concerned about looking for other image file formats, but I do have to allow for jpg appearing in upper and lower case.  I'd like each directory name to appear only once in the final list.  To provide an example, if I have the following directories each of which contain one or more jpg or JPG files....  ~Mike/Pictures ~Mike/Pictures/London/Olympics ~Mike/Pictures/London ~Mike/Pictures/London/Holiday ~Mike/Photos ~Mike/Family History/Swaine   I'd like the results to appear with each directory listed only once - irrespective of the number of image files it might contain - preferably sorted and then written to a file  ~Mike/Family History/Swaine ~Mike/Photos ~Mike/Pictures ~Mike/Pictures/London ~Mike/Pictures/London/Holiday ~Mike/Pictures/London/Olympics   My command line skills are just not up to this!  I can use a lot of the simpler forms of single commands, but once they get complex and/or have to be piped things tend to go wrong.
49090
I wish to recursively go through the folders of a directory structure and copy any .jpg I find into another directory.  I think I had the wrong idea with:  cp -R photos/*.jpg /cpjpg   How can I do this from the command line in Ubuntu?
68897
How do I create a file in windows from where LaTex can extract the pdf or Jpg file I want to insert in my document? In other words I need an example of inserting either images or pdf files in my document Here's the image I want to insert    The Image will be placed center to the page just beneath this codes  \[ \overline \rho = \overline P + 0.645 \Big (\frac { \overline P}{K}\Big) ^{\frac {3}{4}} \tag { Tazkera} \]
16056
I have a ton of files, all named stuff like 1.jpg, 2.jpg, 3.jpg, and so on up to 1439.jpg, however, I have a problem with one of my projects and alphabetizing. It will usually go in the order 1.jpg, 10.jpg, 11.jpg and so on.  What I need is some way to name the files so they are in the format such as 00001.jpg all the way up to 01439.jpg.  How would I be able to do this quickly and efficiently?