Association section entry with filename only

English support forum

Moderators: Hacker, petermad, Stefan2, white

Post Reply
Profane0360
Junior Member
Junior Member
Posts: 37
Joined: 2023-08-31, 20:08 UTC

Association section entry with filename only

Post by *Profane0360 »

Hello,

I am trying to set [Association] entries to work in TC with TeXLive. I need to run the right commands with the filename (without extension) as parameter. Can I do that right in the Filter1_open= line? If I use

Filter1_pdflatex=pdflatex "%1"

it uses the the filename.extension combination. Can I modify the "%1" part to use only the filename part? Thank you
#155067 Personal licence (March 2007)
Fla$her
Power Member
Power Member
Posts: 2985
Joined: 2020-01-18, 04:03 UTC

Re: Association section entry with filename only

Post by *Fla$her »

Filter1=basename.
Filter1=left*.
Filter1=*right.
Filter1=*.
Overquoting is evil! 👎
Profane0360
Junior Member
Junior Member
Posts: 37
Joined: 2023-08-31, 20:08 UTC

Re: Association section entry with filename only

Post by *Profane0360 »

I am sorry, that is not what I mean. Thank you for your help.

The association should work on files like filename.tex, but the command run by this association should use as parameter the filename only, not the filename plus extension. Of course, hiding this inside a batch file works.
#155067 Personal licence (March 2007)
Profane0360
Junior Member
Junior Member
Posts: 37
Joined: 2023-08-31, 20:08 UTC

Re: Association section entry with filename only

Post by *Profane0360 »

No, that one was the first to check and these modifiers do not work in filters. I thought about embedding that call in a different call somehow, to avoid a separate batch file here... %~n1 is understood by the shell. TC does not understand it. And it looks like the "%1" part is interpreted by TC not the shell.
#155067 Personal licence (March 2007)
User avatar
white
Power Member
Power Member
Posts: 5753
Joined: 2003-11-19, 08:16 UTC
Location: Netherlands

Re: Association section entry with filename only

Post by *white »

Create a user-defined command em_pdflatex for the pdflatex program and

create internal association and use command: ***em_pdflatex
and use %O in the parameter field of the em_pdflatex command

or

create internal association and use command: ***em_pdflatex %1
and use (for example) %A:~-0,1024 in the parameter field of the em_pdflatex command
Profane0360
Junior Member
Junior Member
Posts: 37
Joined: 2023-08-31, 20:08 UTC

Re: Association section entry with filename only

Post by *Profane0360 »

Great! Thank you very much indeed!
#155067 Personal licence (March 2007)
Post Reply