Skip to content

Commit aa67ff2

Browse files
authored
Merge branch 'main' into bugfix/issue-11699
2 parents 19d5554 + 0ce5ced commit aa67ff2

File tree

10 files changed

+1051
-989
lines changed

10 files changed

+1051
-989
lines changed

news/changelog-1.7.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ All changes included in 1.7:
1111

1212
- ([#11654](https://github.com/quarto-dev/quarto-cli/issues/11654)): Allow `page-inset` as value in `column` key for code cells.
1313

14+
## Book Project
15+
16+
- ([#11520](https://github.com/quarto-dev/quarto-cli/issues/11520)): Book's cover image now escapes lightbox treatment, which was incorrectly applied to it when `lightbox: true` was set in the book's configuration.
17+
1418
## `quarto check`
1519

1620
- ([#11608](https://github.com/quarto-dev/quarto-cli/pull/11608)): Do not issue error message when calling `quarto check info`.
@@ -27,6 +31,7 @@ All changes included in 1.7:
2731
that allows to check whether a node is empty, i.e., whether it's an
2832
empty list, has no child nodes, and contains no text.
2933
- ([#11699](https://github.com/quarto-dev/quarto-cli/issues/11699)): Fix crash with `video` shortcode inside HTML comments.
34+
- Expose new `quarto.paths.tinytex_bin_dir` in Quarto's Lua API. If TinyTeX is found by Quarto, this will be set to the path to the `bin` directory of the TinyTeX installation where command line tool are located (e.g., `pdflatex`, `tlmgr`, etc.). If TinyTeX is not found, this will be `nil`, meaning Quarto will use the system PATH to find the command line tools.
3035

3136
## Other Fixes and Improvements
3237

src/command/render/filters.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ import { isServerShinyPython } from "../../core/render.ts";
9393
import { pythonExec } from "../../core/jupyter/exec.ts";
9494
import { kTocIndent } from "../../config/constants.ts";
9595
import { isWindows } from "../../deno_ral/platform.ts";
96+
import { tinyTexBinDir } from "../../tools/impl/tinytex-info.ts";
9697

9798
const kQuartoParams = "quarto-params";
9899

@@ -205,6 +206,7 @@ async function quartoEnvironmentParams(_options: PandocOptions) {
205206
return {
206207
"paths": {
207208
"Rscript": await rBinaryPath("Rscript"),
209+
"TinyTexBinDir": tinyTexBinDir(), // will be undefined if no tinytex found and quarto will look in PATH
208210
},
209211
};
210212
}

src/project/types/book/book-render.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ export function bookPandocRenderer(
173173
const title = file.recipe.format.metadata[kTitle] || "";
174174
const alt = coverImageAlt ? ` fig-alt="${coverImageAlt}"` : "";
175175
file.executeResult.markdown =
176-
`![](${coverImage} "${title}"){.quarto-cover-image${alt}}\n\n` +
176+
`![](${coverImage} "${title}"){.quarto-cover-image .nolightbox${alt}}\n\n` +
177177
file.executeResult.markdown;
178178
}
179179

src/resources/lua-types/quarto/paths.lua

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,9 @@ Returns the path to the `Rscript` file that Quarto itself would use in its knitr
77
]]
88
---@return string # Path to `Rscript` file
99
function quarto.paths.rscript() end
10+
11+
--[[
12+
Returns the path to the `TinyTeX` bin directory that `quarto install tinytex` installed to, or nil if not found.
13+
]]
14+
---@return string|nil # Path to `TinyTeX` bin directory
15+
function quarto.paths.tinytex_bin_dir() end

src/resources/pandoc/datadir/init.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2093,10 +2093,13 @@ quarto = {
20932093
add_to_blocks = utils.add_to_blocks,
20942094
},
20952095
paths = {
2096+
-- matches the path from `quartoEnvironmentParams` from src/command/render/filters.ts
20962097
rscript = function()
2097-
-- matches the path from `quartoEnvironmentParams` from src/command/render/filters.ts
20982098
return param('quarto-environment', nil).paths.Rscript
20992099
end,
2100+
tinytex_bin_dir = function()
2101+
return param('quarto-environment', nil).paths.TinyTexBinDir
2102+
end,
21002103
},
21012104
json = json,
21022105
base64 = base64,
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
/.quarto/
2+
/_book/
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
project:
2+
type: book
3+
4+
book:
5+
title: "mybook"
6+
author: "Norah Jones"
7+
date: "11/24/2024"
8+
cover-image: cover.png
9+
chapters:
10+
- index.qmd
11+
12+
format:
13+
html:
14+
theme: cosmo
15+
16+
lightbox: true
8.7 KB
Loading
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
_quarto:
3+
tests:
4+
html:
5+
ensureHtmlElements:
6+
- ['section#preface .quarto-cover-image']
7+
- ['.ligtbox > .quarto-cover-image']
8+
---
9+
10+
# Preface {.unnumbered}
11+
12+
This is a Quarto book. Cover image should not have Lightbox treatment in books when `lightbox: true`
13+
14+
To learn more about Quarto books visit <https://quarto.org/docs/books>.

0 commit comments

Comments
 (0)