COMPGROUPS.NET | Search | Post Question | Groups | Stream | About | Register

### Print file name of figure below figure

• Email
• Follow

Hello,

this is a follow-up to the thread Print file name of figure in
margin'' started yesterday.

Now I'd like to output the file name below the inserted figure.  The
min. example shows how I'm trying to do this, but what I get is the file
name next to the figure, not below.

What I want:

-----------
|	  |
|         |
|         |
-----------
file name

What I get:
-----------
|	  |
|         |
|         |
-----------file name

What I do:

\documentclass{scrartcl}
\usepackage{graphicx}
\usepackage{marginnote}
\renewcommand*{\marginfont}{\tiny\sffamily}
\makeatletter
\let\old@Gin@setfile\Gin@setfile
\def\Gin@setfile#1#2#3{%
\old@Gin@setfile{#1}{#2}{#3}%
\begingroup
\edef\@tempa{#3}%
%
\expandafter\marginnote\expandafter{\expandafter\strip@prefix\meaning\@tempa}%

\expandafter\par\footnotesize\ttfamily\expandafter{\expandafter\strip@prefix\meaning\@tempa}%
\endgroup
}
\makeatother
\begin{document}
\includegraphics[scale=0.6]{JT00025102B}
\end{document}

Thanks!
Markus

 0

See related articles to this posting

On Wed, 03 Mar 2010 10:15:55 -0800, Markus Heller <hellerm2@gmail.com>
wrote:

>Hello,
>
>this is a follow-up to the thread Print file name of figure in
>margin'' started yesterday.
>
>What I want:
>
>-----------
>|	  |
>|         |
>|         |
>-----------
>file name
>
>What I get:
>-----------
>|	  |
>|         |
>|         |
>-----------file name
>
>What I do:
>
>\documentclass{scrartcl}
>\usepackage{graphicx}
>\usepackage{marginnote}
>\renewcommand*{\marginfont}{\tiny\sffamily}
>\makeatletter
>\let\old@Gin@setfile\Gin@setfile
>\def\Gin@setfile#1#2#3{%
>   \old@Gin@setfile{#1}{#2}{#3}%
>   \begingroup
>   \edef\@tempa{#3}%
>%
>\expandafter\marginnote\expandafter{\expandafter\strip@prefix\meaning\@tempa}%
>
>\expandafter\par\footnotesize\ttfamily\expandafter{\expandafter\strip@prefix\meaning\@tempa}%
>   \endgroup
>}
>\makeatother

I'd omit the \marginnote command an symply save the filename:
def\Gin@setfile#1#2#3{%
\old@Gin@setfile{#1}{#2}{#3}%
\begingroup
\edef\@tempa{#3}%
\@onelevel@sanitize\@tempa
\xdef\CurrentGraphicFileName{\@tempa}
\endgroup
}

This leaves the filename in \CurrentGraphicFileName
(with all its characters having \catcode 12), which
I would then place below the graphic, perhaps in
the caption:

\caption{\texttt{\CurrentGraphicFileName}\\ Rest of caption}

>\begin{document}
>\includegraphics[scale=0.6]{JT00025102B}
>\end{document}

If you don't float these then maybe use a tabular to get
the name under the graphic:

\begin{tabular}{c}
\includegraphics[scale=0.6]{JT00025102B}\\
\texttt{\CurrentGraphicsFileName}%
%You might then wish to undefine it
\global\let\CurrentGraphicsFileName\relax
\end{tabular}

Caveat: not tested, although I have done things like this.

Dan
To reply by email, change LookInSig to luecking

 0

On 3/3/2010 1:56 PM, Dan Luecking wrote:
> On Wed, 03 Mar 2010 10:15:55 -0800, Markus Heller<hellerm2@gmail.com>
> wrote:
>
>> Hello,
>>
>> this is a follow-up to the thread Print file name of figure in
>> margin'' started yesterday.
>>
>> What I want:
>>
>> -----------
>> |	  |
>> |         |
>> |         |
>> -----------
>> file name
>>
>> What I get:
>> -----------
>> |	  |
>> |         |
>> |         |
>> -----------file name
>>
>> What I do:
>>
>> \documentclass{scrartcl}
>> \usepackage{graphicx}
>> \usepackage{marginnote}
>> \renewcommand*{\marginfont}{\tiny\sffamily}
>> \makeatletter
>> \let\old@Gin@setfile\Gin@setfile
>> \def\Gin@setfile#1#2#3{%
>>    \old@Gin@setfile{#1}{#2}{#3}%
>>    \begingroup
>>    \edef\@tempa{#3}%
>> %
>> \expandafter\marginnote\expandafter{\expandafter\strip@prefix\meaning\@tempa}%
>>
>> \expandafter\par\footnotesize\ttfamily\expandafter{\expandafter\strip@prefix\meaning\@tempa}%
>>    \endgroup
>> }
>> \makeatother
>
> I'd omit the \marginnote command an symply save the filename:
> def\Gin@setfile#1#2#3{%
>     \old@Gin@setfile{#1}{#2}{#3}%
>     \begingroup
>       \edef\@tempa{#3}%
>       \@onelevel@sanitize\@tempa
>       \xdef\CurrentGraphicFileName{\@tempa}
>     \endgroup
> }
>
> This leaves the filename in \CurrentGraphicFileName
> (with all its characters having \catcode 12), which
> I would then place below the graphic, perhaps in
> the caption:
>
>    \caption{\texttt{\CurrentGraphicFileName}\\ Rest of caption}
>
>> \begin{document}
>> \includegraphics[scale=0.6]{JT00025102B}
>> \end{document}
>
> If you don't float these then maybe use a tabular to get
> the name under the graphic:
>
>    \begin{tabular}{c}
>      \includegraphics[scale=0.6]{JT00025102B}\\
>      \texttt{\CurrentGraphicsFileName}%
>    %You might then wish to undefine it
>      \global\let\CurrentGraphicsFileName\relax
>    \end{tabular}
>
> Caveat: not tested, although I have done things like this.
>
> Dan
> To reply by email, change LookInSig to luecking

Dan,

thanks a lot, this works like a charm!

Cheers
Markus

 0

2 Replies
181 Views

Similar Articles

12/20/2013 4:40:33 PM
page loaded in 58570 ms. (0)

Similar Artilces:

Print file name of figure in margin
Hello group, I would like to print the file name of all included figures into the margin or below the included figure. I know that the draft option does this, but I need to have *both* the figure *and* the file name in the document for referencing purposes. Gogole revealed the following solution in a thread started by M. Friendly back in 1999 (Message-ID of first posting: 7kld5g$lnh$1@sunburst.ccs.yorku.ca): \makeatletter \let\oldGinclude@graphics\Ginclude@graphics \def\Ginclude@graphics#1{% \oldGinclude@graphics{#1}% % \marginpar{\small#1}% \rlap{\small#1}% } ...

How to figure out font file from font name
Acrobat Reader tells me that a certain (PdfTeX generated) PDF file contains the following fonts: SFSS0900, SFSX1728, SFRM1000, SFTI1000, SFRM1095 and SFBX1095. I would like to know to what actual font files these rather terse names happen to refer to. How can I figure that out? (I cannot find any font files with these names in my own TeX font tree, but that is perhaps simply because I do not, at present, have these particular fonts installed on my system). Many thanks in advance for any ideas, Christian "Christian Stapfer" <nobody@nowhere.nil> schrieb im...

printing figures to emf files at set resolution
I have a code for printing figures to emf files using painter renderer at a set resolution. It was working all fine until I upgraded my machine. Now it's not printing at set resolution but at the actual figure size. I tried the code in other machines also but same results. I'm wondering how this works with the old machine (tried now also and it's working) code: %% set(gcf,'paperunits','inches',... 'papersize',[8.27,11.69],... 'paperposition',[0,0,8.27,11.69]) print(gcf,'filename','-dmeta','-r96','-pa...

Print figure to file under Linux extremely slow
R2009a 64-bit Linux CentOS5.2 on a Dell PowerEdge Server with 32GB RAM, logged in on LAN through FreeNX. Print a figure to a file is extremely slow and halts the entire GUI. tic; print -dtiff -r300 test.tif ; toc Elapsed time is 494.922810 seconds Printing to other image types is equally slow. Running with -nodesktop makes no difference. Running with -nodesktop -nosplash and DISPLAY="" gives a segfault when issuing the print command. On May 27, 9:21=A0am, Brendan <brendandetra...@yahoo.com> wrote: > R2009a 64-bit Linux CentOS5.2 on a Dell PowerEdge Server with 32GB >...

Saving figure file name as a function of input argument
Hi Folks, I'm new to Matlab, and have spent about 2 weeks working through the basics with a rather huge dataset from recent field work. As a caveat, I'll try to get the nomenclature right in this post, but I'm sure I'll mess up some terms. Sorry in advance, and please feel free to correct me if I'm using a term incorrectly, or describing a concept for which there is a simple term. Also, I've tried looking through the help file and forums, but I'm not quite equipped to search for this correctly--my searches come back with many results that are completely irreleva...

Figure Name and Figure Title
I am slowly (oh, so slowly) learning about handle graphics. I am now a bit confused about the 'Name' of a figure and the title of a figure. 'Name' is a property, and I can change it, for example, this way: set(H_figure1,'Name','Test #2') What about title? I know I can make a title this way: title('Test Program 2') But is it a property of a figure? (I think not.) Of axes? (I am not sure.) Can I change the title with a set command? To reply directly to me, replace all 'z' with 'a' in email address. "George" <g_czplzn...

How to change the name in Figure Name Property
As default, when we set the name parameter in figure handle to a string, the figure title becomes "Figure No. 1: <string>". Is there any way to remove Figure No.1 default characters? Thanks a lot Edwards Edwards: <SNIP does not like the figure's number... a hint: plot(1:10); set(gcf,'name','my pristine figure'); set(gcf,'number','off'); us "Edwards" <gangliu2001@msn.com> wrote in message news:eee972b.-1@webx.raydaftYaTP... > As default, when we set the name parameter in figure handle to a > str...

print -dmeta printing wrong figure
I'm trying to copy a figure that's been created by a GUI to the clipboard using print -dmeta. However, whenever I do this, the GUI gets copied to the clipboard instead. For example, if I do: figure(1) print -dmeta I'd expect to get figure one on the clipboard. But I don't. if I gcf, it shows up as 1. Interestingly enough, if I use print -dbitmap, gcf gets changed to the figure handle of the gui, (also, this handle seems to be a non-integer...), and the wrong figure gets copied. Ideas? Is this a bug? I'm on r2009b for reference. "Benjamin Lewis"...

printing file names that contain backslash (NT files)
I am writing a script to print the NT file names like the following: ----------------------- #!/bin/ksh cat tmp.log |while IFS== read -r name value do echo "name is " $name echo "value is "$value done ----------------------------- Sample Input file (tmp.log) looks like this: ----------------------- Container Name = e:\psft\db_prod\testdtai01.db2 Total Pages in Container = 128000 Container Name = e:\psft\db_prod\testdtai02.db2 Total Pages in Container = 128000 ---------------...

printing onto figures
Hey! I really really want to print out text and numbers onto my graphs and surface plots. Is this even possible? Thanks. On Jun 23, 8:24=A0am, "tommy Owen" <jesse9021...@hotmail.co.uk> wrote: > Hey! > > I really really want to print out text and numbers onto my graphs and sur= face plots. Is this even possible? > > Thanks. doc text doc gtext Good luck -Nathan Awesome, thank you. Nathan <ngreco32@gmail.com> wrote in message <9b9f79ea-a67d-4ef7-a1be-9cf360fa8db9@y6g2000prf.googlegroups.com>... > On Jun 23, 8:24?am, "tommy Owen...