Is it possible to tell latexmk to execute mpost paper.mp after each compilation run if paper.mp has changed?  I tried to create a custom latexmkrc rule:  add_cus_dep('mp', '1', 0, 'mpost'); sub mpost {  system "mpost $name" ;  popd();  return 0; }   But this does not seem to work
123934
Background  The latexmk tool can be used to automatically process your LaTeX files enough times to generate the output.  As discussed  and , latexmk now supports setting out_dir which passes the -output-directory to pdflatex and places build products in this alternate location.  Unfortunately, this makes it difficult to use latexmk with feynmp.  Question  How can I configure latexmk to call mpost for processing Feynman diagrams generated by feynmp?  Especially using the new out_dir configuration?  Partial Answer 1  One can try to add a custom rule to the latexmkrc file like  add_cus_dep('mp', '1', 0, 'mpost'); sub mpost {     system("mpost $_[0]"); }   but this fails in three ways: 1) if there are multiple images, then the extensions .1 changes and it is not clear how to specify all the dependences. 2) I don't know how to tell latexmk that pdflatex needs to be run again after the figure is generated. 3) Even if out_dir is specified, latexmk still runs the mpost command in the source directory, thereby missing the generated .mp files.  Partial Answer 2  As suggested , one can use the -shell-escape option of pdflatex to allow the figures to be processed by the call to pdflatex.  Unfortunately, the call to mpost still takes place in the top-level directory.  Is there some way of using -output-directory to ensure that shell commands are executed in the appropriate place?  Here is a MWE demonstrating this second attempt:  latexmkrc  mkdir _build; $out_dir = '_build'; $pdflatex="pdflatex -shell-escape -interaction=nonstopmode %O %S";   tst.tex  \documentclass{scrbook} \usepackage{feynmp} \usepackage{etoolbox}  \DeclareGraphicsRule{*}{mps}{*}{} \makeatletter \show\endfmffile \preto{\endfmffile}{\let\the@fmffile\thefmffile} \appto{\endfmffile}{   \ifnum\pdfshellescape=\@ne     \immediate\write18{mpost \the@fmffile}%   \else     \message{       Run pdf(la)tex with -shell-escape to generate feynmp diagrams}   \fi   \let\the@fmffile\relax } \makeatother  \begin{document} \begin{fmffile}{title}   \begin{fmfgraph}(40,25)      \fmfleft{i1,i2}      \fmfright{o1,o2}      \fmf{fermion}{i1,v1,o1}      \fmf{fermion}{i2,v2,o2}      \fmf{photon}{v1,v2}   \end{fmfgraph}  \end{fmffile} \end{document}
2902
I am doing summer project in maths and I have to type my report. I am good with the latex I write on mathstack that I have learned through experience but when it comes to softwares, I do not know anything like those commands \begin \end does not make sense to me.   Is there any software which can automatically put these commands in, so that in b/w we can type whatever stuff we want?  Also if not, at least you guys can tell me if there is any latex software which shows the output on half of screen(right half), as I type on left half and compile, (I saw it somewhere).  Anyways, I have to download a software and will have to go through some you tube videos, so please suggest me relatively easy Latex software.  Thanks!  P.S. Please edit the tags as you wish, I did not understand many tags here.
112224
Do you know how LaTeX implements environments? To be more precise, what does  \newenvironment{&lt;env-name&gt;}[&lt;n-args&gt;][&lt;default&gt;]{&lt;begin-code&gt;}{&lt;end-code&gt;}   in terms of TeX commands (i.e., how is the LaTeX command \newenvironment defined in TeX)?
118377
I'm using  in a Makefile to compile my document. Since I want my output filename to be different from the input filename, I use latexmk's option jobname.  The problem is: it seems to be incompatible with latexmk -c to clean temporary files.  Here's the specific entry in my Makefile:  these.pdf: header.tex $(OBJS)     latexmk                 \         -pdf                \         -pdflatex="$(TEX)"  \         -jobname="these"    \         -use-make $&lt;   Input files are header.tex containing the latex instruction header and other latex content files. The output files are these.{aux,bbl,bcf,...}. Then latexmk -c does not remove temporary files: .{aux,bbl,bcf,...} files.
102809
If I consider a simple LaTeX document such as:  \documentclass[11pt]{article} \begin{document} Hello, World! \end{document}   then if I typeset it multiple times I get a different checksum each time  $ pdflatex test This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009)  restricted \write18 enabled. entering extended mode ... Output written on test.pdf (1 page, 12592 bytes). Transcript written on test.log. $ cksum test.pdf 2770399004 12592 test.pdf $ pdflatex test This is pdfTeX, Version 3.1415926-1.40.10 (TeX Live 2009)  restricted \write18 enabled. entering extended mode ... Output written on test.pdf (1 page, 12592 bytes). Transcript written on test.log. $ cksum test.pdf 1225641903 12592 test.pdf   The different checksum is due to three lines changing in the PDF file:  /CreationDate (D:20101115092454-05'00') /ModDate (D:20101115092454-05'00') ... /ID [&lt;E52BBC1CEFDC95455342C233D35D790A&gt; &lt;E52BBC1CEFDC95455342C233D35D790A&gt;] &gt;&gt;   This is also the case with more complicated LaTeX input. Is there a way to typeset LaTeX files that would avoid this issue, so that if typeset multiple times, the checksum of the PDF file stays the same?
28956
A lot of people write makefiles that say something like  paper.pdf: paper.tex         pdflatex paper         bibtex paper         pdflatex paper         pdflatex paper   To handle re-running TeX to get new/changed references and so forth. Is there a better way to do this?
124047
I would like to save my customised completion (user> customise completion) so that every time I close and re-open texmaker, I don't have to redefine it. How can I do that ?   Thanks in advance,
100572
If PDFLaTeX fails to compile with     See the LaTeX manual or LaTeX Companion for explanation. Type  H     for immediate help.   I want to press e to get an instance of Emacs. The cursor should be on the position of the error (if TeX knows it)  I guess I should insert   export TEXEDIT="emacs magic"   to my .bashrc but what should I type instead of magic?
23064
I am writing a program, and I want it to do different things depending on which LaTeX packages have been installed.  My current solution is to automatically generate simple .tex files that \usepackage the packages I care about and then automatically check if pdflatex can compile them or not.  This solution seems slow and fragile.  What is a better solution?  Edit: The program I am writing is in Python.
52232
I updated MikTex 2.9 Monday, and now can't compile while loading 'mhchem'. I'm using pdflatex [Version 3.14159265-2.6-1.40.16 (MiKTeX 2.9 64-bit)] to compile the following:  \documentclass{article} \usepackage[version=4]{mhchem} \begin{document} Hello, world! \end{document}   throws the following error:  ! LaTeX error: "kernel/command-not-defined"  ! Control sequence \prop_get:Nn undefined.  ! See the LaTeX3 documentation for further information.  ! For immediate help type H &lt;return&gt;.  l.180 ..._variant:Nn \prop_get:Nn           { cV }  | This is a coding error.  | LaTeX has been asked to use a control sequence '\prop_get:Nn': this has not been defined yet.
53737
Is it possible and if so how can you pass flags to the ShareLaTeX compiler which one would have passed as parameters to the LaTeX compiler?  I am using the minted package and need to pass the -shell-escape flag.
123746
I have a problem compiling the following document.  First, I have a file macros.sty that consists of :  \newcommand{\test}{ \xymatrix@R=0mm{x} }   Then, I have an auxiliary file out.aux that consists of :  \test   Finally, the main file is :  \documentclass{article} \usepackage[all]{xy} \usepackage{macros} \begin{document} \input{out.aux} \end{document}   The error message is :  ./out.aux:1: Undefined control sequence. \xymatrix@R -&gt;\Addop@@                     \xymatrixrowsep@ \dimen@ii    Note that if you remove the R=0mm, the problem no longer holds.  Is that a bug ?  It is very strange because I remember to have already used a command similar to \test in an input file without any problem.  Does it come from my distribution ?  Thank you :)
41095
How do I create something like this without getting any errors?  \begin{thm}[\cite[page 10]{ABC2011}] ... \end{thm}   I tried putting various things into {...} brackets, but not eliminating any errors. I probably have misunderstood something about how LaTeX works in the background and the AMS packet:  \usepackage[amsmath,thmmarks]{ntheorem}
41401
I'm getting the following error when trying to compile the following very minimal example with MiKTeX:  \documentclass{article}  \usepackage[T1]{fontenc} \usepackage{kpfonts}  \begin{document} test \end{document}   The error I get is  hb/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}] (D:\dump\tex\tmp\test.aux) )Trying to make PK font jkpmn8r at 600 DPI... Running miktex-makemf.exe... miktex-makemf: The jkpmn8r source file could not be found. Running ttf2pk.exe... miktex-makepk: PK font jkpmn8r could not be created.  !pdfTeX error: pdflatex (file jkpmn8r): Font jkpmn8r at 600 not found  ==> Fatal error occurred, no output PDF file produced!  It compiles perfectly on my Ubuntu machine with TeX Live 2011, but not on my Windows machine with MiKTeX 2.9 (just updated all packages as well).  I detected this when trying to compile my thesis on my Windows machine, which produced the following error:  [5 ! pdfTeX error (font expansion): auto expansion is only possible with scalable fonts. \@EveryShipout@Output ...@Org@Shipout \box \@cclv  l.47  !  ==&gt; Fatal error occurred, no output PDF file produced!   It appears it has something to do with the kpfonts package since the minimal example compiles when I comment it out, but why does it work on my Ubuntu machine then?
70938
Let's say I have .tex file which is a set of problems and solutions, of which I want to make two pdf files, one which includes the solutions and one which doesn't. so I need to build the .tex file under two different modes, and specify that parts of the document be ignored under one of the modes.  This is something common in programming context. e.g. in C++ i can code  #ifdef DEBUG   // do this additional stuff ... #endif   How can I do something equivalent in latex?
29670
I often run into problems in LaTeX with packages. I did a reinstall (MiKTeX) and it seemed to fix some issues with knowing where packages coming from or going. In general, I am not sure what should or does happen when using \usepackage command.  Is it standard that these packages are automatically pulled from the internet? Where do they go (by default)? Is there a better place to put them?  If I am troubleshooting, and if we can say packages are usually installed automatically, when, and should I ever, install packages manually? If so, where would I put them?  For instance, I believe the package easylist is installed on my computer. I was able, with some difficulty, to get into the roaming folder, looked around, and really the only package I saw, was several easylist files, such as .sty, and an associated readme file. I did a windows search for easylist, and only found one, with suffix .tpm and in the Program Files (x86)\MiKTeX 2.9\tpm folder.  My problem currently, is that I am trying to use the todonotes package. It seems to require the xcolor package. But this "can not be found". It asks to choose a place to get it. I think default was "choose random", but I just switched it to internet, and some random mirror site in country (USA). That didn't work, and I'm afraid I've now fiddled with the default settings for getting packages, which will create problems later.  Here are some other threads I have been fishing through:             In lieu of picture, I have this:    miktex-pdftex.exe: No connection could be made because the target machine actively refused it.  miktex-pdftex.exe: Data: connect failed in tcp_connect() {}======================================================================  ! LaTeX Error: File `xcolor.sty' not found.  Type X to quit or &lt;RETURN&gt; to proceed, or enter new name. (Default extension: sty)  Enter file name:    and from clipboard:    MiKTeX Problem Report Message: No connection could be made because the target machine actively refused it.  Data: connect failed in tcp_connect() Source: Libraries\MiKTeX\PackageManager\PackageManager.cpp Line: 2461 MiKTeX: 2.9 OS: Microsoft Windows 7 Home Premium Edition, 64-bit Service Pack 1 (build 7601) Invokers: explorer SystemAdmin: no PowerUser: no Root0: C:\Users\aUserName\AppData\Roaming\MiKTeX\2.9 Root1: C:\Users\aUserName\AppData\Local\MiKTeX\2.9 Root2: C:\ProgramData\MiKTeX\2.9 Root3: C:\Program Files (x86)\MiKTeX 2.9 UserInstall: C:\Users\aUserName\AppData\Roaming\MiKTeX\2.9 UserConfig: C:\Users\aUserName\AppData\Roaming\MiKTeX\2.9 UserData: C:\Users\aUserName\AppData\Local\MiKTeX\2.9 CommonInstall: C:\Program Files (x86)\MiKTeX 2.9 CommonConfig: C:\ProgramData\MiKTeX\2.9 CommonData: C:\ProgramData\MiKTeX\2.9    (from "Package Installation" window below)   The required file        tex\latex\xcolor\xcolor.sty  is missing. It is part of the following package:        xcolor  The package will be installed from:  ftp://... [Change...] The package will be installed for...
110642
I'm using winedt for Latex. sometimes I'm only working on a section of my paper and want to recompile to PDF without going through the whole time-consuming compilation. Is there a way I can tell Latex I've just changed a part of the text (or a section) so that it goes faster.   I know about \includeonly but this seems to work on specific chapters rather than at a micro level like my problem.