Recently, I found some issue with different version of tex. In our company, some are using texlive2018 and some are using texlive2017. In our conf.py, I put
latex_elements = {
'preamble': '''\usepackage{chngcntr}
\counterwithin{figure}{chapter}
\counterwithin{table}{chapter}''',
}
It runs OK in texlive2017 but have a redefined error in texlive2018. If I remove \usepackage{chngcntr}, then texlive2018 works, but texlive2017 have a undefined error. Certainly, it is triggered by some changes in newer version of texlive. But I am wondering if there is a way so that it works on both texlive version.
Indeed the macros of chngcntr have been moved to the LaTeX format with TeXLive2018.
A new version of chngcntr package starts with this
% version 1.1 this package has been adoped into the format so does not
% need to do anything in current latex releases.
\#ifundefined{counterwithout}{}{%
\PackageInfo{chngcntr}{\string\counterwithout\space already defined.\MessageBreak
Quitting chngcntr}%
\endinput
}
Thus all should be find if your TeXLive2018 has the v1.1a 2018/04/09 version of the chngctr package. Please check. Is this the Info you see? this is not an Error.
Else you can always do (beware the r else double the backslashes)
latex_elements = {
'preamble': r'''\ifdefined\counterwithout\else\usepackage{chngcntr}\fi
\counterwithin{figure}{chapter}
\counterwithin{table}{chapter}''',
}
By the way there was a related issue with the LaTeX format, but it has been fixed since.
Related
I have been trying to compile my latex code in overleaf.com, but it keeps giving the errors as follows, and it does not point in which line of the code the error is located in:
It seems like a font issue there and here is the raw log of the error:
{/usr/local/texlive/2021/texmf-dist/fonts/enc/dvips/ly1/texnansi.enc}
! error: (type 1): cannot open file for reading 'ugmm8a.pfb'
! ==> Fatal error occurred, no output PDF file produced!
I need to solve this error to get my output document.
The urw-garamond fonts works just fine with texlive2021, you just need the ugmr8a.pfb from https://www.ctan.org/tex-archive/fonts/urw/garamond
https://www.overleaf.com/read/cmvfrqrkrnrq
(... however it might give better results not to use such a legacy font if you're already using lualatex, overleaf has many good fonts installed https://www.overleaf.com/learn/latex/Questions/Which_OTF_or_TTF_fonts_are_supported_via_fontspec%3F)
I have found the solution to this problem by myself.
Turns out the solution was just to change the Compiler (TeX Live) version of the overleaf.com project from 2021 to 2016 (since the 'ugmm8a.pfb' font got depreciated in the later version).
Hence I had to press the Menu option in the Top Left of my project, and then change the "TeX Live version" from 2021 to 2016 as shown in the screenshot below:
And after this one change when I recompiled, my document was successfully outputted without any errors.
As an additional info to people who are facing similar issues check this post by overleaf.com on how to add new fonts that do not exist on their server to your project: https://www.overleaf.com/learn/latex/XeLaTeX#Using_fonts_not_installed_on_Overleaf.27s_servers:_Google_Fonts_example
I install texstudio by download texstudio-qt4_2.12.14-1_amd64.deb on ubuntu16.04, but I get this erros:
File `subfigure.sty' not found. \RequirePackage
I download subfigure from https://ctan.org/pkg/subfigure and make and move it to /usr/share/texlive/texmf-dist/tex/latex but still not working, how to fix this?
TeX maintains an internal TeX database for file search that is managed by the kpathsea set of tools. It requires a specific command to refresh the database. Try running sudo texhash
BTW, subfigure is no longer maintained and is considered as deprecated. From ctan subfigure page:
The package is now considered obsolete: it was superseded by subfig, but users may find the more recent subcaption package more satisfactory.
For a new document, I would advice you to switch to another package.
I am currently using sphinx 1.4.9 for documents creation. While giving make latexpdf, I get the following error.
(/usr/share/texmf/tex/latex/upquote/upquote.sty)
(/usr/share/texmf/tex/latex/float/float.sty)
(/usr/share/texmf/tex/latex/graphics/graphicx.sty
(/usr/share/texmf/tex/latex/graphics/graphics.sty
(/usr/share/texmf/tex/latex/graphics/trig.sty)
(/usr/lib/texmf/tex/latex/config/graphics.cfg)))
(/usr/share/texmf/tex/plain/misc/pdfcolor.tex)
(/usr/share/texmf/tex/latex/hyperref/hyperref.sty
(/usr/share/texmf/tex/latex/hyperref/pd1enc.def)
(/usr/lib/texmf/tex/latex/config/hyperref.cfg)
(/usr/share/texmf/tex/latex/oberdiek/kvoptions.sty)
****! Package keyval Error: pdfencoding undefined.****
See the keyval package documentation for explanation.
I have searched for pdfencoding in the sphinx.egg, also it only appears in sphinx.sty.
but I don't know how to define this pdfencoding. whether to edit conf.py or how to do.
Your hyperref is outdated. Sphinx 1.4.x series was tested to work with Ubuntu Precise (Debian/TeXLive 2009). I can not try it but here is a hack which may help you out. However, perhaps other parts will fail as your TeX install is really old...
put
'passoptionstopackages' : """
\\let\\originalPassOptionsToPackage\\PassOptionsToPackage
\\makeatletter
\\def\\PassOptionsToPackage#1{%
\\def\\#tempa{#1}\\def\\#tempb{pdfencoding=unicode}%
\\ifx\\#tempa\\#tempb\\expandafter\\#gobbletwo
\\else\\expandafter\\originalPassOptionsToPackage\\fi {#1}}
\\makeatother
""",
inside the latex_elements configuration variable of conf.py. Could work ...
When I am using subfig package in latex, it gives some errors:
Package subfig Warning: Your document class has a bad definition
of \endfigure, most likely
\let\endfigure=\end#float
which has now been changed to
\def\endfigure{\end#float}
because otherwise subsequent changes to \end#float
(like done by several packages changing float behaviour)
can't take effect on \endfigure.
Please complain to your document class author.
Package subfig Warning: Your document class has a bad definition
of \endtable, most likely
\let\endtable=\end#float
which has now been changed to
\def\endtable{\end#float}
because otherwise subsequent changes to \end#float
(like done by several packages changing float behaviour)
can't take effect on \endtable.
Please complain to your document class author.
(/usr/share/texmf/tex/latex/caption/caption.sty
`rotating' package detected
`float' package detected
)
LaTeX Warning: You have requested, on input line 139, version
`2005/06/26' of package caption,
but only version
`1995/04/05 v1.4b caption package (AS)'
is available.
! Undefined control sequence.
l.163 \DeclareCaptionOption
{listofformat}{\caption#setlistofformat{#1}}
How can I solve it?
Thanks and regards!
It looks like a clash between subfig and an old version of the caption package. Try updating your caption package to something more recent. In general, it is a good idea to keep all packages updated to their latest versions.
When using the MnSymbol package, pdflatex gives two font warnings:
LaTeX Font Warning: Encoding 'OMS' has changed to 'U' for symbol font
(Font) 'symbols' in the math version 'normal' on input line 120.
LaTeX Font Info: Overwriting symbol font 'symbols' in version 'normal'
(Font) OMS/cmsy/m/n --> U/MnSymbolF/m/n on input line 120.
It turns out that this is probably due to a clash with the AMSSymb package.
Since I need just a few symbols from the package: is there a way to load one symbol from a package, in stead of all?
Here's how I solved this:
Download the perl script "makefakeMnSymbol" from the comprehensive latex symbol document source:
http://mirror.ctan.org/info/symbols/comprehensive/source/makefakeMnSymbol
Next, at command line do chmod +x makefakeMnSymbol to make it executable. Then, run
./makefakeMnSymbol `kpsewhich MnSymbol.sty` > fakeMnSymbol.sty
Put fakeMnSymbol.sty in a texmf directory of choice (global or local), and run texhash
If you now put
\usepackage{fakeMnSymbol}
in your preamble, you can now use any MnSymbol, like \powerset by prefixing it like \MNSpowerset
Big thanks to Scott Pakin for this hack... and for his comprehensive symbol guide...
This hack has problems with symbols in subscripts/superscripts. A work-around is to use look at the fakeMnSymbol.sty source to find which font the symbol you want was loaded from, along with its number. Here's an example from one of my preambles where I override the built-in \boxminus with an MnSymbol:
\usepackage[]{fakeMnSymbol}
\DeclareSymbolFont{mnsymbolc}{U}{MnSymbolC}{m}{n}
\let\boxminus=\undefined
\DeclareMathSymbol{\boxminus}{2}{mnsymbolc}{112}
These warnings are nothing to worry about. In fact, in the next LaTeX release they'll disappear (see the original bug report). No ETA on that, however.
Moreover, is there any real chance this affects the typesetting of the document?
Nope.
is there any way to prevent this?
Can patch the LaTeX warning message code before loading the package, and then restore it again afterwards (this is what I've done in the past in my own packages), but as a user I'd just learn to ignore the warning.
The following might help. This is the code I had to add in order to get just the \bigominus symbol out of the MnSymbol package.
\DeclareFontFamily{U}{MnSymbolF}{}<br>
\DeclareSymbolFont{mnsymbols}{U}{MnSymbolF}{m}{n}<br>
\DeclareFontShape{U}{MnSymbolF}{m}{n}{<br>
<-6> MnSymbolF5<br>
<6-7> MnSymbolF6<br>
<7-8> MnSymbolF7<br>
<8-9> MnSymbolF8<br>
<9-10> MnSymbolF9<br>
<10-12> MnSymbolF10<br>
<12-> MnSymbolF12}{}<br>
\DeclareMathSymbol{\bigominus}{\mathop}{mnsymbols}{55}