Skip to content

Commit ed3eebd

Browse files
committed
paper format fixup
1 parent 1b45ae3 commit ed3eebd

File tree

2 files changed

+20
-6
lines changed

2 files changed

+20
-6
lines changed

cmake/dist.cmake

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
function(add_to_dist)
2+
set(local_dist_files ${dist_files})
3+
foreach(file ${ARGN})
4+
file(RELATIVE_PATH relative ${CMAKE_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${file})
5+
list(APPEND local_dist_files ${relative})
6+
endforeach()
7+
set (dist_files ${local_dist_files}
8+
CACHE INTERNAL "Files that will be included in the distribution tarball")
9+
endfunction()

cmake/pdf.cmake

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@ function (add_pdf_target docname lang entities figdir)
44
set(pdffile "${docname}.pdf")
55
file(GLOB figures "${CMAKE_CURRENT_SOURCE_DIR}/${figdir}/*.png")
66

7-
# Determine paper format depending on language
8-
# It's a pretty simple hack: only US or C will be set to letter. All others use A4.
9-
if (lang MATCHES ".*_us.*|C")
10-
set (XSLTFLAGS_FO "--stringparam paper.type letter")
11-
else()
12-
set (XSLTFLAGS_FO "--stringparam paper.type A4")
7+
# Determine paper format depending on language (which maps to the document's directory name)
8+
# * for language "C" (fallback language) determine paper format based on current locale
9+
# * for other languages, the will be set to letter. All others use A4.
10+
set (XSLTFLAGS_FO "--stringparam paper.type A4")
11+
if (lang STREQUAL "C")
12+
# For the fallback language determine paper format depending on locale
13+
# Only US or C will be set to letter. All others use A4.
14+
set (ENV_LANG $ENV{LANG})
15+
if (ENV_LANG AND ENV_LANG MATCHES ".*_us.*|C") # Replacing ENV_LANG here with if ($ENV{LANG}) won't work.
16+
set (XSLTFLAGS_FO "--stringparam paper.type letter")
17+
endif()
1318
endif()
1419

1520
add_custom_target("${lang}-${docname}-fo"

0 commit comments

Comments
 (0)