PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, July 29, 2022

[FIXED] How to size and position all images in a markdownfile with pandoc/latex?

 July 29, 2022     image, latex, markdown, pandoc, pdflatex     No comments   

Issue

i am looking for a way to resize all images in an existing markdown file e.g. i want all pictures to have a max width of 80% of the textblock width and have all the images centered and bordered. How do I do this and is there a way to customize borders, e.g. colors and width of that border?

This is an example of my markdown file:

# section
## subsection
### subsubsection



![dummy1](.\dummy1.jpg)

Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting.

![dummy2](.\dummy2.png)



| Eigenschaft |             Typ             | Beschreibung                                                 |
| :---------: | :-------------------------: | :----------------------------------------------------------- |
|  `general`  | `object` <br/> *(optional)* | Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. |
|   `esri`    | `object` <br/> *(optional)* | Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. |
|  `webgen`   | `object` <br/> *(optional)* | Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. |

using pandoc and this shell script:

pandoc "$1" \
    -f gfm \
    --include-in-header chapter_break.tex \
    --highlight-style pygments\
    -V linkcolor:blue \
    -V geometry:a4paper \
    -V geometry:margin=2cm \
    -V mainfont="Arial" \
    -V monofont="Arial" \
    -o "$2"

and this tex file

\usepackage{sectsty}
\sectionfont{\clearpage}

i get this result

page 1

page 2

I am looking for a way using pandoc shellscript to get all pictures width scaled down to 80% text width.

Also I am looking for a solution to get the tabled formatted in the right way as its width is not right. But still using the

\usepackage{sectsty}
\sectionfont{\clearpage}

tex file. Thank you alot for your help!


Solution

You can change the default with of the images using \setkeys{Gin}{width=.8\linewidth} and boarders can be added with the floatrow package:

\usepackage{sectsty}
\sectionfont{\clearpage}

\usepackage{floatrow}
\floatsetup[figure]{style=boxed} 

\setkeys{Gin}{width=.8\linewidth}

enter image description here

(please only ask one question per question. You can ask a new question for the unrelated problem about the table)



Answered By - samcarter_is_at_topanswers.xyz
Answer Checked By - Dawn Plyler (PHPFixing Volunteer)
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing