Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

typst: width and height do not convert unitless numbers to inches #9945

Open
cscheid opened this issue Jul 3, 2024 · 1 comment
Open

typst: width and height do not convert unitless numbers to inches #9945

cscheid opened this issue Jul 3, 2024 · 1 comment
Labels

Comments

@cscheid
Copy link
Contributor

cscheid commented Jul 3, 2024

Explain the problem.

The typst writer doesn't automatically convert unitless dimensions to inches, but Typst doesn't like unitless dimensions. This behavior is inconsistent with (eg) the latex writer:

$ pandoc -f markdown -t typst
![](./foo.png){width=640 height=480}
^D
#box(image("./foo.png", height: 480, width: 640))
$ pandoc -f markdown -t latex
![](./foo.png){width=640 height=480}
^D
\includegraphics[width=6.66667in,height=5in]{./foo.png}

Pandoc version?

I used 3.2 and didn't see anything relevant on the 3.2.1 changelog (still compiling 3.2.1 locally...):

$ pandoc --version
pandoc 3.2
Features: +server +lua
Scripting engine: Lua 5.4
User data directory: /Users/cscheid/.local/share/pandoc
Copyright (C) 2006-2024 John MacFarlane. Web: https://pandoc.org
This is free software; see the source for copying conditions. There is no
warranty, not even for merchantability or fitness for a particular purpose.
@cscheid
Copy link
Contributor Author

cscheid commented Jul 3, 2024

I'd work on a PR, but apparently I can't get Pandoc to compile right now:

$ git pull origin main && cabal update && cabal build pandoc-cli
From github.com:jgm/pandoc
 * branch                main       -> FETCH_HEAD
Already up to date.
Downloading the latest package list from hackage.haskell.org
Package list of hackage.haskell.org is up to date.
The index-state is set to 2024-07-03T19:51:11Z.
Build profile: -w ghc-9.4.8 -O1
In order, the following will be built (use -v for more details):
 - pandoc-3.2.1 (lib) (first run)
 - pandoc-server-0.1.0.6 (lib) (first run)
 - pandoc-lua-engine-0.3 (lib) (first run)
 - pandoc-cli-3.2.1 (exe:pandoc) (first run)
Preprocessing library for pandoc-3.2.1..
Building library for pandoc-3.2.1..
[198 of 215] Compiling Text.Pandoc.Readers.TWiki

src/Text/Pandoc/Readers/TWiki.hs:19:40: error:
    Module ‘Data.Char’ does not export ‘isUpperCase’
   |
19 | import Data.Char (isAlphaNum, isDigit, isUpperCase, isLowerCase, isLetter)
   |                                        ^^^^^^^^^^^

src/Text/Pandoc/Readers/TWiki.hs:19:53: error:
    Module ‘Data.Char’ does not export ‘isLowerCase’
   |
19 | import Data.Char (isAlphaNum, isDigit, isUpperCase, isLowerCase, isLetter)
   |                                                     ^^^^^^^^^^^
Error: cabal: Failed to build pandoc-3.2.1 (which is required by exe:pandoc
from pandoc-cli-3.2.1).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant