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

Using \linewidth instead when converting img/table to latex #9775

Closed
zwz opened this issue May 20, 2024 · 2 comments
Closed

Using \linewidth instead when converting img/table to latex #9775

zwz opened this issue May 20, 2024 · 2 comments

Comments

@zwz
Copy link

zwz commented May 20, 2024

Describe your proposed improvement and the problem it solves.
When converting img/table with percentage width (in html) to latex, pandoc uses \textwidth or \columnwidth now, like

\includegraphics[width=0.4908\textwidth]{test.png}
\begin{longtable}[]{@{}
  >{\centering\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.3333}}
  >{\centering\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.3333}}
  >{\centering\arraybackslash}p{(\columnwidth - 4\tabcolsep) * \real{0.3333}}@{}}
...

It works perfect for most cases.
But when the img/table is in enumerate environment with items indented, it stretches out at the left side,
makes the text in the environment not so fluent and beautiful.

I googled and according to

  1. https://tex.stackexchange.com/questions/16942/difference-between-textwidth-linewidth-and-hsize
  2. https://tex.stackexchange.com/questions/124323/tabularx-within-the-enumerate-environment
  3. https://tex.stackexchange.com/questions/250662/width-of-minipages-inside-enumerate-environments

it seems a good idea to use \linewidth instead.

@jgm
Copy link
Owner

jgm commented May 20, 2024

Similar issues:
(for images) #9396
(for figures) #9268

Also relevant:
#9268

@jgm jgm closed this as completed in 7e7735b May 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants