Skip to content

Commit

Permalink
Pandoc3.2.1以降の画像埋め込み対応
Browse files Browse the repository at this point in the history
  • Loading branch information
Till0196 committed Nov 14, 2024
1 parent f7db6ad commit 4def09b
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions articles/hinagata-markdown/word-template.latex
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,19 @@
% ここに\usepackageなどを書いても無意味です。
% リポジトリ直下のmain.texに書きましょう。

% Pandoc3.2.1以降の画像埋め込み対応
\makeatletter
\newsavebox\pandoc@box
\newcommand*\pandocbounded[1]{% scales image to fit in text height/width
\sbox\pandoc@box{#1}%
\Gscale@div\@tempa{\textheight}{\dimexpr\ht\pandoc@box+\dp\pandoc@box\relax}%
\Gscale@div\@tempb{\linewidth}{\wd\pandoc@box}%
\ifdim\@tempb\p@<\@tempa\p@\let\@tempa\@tempb\fi% select the smaller of both
\ifdim\@tempa\p@<\p@\scalebox{\@tempa}{\usebox\pandoc@box}%
\else\usebox{\pandoc@box}%
\fi%
}

\begin{document}

\lstset{
Expand Down

0 comments on commit 4def09b

Please sign in to comment.