! Package inputenc Error: Unicode character ^^H (U+0008) - latex

I installed MacTex from brew brew install mactex-no-gui --cask
test.tex
\documentclass{jarticle}
\usepackage{amsmath,amsfonts}
\begin{document}
mytest--m=testmode テストを行う
\end{document}
I try to compile this this simple text with platex
It shows this error.
I guess it is related to unicode setting ??
because I put some Japanese character in it.
How can I fix it?
$platex test.tex
This is e-pTeX, Version 3.14159265-p3.8.3-191112-2.6 (utf8.euc) (TeX Live 2020) (preloaded format=platex)
restricted \write18 enabled.
entering extended mode
(./test.tex
pLaTeX2e <2020-02-02>+3 (based on LaTeX2e <2020-02-02> patch level 5)
L3 programming layer <2020-03-06>
(/usr/local/texlive/2020/texmf-dist/tex/platex/base/jarticle.cls
Document Class: jarticle 2020/01/03 v1.8e Standard pLaTeX class
(/usr/local/texlive/2020/texmf-dist/tex/platex/base/jsize10.clo))
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/usr/local/texlive/2020/texmf-dist/tex/latex/amsfonts/amsfonts.sty)
(/usr/local/texlive/2020/texmf-dist/tex/latex/l3backend/l3backend-dvips.def)
(./test.aux)
! Package inputenc Error: Unicode character ^^H (U+0008)
(inputenc) not set up for use with LaTeX.
See the inputenc package documentation for explanation.
Type H <return> for immediate help.
...
l.6 mytest^^H
--m=crond テストを行う

Related

How to debug missing unicode characters errors when compiling literate agda files?

How does one get certain unicode characters to compile with .lagda files. For instance, when I add certain unicode characters manually to the tex file, like \phi, \forall, etc. but when I add < or == it yields the below error. Should I change font packages? Are there any repositories with example .lagda files, relevantly installed font packages, and commands so that I can get it to work out of the box for say, anything written in the standard library? I'm following the exact instructions for ad hoc workarounds on
https://agda.readthedocs.io/en/v2.6.1.1/tools/generating-latex.html
Here is the relevant clipping from my main.tex
\usepackage{unicode-math}
\setmathfont{XITS Math}
\usepackage{newunicodechar}
\newunicodechar{λ}{\ensuremath{\mathnormal\lambda}}
\newunicodechar{ℓ}{\ensuremath{\mathnormal\ell}}
\newunicodechar{η}{\ensuremath{\mathnormal\eta}}
\newunicodechar{∀}{\ensuremath{\mathnormal\forall}}
\newunicodechar{ϕ}{\ensuremath{\mathnormal\phi}}
%% \newunicodechar{⟨}{\ensuremath{\mathnormal\<}}
%% \newunicodechar{⟩}{\ensuremath{\mathnormal\>}}
\newunicodechar{≡}{\ensuremath{\mathnormal\==}} %error when uncommented
and the error
$ ./compile.sh
Latexmk: This is Latexmk, John Collins, 26 Dec. 2019, version: 4.67.
Latexmk: applying rule 'xelatex'...
Rule 'xelatex': File changes, etc:
Changed files, or newly in use since previous run(s):
'latex/Cubical/Algebra/Group/Morphism.aux'
------------
Run number 1 of rule 'xelatex'
------------
------------
Running 'xelatex -no-pdf -recorder "main.tex"'
------------
This is XeTeX, Version 3.14159265-2.6-0.999991 (TeX Live 2019/Debian) (preloaded format=xelatex)
restricted \write18 enabled.
entering extended mode
(./main.tex
LaTeX2e <2020-02-02> patch level 2
L3 programming layer <2020-02-14>
(/usr/share/texlive/texmf-dist/tex/latex/base/article.cls
Document Class: article 2019/12/20 v1.4l Standard LaTeX document class
(/usr/share/texlive/texmf-dist/tex/latex/base/size10.clo))
(/usr/share/texlive/texmf-dist/tex/latex/base/inputenc.sty) (./latex/agda.sty
LaTeX Warning: You have requested package `latex/agda',
but the package provides `agda'.
(/usr/share/texlive/texmf-dist/tex/generic/iftex/ifxetex.sty
(/usr/share/texlive/texmf-dist/tex/generic/iftex/iftex.sty))
(/usr/share/texlive/texmf-dist/tex/generic/iftex/ifluatex.sty)
(/usr/share/texlive/texmf-dist/tex/latex/xifthen/xifthen.sty
(/usr/share/texlive/texmf-dist/tex/latex/tools/calc.sty)
(/usr/share/texlive/texmf-dist/tex/latex/base/ifthen.sty)
(/usr/share/texlive/texmf-dist/tex/latex/ifmtarg/ifmtarg.sty))
(/usr/share/texlive/texmf-dist/tex/latex/xcolor/xcolor.sty
(/usr/share/texlive/texmf-dist/tex/latex/graphics-cfg/color.cfg)
(/usr/share/texlive/texmf-dist/tex/latex/graphics-def/xetex.def))
(/usr/share/texlive/texmf-dist/tex/latex/polytable/polytable.sty
(/usr/share/texlive/texmf-dist/tex/latex/lazylist/lazylist.sty)
(/usr/share/texlive/texmf-dist/tex/latex/tools/array.sty))
(/usr/share/texlive/texmf-dist/tex/latex/etoolbox/etoolbox.sty)
(/usr/share/texlive/texmf-dist/tex/latex/environ/environ.sty
(/usr/share/texlive/texmf-dist/tex/latex/trimspaces/trimspaces.sty))
(/usr/share/texlive/texmf-dist/tex/latex/l3packages/xparse/xparse.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3kernel/expl3.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3backend/l3backend-xdvipdfmx.def)))
(/usr/share/texlive/texmf-dist/tex/latex/xkeyval/xkeyval.sty
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkeyval.tex
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/xkvutils.tex
(/usr/share/texlive/texmf-dist/tex/generic/xkeyval/keyval.tex)))))
(/usr/share/texlive/texmf-dist/tex/latex/unicode-math/unicode-math.sty
(/usr/share/texlive/texmf-dist/tex/latex/unicode-math/unicode-math-xetex.sty
(/usr/share/texlive/texmf-dist/tex/latex/l3packages/l3keys2e/l3keys2e.sty)
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.sty
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec-xetex.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/fontenc.sty)
(/usr/share/texlive/texmf-dist/tex/latex/fontspec/fontspec.cfg)))
(/usr/share/texlive/texmf-dist/tex/latex/base/fix-cm.sty
(/usr/share/texlive/texmf-dist/tex/latex/base/ts1enc.def))
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsmath.sty
For additional information on amsmath, use the `?' option.
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amstext.sty
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsgen.sty))
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsbsy.sty)
(/usr/share/texlive/texmf-dist/tex/latex/amsmath/amsopn.sty))
(/usr/share/texlive/texmf-dist/tex/latex/unicode-math/unicode-math-table.tex)))
(/usr/share/texlive/texmf-dist/tex/latex/newunicodechar/newunicodechar.sty)
(./main.aux (./latex/Cubical/Algebra/Group/Morphism.aux)) [1]
(./latex/Cubical/Algebra/Group/Morphism.tex
! Extra }, or forgotten $.
\PT#scanend ->\PT#post#preamble \egroup
l.594 \end{code}
?

doxygen: How to link to an external URL with # (hash) sign?

I am trying to link an URL which contains a # (hash) sign, see upstream code here:
http://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_8.2.html#para_4bcb841e-c6bf-4e26-82a5-3fad3c942da0
Everything works as expected with HTML output, but things gets nasty with LaTeX output (PDF). It fails with:
! Illegal parameter number in definition of \Hy#tempa.
<to be read again>
p
l.153 ...ageref{classgdcm_1_1ImageRegionReader}}{}
?
Looking at the generated code, I see:
\href{http://dicom.nema.org/medical/dicom/current/output/chtml/part05/sect_8.2.html#para_4bcb841e-c6bf-4e26-82a5-3fad3c942da0}
I cannot simply escape the # sign with a backslash since it would break the HTML output (but fix the LaTeX output). I found on the web that including bigfoot before hyperref can solve this sort of issue, but this did not work for me using the following trick in the doxyfile:
## -1650,7 +1650,7 ## PAPER_TYPE = letter
# If left blank no extra packages will be included.
# This tag requires that the tag GENERATE_LATEX is set to YES.
-EXTRA_PACKAGES =
+EXTRA_PACKAGES = bigfoot
# The LATEX_HEADER tag can be used to specify a personal LaTeX header for the
# generated LaTeX document. The header should contain everything until the first
Is there anything simple to include a URL with # sign that works for both HTML and LaTeX output ?
EDIT: I found out that doxygen generate the following code:
% Hyperlinks (required, but should be loaded last)
\usepackage{ifpdf}
\ifpdf
\usepackage[pdftex,pagebackref=true]{hyperref}
\else
\usepackage[ps2pdf,pagebackref=true]{hyperref}
\fi
So I cannot explicitly \usepackage{hyperref} after \usepackage{bigfoot} since this creates some sort of conflict.
Package hyperref Message: Driver (autodetected): hpdftex.
(/usr/share/texlive/texmf-dist/tex/latex/hyperref/hpdftex.def
(/usr/share/texlive/texmf-dist/tex/latex/oberdiek/rerunfilecheck.sty))
! LaTeX Error: Option clash for package hyperref.
See the LaTeX manual or LaTeX Companion for explanation.
Type H <return> for immediate help.
...
l.101 \else

Problems in Latex with bibtex and biblatex (bibliography)

I'm using ubuntu16, i've intalled latex full version and texmaker. Im writing a document and when compiling the bibliography i get this message:
!LaTeX Error: File `bibtex.sty' not found.
What can i do? S.O.S its driving me crazy
\documentclass[12pto,a4paper,oneside]{book}
\usepackage[portuguese]{babel}
\usepackage{bibtex}
\addbibresource{/chapters/reference.bib}
\begin{document}
blablablablablablablablablablablablab \parencite{author-bibliography}
\begin{appendix}
\end{appendix}
\listoffigures
\listoftables
\printbibliography
\end{document}
Please fix the 1st line that should say 12pt
Be sure that bibtex is installed. On my computer tex live tools does the work.
I downloaded the .rar from your university.
Be sure that you have these packages installed:
lastpage
chngcntr
babelbib
I did open exemplo-diss.tex and then I run latex+bibtex+latex and it works.

subfig package in latex

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.

Load a single symbol from a LaTeX package

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}

Resources