The mwe Package
Martin Scharrer
martin@scharrer-online.de
CTAN:http://www.ctan.org/pkg/mwe
VC:https://bitbucket.org/martin_scharrer/mwe
Version v0.3 – 2012/05/15
Abstract
ThemweCTANpackagecomeswithasmallL
A
T
E
Xpackagewhichloads
packages commonlyusedtocreateminimalworkingexamples(MWEs)
and with a collection of dummy images. The ideais that this images
are installed in the TEXMF tree in a way where they are accessible by
any document. Then MWEs with images can be shared by multiple
userswithouttheneedofimagereplacementcodeorthedummyoptionof
graphicx.
1 Introduction and Motivation
L
A
T
E
X has a large online-community and people can find a lot of help from
otherusersonplaceslikecomp.text.texorhttp://tex.stackexchange.com/. In
manycases the userwiththeproblemisrequiredtopost acodeexamplewhich
showstheuse-case, butnothingunrelated,andshouldbecompilableby other
peoplewithout extraeffort. Suchanexample is oftencalledaminimalworking
example(MWE),orsometimesonlyminimalexample. Userscanusethisexample
documenttotestif theissuealsooccursintheirL
A
T
E
Xinstallationandeasily
implementandtestsolutions. If asolutionisfoundthemodifiedexamplecan
be postedback tothe original user. Forgeneralquestionslike‘How to do X’,
answersoftencreateanexample document bythemselves.
There are somepackageswhicharevery usefulfor MWEs(andmostlyonly
forthese), likethelipsumandblindtextpackages. Bothproducedummytext
inthe documentwhichisrequiredto produce realistic scenariosfore.g.float
placementetc. Thisfreesthe userfrom typingorcopyinglargerdummytexts
byhimself,whichwouldalsoincreasethesizeof the exampleandmake itless
readable. Themwepackageloadssuchpackagesandallowsforafurtherreduction
of theMWE document size.
A problem withsharing MWEsappears if image filesare includedinthe
document(e.g.\includegraphics,figureenvironmentsetc.). Oftentheimage
isreplacedwithareplacementcodelike\rule{hwidthi}{hheighti} or thedemo
optionofgraphicx isusedtoreplacetheimage withanempty framewithout
tryingtoreadthegivenimagefile. Bothofthesemethodsarealittlecumbersome
1
Convert pdf to word searchable text - SDK Library API:C# PDF Convert to Text SDK: Convert PDF to txt files in C#.net, ASP.NET MVC, WinForms, WPF application
C# PDF to Text (TXT) Converting Library to Convert PDF to Text
www.rasteredge.com
Convert pdf to word searchable text - SDK Library API:VB.NET PDF Convert to Text SDK: Convert PDF to txt files in vb.net, ASP.NET MVC, WinForms, WPF application
VB.NET Guide and Sample Codes to Convert PDF to Text in .NET Project
www.rasteredge.com
andhaveotherissues. Foronce,anexplanationfor newusers mustbeaddedto
replacethe code withareal\includegraphics ortoremovethedemooption
fortheirfinaldocument. Anotherissuemightarise whentheexample requires
specificimage optionslike scalingorcropping,whichmightnotbeeasilyand
completelybereplicatedwiththesereplacements. Also,thecompiledresult will
looklessthananormaldocument withrealimages.
Toovercomethesedrawbacks severalrealdummy imageswithdifferentsizes,
ratios andformatsareprovidedwiththispackage. Onceinstalledinthecorrect
directory intheTEXMF treethey willbeavailabletoalldocuments. Thisway a
usercancompile anyMWEgiventohimbyanotherperson whichusesthese
image files without requiring code replacementsorsharingimages. The mwe,
whichloadsgraphicx,canbeusedtominimisethepreamble,butisnotrequired
tobe loadedinorder tousetheimages.
Itshouldbe notedthatthemaincontributionofthisCTANpackageis, at
leastatthemoment,theprovideddemo/testimagefiles. ThemweLAT
E
Xpackage
is(inhiscurrentform) just anaddition.
2 Usage
Theprovidedimagefilescanbeincludedasnormalusingi.e.usingthegraphicx
package andits\includegraphics[hoptionsi]{hfilenamei} macro. They are
alsoprovidedinsourcecodeform(.texfiles)andcanbeincludedinadocument
using\input{hfilenamei}. They require thetikz package tobe loaded. For
this towork it is importantthattheimages arelocatedattheindentedposition
inthe TEXMFtree asdescribedinsection3.
Themwe can be loaded in the preamble of a MWE and loads often used
packages. Atthis moment these are only graphicxlipsum andblindtext,
while the lasttwo are only loaded if they are installed. The package is not
required forusing the image files. If the package isloadeditwill change the
graphicextensionlistsothat PDFfiles areusedfirst for formats whichsupport
PDFimages. Also\graphicspath{{example-}}isusedtoallowtoshortenthe
file namesto‘image..’insteadofthefull‘example-image...’.
Some MWE might even be better off not to use the package if specific
side-effect betweenpackagesistested.
Usage Example
\documentclass{article}
\usepackage{mwe}% or load ’graphicx’ and ’blindtext’ manually
\begin{document}
\blindtext
\begin{figure}
\includegraphics[width=.48\linewidth]{example-image-a}\hfill
\includegraphics[width=.48\linewidth]{example-image-b}
\caption{MWE to demonstrate how to place to images side-by-side}
\end{figure}
\blindtext
\end{document}
2
SDK Library API:VB.NET PDF Convert to Word SDK: Convert PDF to Word library in vb.
Convert PDF to Word in both .NET WinForms and ASP.NET webpage. Create high quality Word documents from both scanned PDF and searchable PDF files without losing
www.rasteredge.com
SDK Library API:C# HTML5 Viewer: Load, View, Convert, Annotate and Edit Word
C# users can convert Convert Microsoft Office Word to searchable PDF online, create multi Word text is searchable when users use Word text search
www.rasteredge.com
3 Installation
Themwepackagehasduetoitsnaturealittleuncommoninstallationrequirements.
While thenormalpackagefilesare installedasnormal,avariety of image files
are installedinthetex/latex/mwe/ folder,so thatthey canbe accessedfrom
every(MWE) document.
Multiple binary imagesare included which can’t be build fromthe DTX
alone withoutextraconversiontools. A TDSZIP file whichonly needstobe
unzippedover theTEXMFis alsoprovided. This isthepreferredwaytoinstall
thispackage forendusersanddistributionmaintainers. If a manual buildis
wantedchange alloccurrencesof ‘nostandalone’to‘standalone’intheDTX
file. CompileallextractedTEXfiles withpdflatex andconvert thesefilesfrom
PDFtoPNG andJPG.Compileagainwithlatexanddvips tocreatetheEPS
files(rename the PSto EPS).
Files
TEXMFInstallationfolder
mwe.dtx mwe.ins
source/latex/mwe/
mwe.pdf README INSTALL
doc/latex/mwe/
mwe.sty
tex/latex/mwe/
example-image-*x*.{tex,pdf,png,jpg,eps}
tex/latex/mwe/
example-image-?.{tex,pdf,png,jpg,eps}
tex/latex/mwe/
example-image-golden*.{tex,pdf,png,jpg,eps}
tex/latex/mwe/
example-grid-*.tex,pdf
tex/latex/mwe/
example-image-a?*.pdf example-image-letter*.pdf tex/latex/mwe/
example-image-a?*.tex example-image-letter*.tex source/latex/mwe/
4 Provided Images
The followingimagesareprovidedbymwe. Ifthemwe L
A
T
E
Xpackage isloaded
the PDFversion willbe usedinsteadof the PNG versionand the ‘example-
partofthefilenamemaybeskipped.
4.1 Normal Images
Thefollowingimagesaremeant asdummyreplacementsfor realimages. They
are provided as PDF, JPG, PNG and EPS formats in order to cover every
possible use-case. They are also providesasTEX filesholdingthesource code.
Thetikzpackagemustbe loadedinordertousetheminadocument. These
sourcefilesoriginallyusethestandaloneclassandapreamble, but these lines
havebeencommentedout,inordertonotrequirethestandalonepackagein
order to\input them intoa MWE or test document.
3
SDK Library API:VB.NET Create PDF from Word Library to convert docx, doc to PDF in
Easy to create searchable and scanned PDF files from Word. Convert Word to PDF file with embedded fonts or without original fonts fast.
www.rasteredge.com
SDK Library API:VB.NET Image: Robust OCR Recognition SDK for VB.NET, .NET Image
and more companies are trying to convert printed business you are executing character and word recognition. Texts will be outputted as searchable PDF, PDF/A,TXT
www.rasteredge.com
Image
Figure 1: Image‘example-image’(PDF,alsoavailableas JPG,PNGandEPS).
A
Figure 2: Image ‘example-image-a’ (PDF, also available asJPG, PNG and
EPS).
4
SDK Library API:C# Create PDF Library SDK to convert PDF from other file formats
Best C#.NET component to create searchable PDF document from Microsoft Office Word, Excel and PowerPoint. Create writable PDF from text (.txt) file.
www.rasteredge.com
SDK Library API:C# Create PDF from Word Library to convert docx, doc to PDF in C#.
Easy to create searchable and scanned PDF files from Word. Convert to PDF with embedded fonts or without original fonts fast.
www.rasteredge.com
B
Figure 3: Image ‘example-image-b’ (PDF, also available asJPG, PNG and
EPS).
C
Figure 4: Image ‘example-image-c’ (PDF, also available asJPG, PNG and
EPS).
5
SDK Library API:VB.NET PDF Convert to HTML SDK: Convert PDF to html files in vb.
Why do we need to convert PDF document to HTML webpage One is that compared with HTML file, PDF file (a not be easily edited), is less searchable for search
www.rasteredge.com
SDK Library API:C# PDF Convert to HTML SDK: Convert PDF to html files in C#.net
library also makes PDF document visible and searchable on the Internet by converting PDF document file to Use C#.NET Demo Code to Convert PDF Document to
www.rasteredge.com
16×10
(Original size: 320×200 bp)
Figure 5: Image ‘example-image-16x10’ (PDF, also available as JPG, PNG
andEPS).
6
16×10
(Originalsize: 200×320bp)
Figure 6: Image ‘example-image-10x16’ (PDF, also available as JPG, PNG
andEPS).
16×9
(Original size: 320×180 bp)
Figure 7: Image ‘example-image-16x9’(PDF,alsoavailableasJPG,PNGand
EPS).
7
16×9
(Originalsize: 180×320bp)
Figure 8: Image ‘example-image-9x16’(PDF,alsoavailableasJPG,PNGand
EPS).
8
Golden ratio
(Original size: 32.361×200 bp)
Figure9: Image‘example-image-golden (PDF, alsoavailable asJPG,PNG
andEPS).
9
Golden
ratio
(Originalsize: 200×32.361bp)
Figure 10: Image ‘example-image-golden-upright (PDF, also available as
JPG,PNGandEPS).
10
Documents you may be interested
Documents you may be interested