I have a .qgs file with a number of fairly complex styling rules showing the local Nordic ski trails. It has a single layout for printing on an 11x17 page.

Until now the same PDF has been used for both paper and digital map products. I would like to change this and produce separate paper-only and digital-only PDFs as some design features are better suited to paper than digital. For example an inset map is useful on paper, to provide sufficient detail in a particularly complex trail section, and it's easy for a user's eyes to switch between different parts of the print. However in digital form it's tedious to zoom out, pan, and zoom in when comparing the main map and the inset map. Also because zooming is possible in digital I can get away with using a much smaller font size.

The only difference in the digital-only .qgs file would be the font size in a few labelling rules. If possible I want to avoid creating (and then maintaining) a completely separate .qgs file just for these minor changes.

Is there any way I can incorporate the layout name into an expression? For example use font size A when generating the paper-only layout, font size B when generating the digital-only layout, and default to one or the other when simply viewing the map in QGIS. I looked through the options in the expression dialog but I can't see anything that looks like it would give me a layout name.

1 Answer 1


There is an expression variable @layout_name which contains the name of the current layout.

  • Thanks! But how did you know about this? layout_name is not listed under "variables" in the expression builder in 3.4.2
    – tomfumb
    Dec 27, 2018 at 16:22
  • 2
    If you click on a map item in the layout designer and open its properties panel, you'll see a list of "variables". All these variables will be available when that map item is being rendered.
    – ndawson
    Dec 27, 2018 at 19:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.