Hot answers tagged

7 votes
Accepted

Adding latex to figures from Inkscape

Instead of using psfrag I would simply export the image as pdf+tex from inkscape. For example if your image looks like this in inkscape: you can save it as .pdf and select the option "omit text in ...
samcarter_is_at_topanswers.xyz's user avatar
5 votes
Accepted

How can I intercept postscript instructions in a file loaded with includegraphics?

For psfrag, tex doesn't access the file at all (except optionally looks to find a %%BoundingBox comment. It works by loading a PostScript header that redefines (within the scope of the EPS) the ...
David Carlisle's user avatar
5 votes
Accepted

Why does the ```\vspace``` command not work with PSfrag?

A psfrag replacement is essentially set in an \mbox so a horizontal mode construct. As always in such a construct, vertical mode material doesn't work, although you could nest a \parbox to get into ...
David Carlisle's user avatar
4 votes
Accepted

Can't get psfrag to replace text in pdf

In comments you added the relevant PostScript code: (Classifiers) [9.36057 3.95929 6.24078 5.51782 5.51782 3.95929 4.68082 3.95929 6.12003 4.68085 0 ] xsh xsh will be a defined alias in the file ...
David Carlisle's user avatar
4 votes
Accepted

Issues with \psfrag, pdflatex in beamer

As the error shows \psfrag has not been defined. You can use pstool to automate this to a certain extent eg this runs without error \documentclass{beamer} \usepackage{lmodern} \usepackage{tikz} \...
David Carlisle's user avatar
4 votes

chemnum: compounds numbers don't replace TMP at the right position in .eps file (chemdraw)

The results you are seeing come from not compiling the document file correctly. The following workflow will provide a pdf file with the labels replaced latex file dvips file -o pstopdf file.ps The ...
Andrew Swann's user avatar
  • 95.5k
3 votes

Can I add a label to a figure that shows up next to the figure?

Chemfig/Chemnum route Probably not the wisest choice to use chemfig, but just showing that it's possible. You would want to use the package chemnum for labelling of the molecules. It offers (among ...
Troy's user avatar
  • 13.7k
3 votes

How to use \psfrag with Simulink?

This is just a long comment about doing the drawing in tikz instead. Here are some starting points given without comments, most is explained in the tikz manual, plus there are loads and loads of tikz ...
daleif's user avatar
  • 54.1k
3 votes

What does psfrag do, and can it be made to work with pdflatex?

To use psfrag with pdflatex, the first things is to make pdflatex -synctex=1 -interaction=nonstopmode --shell-escape %.tex In pdflatex compelation you should be add "--shell-escape %.tex" ...
BOSKRI Abdelkarim's user avatar
3 votes

Hide/Replace labels with foreach

The issue is that \psfrag works within the scope of the environment in which the \psfrag command is used. With \foreach a new scope is created for every item in the list, therefore the \psfrag ...
Marijn's user avatar
  • 37.2k
3 votes

filemoddate in xetex

\filemoddate was added to xetex in the 2019 release, so if you have an up to date system the example runs without error (although I tested with a different font and eps file). It may be possible to ...
David Carlisle's user avatar
2 votes
Accepted

Using pstool with LuaLaTeX

To my knowledge psfrag/pstool is indeed calling pdfLaTeX to do the ps-magic. The problem why your code is not working is the fact that neither polyglossia (as it internally loads fontspec) nor ...
lcnittl's user avatar
  • 343
2 votes

How to get `psfragfig` with sibling or super directories on windows?

This feature (not to call it an issue) is pointed out in pstool-package-Documentation in CTAN: One problem that pstool does not solve on its own is the inclusion of images that do not exist in ...
rasha's user avatar
  • 704
2 votes

psfrag equivalent for pdflatex

It's an old question and I'm not sure if this is an alternative in all the aspects, but it may be interesting to add the following: I was able to do the replacement using the package pstool and the ...
altroware's user avatar
  • 141
2 votes

Overfull \hbox warning - two plots side-by-side

The construction on the line that contains your two sub-figures consist of elements that have the following widths: A minipage of width 0.49\textwidth; An inter-word space between the first minipage ...
Werner's user avatar
  • 602k
2 votes
Accepted

standalone not working with psfrag

Add \usepackage[nosetpagesize]{graphics} \documentclass{standalone} \usepackage[nosetpagesize]{graphics} \usepackage{psfrag} \begin{document} text \end{document} See also this bug report https://...
Ulrike Fischer's user avatar
2 votes
Accepted

Issue with graphicx and auto-pst-pdf

Ah, I think this should work... \documentclass{report} \usepackage{psfrag} \usepackage[runs=2, crop=off]{auto-pst-pdf} \usepackage{graphicx} \makeatletter \def\Gin@extensions{% .png,.pdf,....
David Carlisle's user avatar
2 votes

Can chemnum replace TMP-Tags in any eps file, e.g. Origin? If so, how?

The real question is: can psfrag replace text in EPS files created by Origin? chemnum doesn't do any anything with the EPS file. Instead it loads psfrag and passes the task to its \psfrag{eps text}{...
cgnieder's user avatar
  • 66.5k
2 votes

Trying to find a simple example of pstool that compiles

note that you need pdflatex --shell-escape to enable the psfrag processing. When running your MWE the log complained of missing packages so I added tikz and its calc library then it worked as ...
David Carlisle's user avatar
2 votes
Accepted

Matlabfrag figure in latex

This is not a tested solution, but just the translation of an answer on de.comp.text.tex to a similar problem (at least generating the same error). The error is generated by matlabfrag-pstool.tex: ...
gernot's user avatar
  • 49.4k
2 votes

Can I add a label to a figure that shows up next to the figure?

I had to tweak the widths to get the subcaptions to fit. \documentclass{report} \usepackage[utf8]{inputenc} \usepackage{geometry} \geometry{letterpaper, margin = 1in} \usepackage{newfloat} \...
John Kormylo's user avatar
  • 79.3k
2 votes
Accepted

Psfrag does not replace the tag more than one symbol

Psfrag can only replace strings that appear as literal strings in the PostScript, if you use a typesetting application that adds kerns, so positions each letter individually then multi-letter strings ...
David Carlisle's user avatar
2 votes

Enlarge font size eps figure

Just the idea: \documentclass{article} \usepackage[utf8]{inputenc} \usepackage{tikz} \usepackage{float} \usepackage{subfig} \begin{document} \begin{figure}[H] \centering \...
koleygr's user avatar
  • 20.1k
2 votes

why is pstool-psfrag reducing pdf file size?

As an experiment, I downloaded an AI vector file. Technology of the 90s: size 2.032KB. Then I opened it in AI and exported it in PDF and SVG formats: sizes of formats were reduced: PDF is 1,478KB and ...
J Leon V.'s user avatar
  • 11.1k
2 votes
Accepted

Change tag by equation using psfrag

psfrag requires you to compile your document using LaTeX. Forcefully change this as part of your project settings in Overleaf to choose the "LaTeX dvipdf" LaTeX engine: Then your compilation yields ...
Werner's user avatar
  • 602k
2 votes

Trouble with psfrag and Mathematica's eps-images

Just for the fun of it here is a drawing of this in tikz. I was mainly done by tracing your EPS. \documentclass[tikz]{standalone} \usetikzlibrary{calc} \begin{document} \begin{tikzpicture} % \node[...
daleif's user avatar
  • 54.1k
2 votes
Accepted

PSfrags not working

The Tj operator (which will be defined in the EPS header) is implementing the PDF operator of the same name, and probably is defined in terms of xshow (which shows a PostScript string while applying ...
David Carlisle's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible