LyXOwn graphic filter

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
Post Reply
tracktor_t
Posts: 2
Joined: Thu Feb 26, 2015 6:08 am

Own graphic filter

Post by tracktor_t »

Can I make a graphic filter?

I have a:

1) Format .asd
2) Converter (.asd to .png).

Can I add my graphics filter that will insert graphics format .asd?
How?

Now I do TeX insert:

Code: Select all

\includeMyFormat {D:\name.asd} {D:\name.png}
D:\name.asd - the original file
D:\name.png - the output of the converter

Code: Select all

Definition:
\def\includeMyFormat#1#2{
\justdoit{C:/TEXMFLOCAL/bin/myconverter.exe #1 #2}
\includegraphics{#2}
}
\def\justdoit#1{\immediate\write18{#1}}
What I want:

Code: Select all

\includegraphics{D:\name.asd}
As I understand \DeclareGraphicsRule - does not help in resolving this issue.


Sorry for bad english!

Thanks in advance!

Recommended reading 2024:

LaTeXguide.org • LaTeX-Cookbook.net • TikZ.org

NEW: TikZ book now 40% off at Amazon.com for a short time.

And: Currently, Packt sells ebooks for $4.99 each if you buy 5 of their over 1000 ebooks. If you choose only a single one, $9.99. How about combining 3 LaTeX books with Python, gnuplot, mathplotlib, Matlab, ChatGPT or other AI books? Epub and PDF. Bundle (3 books, add more for higher discount): https://packt.link/MDH5p

StarValkyrie
Posts: 89
Joined: Fri Jan 24, 2014 12:42 am

Re: Own graphic filter

Post by StarValkyrie »

Sorry, but I think you're already implementing what you need in the most efficient way. Or at least the only options I could think of that might get it working through LyX would just be a mess and even then you'd probably end up with it as a new environment in the pulldown menu, not working through the include graphics feature. What about what you're doing right now isn't working the way you want it to?
tracktor_t
Posts: 2
Joined: Thu Feb 26, 2015 6:08 am

Re: Own graphic filter

Post by tracktor_t »

StarValkyrie, thanks for the answer!


Not all users (users of lyx) know what a latex / tex.

What is the format .png for the user? - Picture!
What is the format .asd for the user? - Picture!

I want uniformity.

I want to work in the GUI:

Insert-> Graphics ...

What do I get?
1) the image must to display in my document
2) I can choose the scale, crop image in GUI
3) the lack of [s]incomprehensible[/s], [s]dark[/s], hard TeX insert =)

I was hoping that this is possible.

If this is not possible ...

Why the menu Tools->settings->File Handling ??

( or Tools->Preferences->File Handling->Converters)


I read the customization.lyx (help->customization : 3.1 Formats, 3.2 Copiers, 3.3 Converters),
but did not understand if I can solve my problem with this menu...

I do not want to do new environment in the pulldown menu.
I think it's very difficult... I'll do it for at least ten years! =)
StarValkyrie
Posts: 89
Joined: Fri Jan 24, 2014 12:42 am

Own graphic filter

Post by StarValkyrie »

Yeah, I can't think of a way to get it working through the image gui. There aren't any places in the GUI to input that kind of customization so that just ain't gonna happen. The file handling features you're talking about are to point LyX to the location of the scripts used by the Import/Export feature under the File menu which isn't what you're trying to do. You could maybe try turning on Instant Preview (http://wiki.lyx.org/LyX/InstantPreview.) and see if that puts the image in where you type ERT. Otherwise, what you're doing is already very clean and efficient.
scottkosty
Site Moderator
Posts: 542
Joined: Sat Sep 01, 2012 6:38 am

Re: Own graphic filter

Post by scottkosty »

If you want something that's more customizable, look at making your own external material template (which you would access via Insert > File > External Material). There is information about how to do this in the manuals (best also to look at the examples that LyX comes with).
Post Reply