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

Minipages ignored when converting from LaTeX #10266

Closed
mechanical-girl opened this issue Oct 6, 2024 · 1 comment
Closed

Minipages ignored when converting from LaTeX #10266

mechanical-girl opened this issue Oct 6, 2024 · 1 comment
Labels

Comments

@mechanical-girl
Copy link

mechanical-girl commented Oct 6, 2024

Explain the problem.
Given the MWE input file

\begin{document}
\begin{center}
	\begin{minipage}{0.5\textwidth}
		\indent The logarithm of a particular exponent can be thought of as "undoing" the exponential. For some $a$ and $b$ where $a>0$ and $b>0$, $a^x=b$ if and only if $\log_a(b)=x$. This number $x$ is called the logarithm of $b$ to base $a$.
		\indent $y=e^x$ is the inverse of $\ln y = x$. Thus, if $y=5e^{4x-1}$, $x=0.25(\ln (0.2y)+1)$.
	\end{minipage}
	\begin{minipage}{0.45\textwidth}
		\begin{align*}
			y=2^x    & \leftrightarrow & \log_{2}y  = x \\
			y=3^x    & \leftrightarrow & \log_{3}y = x  \\
			y = 10^x & \leftrightarrow & \log_{10}y = x \\
			         &                 & \log y = x     \\
			y = e^x  & \leftrightarrow & \log_e y = x   \\
			         &                 & \ln y = x
		\end{align*}
	\end{minipage}
\end{center}
\end{document}

and the command pandoc -s -t native test.tex, the output generated seems to completely ignore the minipage environment:

  Meta { unMeta = fromList [] }
  [ Div
      ( "" , [ "center" ] , [] )
      [ Para
          [ Str "The"
          , Space
          , Str "logarithm"
          , Space
          , Str "of"
          , Space
          , Str "a"
          , Space
          , Str "particular"
          , Space
          , Str "exponent"
          , Space
          , Str "can"
          , Space
          , Str "be"
          , Space
          , Str "thought"
          , Space
          , Str "of"
          , Space
          , Str "as"
          , Space
          , Str "\"undoing\""
          , Space
          , Str "the"
          , Space
          , Str "exponential."
          , Space
          , Str "For"
          , Space
          , Str "some"
          , Space
          , Math InlineMath "a"
          , Space
          , Str "and"
          , Space
          , Math InlineMath "b"
          , Space
          , Str "where"
          , Space
          , Math InlineMath "a>0"
          , Space
          , Str "and"
          , Space
          , Math InlineMath "b>0"
          , Str ","
          , Space
          , Math InlineMath "a^x=b"
          , Space
          , Str "if"
          , Space
          , Str "and"
          , Space
          , Str "only"
          , Space
          , Str "if"
          , Space
          , Math InlineMath "\\log_a(b)=x"
          , Str "."
          , Space
          , Str "This"
          , Space
          , Str "number"
          , Space
          , Math InlineMath "x"
          , Space
          , Str "is"
          , Space
          , Str "called"
          , Space
          , Str "the"
          , Space
          , Str "logarithm"
          , Space
          , Str "of"
          , Space
          , Math InlineMath "b"
          , Space
          , Str "to"
          , Space
          , Str "base"
          , Space
          , Math InlineMath "a"
          , Str "."
          ]
      , Para
          [ Math InlineMath "y=e^x"
          , Space
          , Str "is"
          , Space
          , Str "the"
          , Space
          , Str "inverse"
          , Space
          , Str "of"
          , Space
          , Math InlineMath "\\ln y = x"
          , Str "."
          , Space
          , Str "Thus,"
          , Space
          , Str "if"
          , Space
          , Math InlineMath "y=5e^{4x-1}"
          , Str ","
          , Space
          , Math InlineMath "x=0.25(\\ln (0.2y)+1)"
          , Str "."
          ]
      , Para
          [ Math
              DisplayMath
              "\\begin{aligned}\n            y=2^x    & \\leftrightarrow & \\log_{2}y  = x \\\\\n            y=3^x    & \\leftrightarrow & \\log_{3}y = x  \\\\\n            y = 10^x & \\leftrightarrow & \\log_{10}y = x \\\\\n                     &                 & \\log y = x     \\\\\n            y = e^x  & \\leftrightarrow & \\log_e y = x   \\\\\n                     &                 & \\ln y = x\n        \n\\end{aligned}"
          ]
      ]
  ]

This then becomes an issue for layout when converting to other formats. I would expect to see something like

...
[ Div
      ( "" , [ "center" ] , [] )
     [Div
        ("", ["minipage"], [])
          [ Para
              [ Str "The"
              , Space
              , Str "logarithm"
              , Space
...

Pandoc version?
pandoc -v reports

pandoc 3.4
Features: +server +lua
Scripting engine: Lua 5.4

on MacOS Sonoma 14.3.

@jgm
Copy link
Owner

jgm commented Oct 7, 2024

Yes, I agree, putting this in a marked Div seems a good idea.

@jgm jgm closed this as completed in d66f6e9 Oct 25, 2024
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

2 participants