[Therion] Tex-map code for passing variables

Martin Budaj m.budaj at gmail.com
Sat Feb 12 21:46:34 CET 2022


Hi,

I think the following should work:

1) use \loadpicture{\pathvar} in the shared thconfig file
2) define \pathvar macro in the 'code tex-map' section of the
customised thconfig file: \def\pathvar{yourfile.pdf}

Martin

On Tue, Feb 8, 2022 at 11:03 AM Nigel Cooke <nigel.cooke at bigpond.com> wrote:
>
> Good evening all,
>
>
>
> I am trying to pass a variable to the \loadpicture function in a tex-map code block. As part of a \def\maplayout{ } block, I am using this line of code :
>
> \legendbox{100}{-3}{NE}{\loadpicture{output/ShadesOfDeath_HallOfTheMountainKingLocation-p.pdf}} to place a picture in the map header. This works fine but I need to pass in the file path as a variable.
>
>
>
> To put it in context, I have a suite of maps, each of which has a small inset map as part of the header. The inset map gives an overview/location reference, much the same as the navigation panel in an atlas. The maps share a common layout block in a shared thconfig file. Parameters in the shared layout are populated with map specific information via Therion data and some variables (eg \cavename) that I set in a thconfig file customised for the specific map. I want to keep the common layout generic in case I need to change it in the future and to avoid having to update it in numerous files. What I'm trying to do with \loadpicture is select the picture that is the location overview for the specific map. I can do it using a hardcoded file path but I need it to work with a variable that contains the file path. I would then set the variable in the thconfig for a specific map. The layout command ‘map-image’ doesn't work because I have redefined the \maplayout macro in a tex-map code block.
>
>
>
> Is it possible to pass a file path in a variable to the \loadpicture function? If so, can anyone show me some code that would to do it? I’ve tried reusing an existing variable like \the\comment but that only produces a compile error. My Tex knowledge is limited so I am struggling with working out how to set this up. Also, if anyone knows of a better way to achieve the same result I’d be eternally grateful if you would share that knowledge.
>
>
>
> Thanks
>
>
>
> Nigel
>
>
>
>
>
> _______________________________________________
> Therion mailing list
> Therion at speleo.sk
> https://mailman.speleo.sk/listinfo/therion


More information about the Therion mailing list