My intuition was
Lorem ipsum\footnote{long footnote
that spans a whole
bunch of
lines.
}
But regardless of where I put the { and } in relation to the footnote text, I get the following error:
Latex Error: ./mydoc.tex:142 Package inputenc Error: Unicode char \u8:― not set up for use with LaTeX.
Footnotes are filled in the availible space just like any other paragraph: you just write
\footnote{
a whole lot of text that goes on and on and on and...
...
and may consists of multiple sentences. But after a while
...
it finally comes to a stop.
}
That is not your problem. looking at the error message (which I don't recognize from personal experience), I'd say your problem is character set or font related.
Is you editor using unicode?
The error you're getting indicates there's a coding setup issue. Googling the error message suggests you may be running TexShop, or you need to install latex unicode support. use
apt-get latex-ucs
or something similar and try it again.
I get this error a lot when I cut text from another document and paste into LaTeX. My plain text editor doesn't warn me that I pasted in some bad character. Although it is tedious, you can
comment out the entire text of your footnote, replace it by XX, and confirm that now your document runs
retype the entire text of your footnote by hand.
This always works for me. As a shortcut, you may be able to see a punctuation mark that is the culprit and simply fix that.
In the example you gave, it looks like maybe you got an em-dash character that needs to be replaced by the standard LaTeX construction of two or three hyphens.
Related
I found out, that doxygen add hyphenation hints for latex when outputting text of "\c" command, like:
{\ttfamily on\-Ready\-State\-Change\-Listener}
I want to disable this behavior (so onReadyStateChangeListener won't be hyphenated). Is that possible and how?
No this is not possible. Without hyphenation hints LaTeX will often run long identifiers off the page and into the margin, which is the reason why they were introduced.
If you really want to get rid of it have a look at the function filterLatexString() in src/utils.cpp and remove the if in the default case at the end of the function.
I found this is possible in Doxygen 1.8.9.1, using a small workaround job.
Create a custom header.tex file for use with Doxygen. (Instructions)
Find the line in the header.tex file that starts \newcommand{\+}. If you don't find that text, insert an empty line towards the top of the document.
Replace that line with the following text:
\newcommand{\+}{}
Use the header.tex file with your Doxygen output (Instructions)
This effectively disables all of the hyphenation marks that Doxygen adds to the
words.
NOTES: This is for words with \+ added (e.g. D\+O\+X\+Y\+G\+E\+N). It may work for \- if you just substitute the minus sign into the steps above, but I have not verified that.
I found some itentifiers to still be hyphenated after applying this, but in more reasonable places.
Also, do watch out for text running into the margins, as noted by #doxygen.
I need help with the latex glossaries package. I just need a footnote within a glossary entry.
Example:
\newglossaryentry{glos:vo}{
name=ValueObject,
description={a very good explanation for valueObject\footnote{S.89ff \cite{aBookInBibliography}}.}}
Texmaker refuses to build PDF. The log file is confusing as always, saying something like this:
I suspect you've forgotten a `}', causing me to apply this
control sequence to too much text. How can we recover?
My plan is to forget the whole thing and hope for the best.
! Too many }'s.
So any ideas here? Thank you.
i've got it. it has not been the fault of the footnote or cite. it turned out, my description text has been to long.
whysoever latex accepts description texts just with 1024 characters maximum.
Is it possible to have a TeX command which will take the whole next word (or the next letters up to but not including the next punctuation symbol) as an argument and not only the next letter or {} group?
I’d like to have a \caps command on certain acronyms but don’t want to type curly brackets over and over.
First of all create your command, for example
\def\capsimpl#1{{\sc #1}}% Your main macro
The solution to catch a space or punctuation:
\catcode`\#=11
\def\addtopunct#1{\expandafter\let\csname punct#\meaning#1\endcsname\let}
\addtopunct{ }
\addtopunct{.} \addtopunct{,} \addtopunct{?}
\addtopunct{!} \addtopunct{;} \addtopunct{:}
\newtoks\capsarg
\def\caps{\capsarg{}\futurelet\punctlet\capsx}
\def\capsx{\expandafter\ifx\csname punct#\meaning\punctlet\endcsname\let
\expandafter\capsend
\else \expandafter\continuecaps\fi}
\def\capsend{\expandafter\capsimpl\expandafter{\the\capsarg}}
\def\continuecaps#1{\capsarg=\expandafter{\the\capsarg#1}\futurelet\punctlet\capsx}
\catcode`\#=12
#Debilski - I wrote something similar to your active * code for the acronyms in my thesis. I activated < and then \def<#1> to print the acronym, as well as the expansion if it's the first time it's encountered. I also went a bit off the deep end by allowing defining the expansions in-line and using the .aux files to send the expansions "back in time" if they're used before they're declared, or to report errors if an acronym is never declared.
Overall, it seemed like it would be a good idea at the time - I rarely needed < to be catcode 12 in my actual text (since all my macros were in a separate .sty file), and I made it behave in math mode, so I couldn't foresee any difficulties. But boy was it brittle... I don't know how many times I accidentally broke my build by changing something seemingly unrelated. So all that to say, be very careful activating characters that are even remotely commonly-used.
On the other hand, with XeTeX and higher unicode characters, it's probably a lot safer, and there are generally easy ways to type these extra characters, such as making a multi (or compose) key (I usually map either numlock or one of the windows keys to this), so that e.g. multi-!-! produces ¡). Or if you're running in emacs, you can use C-\ to switch into TeX input mode briefly to insert unicode by typing the TeX command for it (though this is a pain for actually typing TeX documents, since it intercepts your actual \'s, and please please don't try defining your own escape character!)
Regarding whitespace after commands: see package xspace, and TeX FAQ item Commands gobble following space.
Now why this is very difficult: as you noted yourself, things like that can only be done by changing catcodes, it seems. Catcodes are assigned to characters when TeX reads them, and TeX reads one line at a time, so you can not do anything with other spaces on the same line, IMHO. There might be a way around this, but I do not see it.
Dangerous code below!
This code will do what you want only at the end of the line, so if what you want is more "fluent" typing without brackets, but you are willing to hit 'return' after each acronym (and not run any auto-indent later), you can use this:
\def\caps{\begingroup\catcode`^^20 =11\mcaps}
\def\mcaps#1{\def\next##1 {\sc #1##1\catcode`^^20 =10\endgroup\ }\next}
One solution might be setting another character as active and using this one for escaping. This does not remove the need for a closing character but avoids typing the \caps macro, thus making it overall easier to type.
Therefore under very special circumstances, the following works.
\catcode`\*=\active
\def*#1*{\textsc{\MakeTextLowercase{#1}}}
Now follows an *Acronym*.
Unfortunately, this makes uses of \section*{} impossible without additional macro definitions.
In Xetex, it seems to be possible to exploit unicode characters for this, so one could define
\catcode`\•=\active
\def•#1•{\textsc{\MakeTextLowercase{#1}}}
Now follows an •Acronym•.
Which should reduce the effects on other commands but of course needs to have the character ‘•’ mapped to the keyboard somewhere to be of use.
I'm using Lyx to produce a Latex document, and when i try to convert to pdf, it complains of the error: "there's no line to end", and description is "//".
My Latex document is like 200 lines without many line breaks. How am I supposed to debug this and get this darned pdf converted. I literally am stuck on this for hours, can't submit this pdf. And for 90% of the time while writing this document, the convert to pdf works fine, I don't know know since what point did it start to fail.
Someone give me a quick way to get rid of this error? Otherwise this Latex document is useless.
Thanks.
That may sound stupid, but sometimes Latex needs a sign before the \, therefore:
~\\
That very much depends on the distribution you chose. LyX btw. is kind of crazy, when it comes to LaTeX export. Try auctex if you've got a month or two to spare ;)
IMO this is the problem with LyX; when things go wrong it's hard to know where to look to fix the problem. This is a minimal document that shows an example of the error:
\documentclass{article}
\begin{document}
\\ there
\end{document}
I suggest exporting your LyX document to LaTeX, then compiling it "by hand" (with pdflatex mydoc or whatever) and see where in the document the error is appearing. You should then be able to correlate it with some misbehaving piece of the LyX document.
Do a binary search. Delete half the document, if it compiles then the problem was in the part you deleted. If not, then it's in the half you kept. Repeat the procedure on the offending portion and you should soon find which line is causing it.
Dear Saobi, please post the offending line. Probably you have a "\" in a single-line math environment. If you post the code for the complete environment, I can try to indicate how to prevent this error.
You can go to View -> View Source and click around until you find the offending line. In latex, line break is \\.
After doing that I realized the problem is you can't put a line break (Ctrl+Enter) at the start of a line (or cell). You can cheat by forcing a space (Ctrl+Space) before the line break. :)
My approach for locating compilation errors in LaTeX documents is based on a binary search approach. I suppose that a similar approach can be used in LyX.
The key idea is to divide your document in two parts of approximately the same size. At the boundary between these two parts a line containing \end{document} is inserted. If the document now can compile with no problems, the problem were located in the second half part of the document (otherwise it were in the first half part).
\documentclass{article}
\begin{document}
% First half part of the document
\section{Hello}
% Location for inserting \end{document}
% Second half part of the document
% in which the error is located
\section{World
\end{document}
In addition, check out that your LaTex lines already have content. I wrote an empty line, and It also causes error, from my experience.
\vspace{1cm}{ }\\
When I include \overline{x} or other special characters in the caption text of a table, the whole caption text won't appear at all. When I put simple text without special characters, the caption works fine. How can I include special characters in the caption?
Are you putting $ around the maths? I.e.:
\caption{This is a caption with maths $\overline{x}$ in it.}
Apparently your real problem was that TeX's fancy error correction mechanism prevented you from knowing that there was a syntax error in the document. Back in 1982 or so, running TeX on a long document would take so much time that Knuth didn't want TeX to just quit when it ran into an error. Instead, TeX tries to guess what you meant and go on typesetting the document, so that you can fix a bunch of errors before you run it again; for example, when it spots a math-mode command outside math mode, it assumes that you forgot a dollar sign and inserts it. No automatic error-correction mechanism is perfect, so syntax errors often cause some part of text to be lost, or typeset in a wrong way.
TeX does try to tell you that it has found errors, but I suppose current IDEs make it easy to ignore the output. Try running latex on the document from the command line and pay attention to what it says. For example, the short document
\documentclass{article}
\begin{document}
It seems \sqrt{2} I forgot some dollar signs.
\end{document}
causes TeX to prompt you with
! Missing $ inserted.
<inserted text>
$
l.3 It seems \sqrt{
2} I forgot some dollar signs.
?
The 2009 way of dealing with this is to type X to quit, fix the source document, and run latex again - but you can actually enter other commands at the prompt to edit the input that TeX sees. If you just type Q (to run quietly - same as specifying \batchmode, which Emacs or whatever IDE you are using probably does for you) you get a typeset document as a result, and it might not be obvious that there are in fact syntax errors in it.
If you looking for how to insert any special character in Latex in a table then this may help you. Check this out...
\documentclass{article}
\begin{document}
\begin{tabular}{|l|r|r|}
Item & Quality & Price(\$)\\
Nails & 500 & 34\\
Wooden boards & 100 & 4\\
Bricks & 240 & 11\\
\end{tabular}
\end{document}