LyX ⇒ How do I insert a character with a different font in a table
How do I insert a character with a different font in a table
Hello, I am using Lyx with Texlive and XeTex (I have various otf and ttf fonts to use in the same document)
I tried wrapping the character with the following command {\fontspec{otherfontname}DIFFERENT CHARACTER} but it gives me error.
What should I do?
I tried wrapping the character with the following command {\fontspec{otherfontname}DIFFERENT CHARACTER} but it gives me error.
What should I do?
NEW: TikZ book now 40% off at Amazon.com for a short time.
Re: How do I insert a character with a different font in a table
Please post an MWE.
Re: How do I insert a character with a different font in a table
Thanks for the reply. Actually it gives me a square with an X in it (last column, third row)although I am sure it is the right font name. I am adding a .lyx file (renamed to .tex to avoid the site filters) and a pdf file.
In the Lyx file I have also included another thing that creates problems, the \linebreak command, which I would like to use since otherwise the text is no broken where I like it the most. I thought I just had to put it with no spaces before or behind and it would work but now I am not so sure since I am a complete beginner.
Cheers
In the Lyx file I have also included another thing that creates problems, the \linebreak command, which I would like to use since otherwise the text is no broken where I like it the most. I thought I just had to put it with no spaces before or behind and it would work but now I am not so sure since I am a complete beginner.
Cheers
- Attachments
-
- different_character_in_table.pdf
- (68.85 KiB) Downloaded 314 times
-
- different character in table.tex
- (12.05 KiB) Downloaded 364 times
Re: How do I insert a character with a different font in a table
That file is a mess. You sure you exported it as "LaTeX (plain)"?
BTW, I tried creating a table and using \fontspec method, it worked. Import the file in attachment in LyX (or any LaTeX editor) and try it.
BTW, I tried creating a table and using \fontspec method, it worked. Import the file in attachment in LyX (or any LaTeX editor) and try it.
- Attachments
-
- test.tex
- (915 Bytes) Downloaded 309 times
Re: How do I insert a character with a different font in a table
Hi!
Thank you for the example. I can see it works well but somehow, when I try to do the same in my table, instead of the proper character I get a square with an X inside it. I checked the character also in OO and in gnucharmap and it should be the right one.
The example I posted was just a plain .lyx file but apart from the font change oddity, I included another thing that was giving me some problems, \linebreak that I cannot get Lyx to accept.
I read that putting this command inside a cell with no spaces before would break the line in the cell, but perhaps I got it wrong
Thank you for the example. I can see it works well but somehow, when I try to do the same in my table, instead of the proper character I get a square with an X inside it. I checked the character also in OO and in gnucharmap and it should be the right one.
The example I posted was just a plain .lyx file but apart from the font change oddity, I included another thing that was giving me some problems, \linebreak that I cannot get Lyx to accept.
I read that putting this command inside a cell with no spaces before would break the line in the cell, but perhaps I got it wrong

How do I insert a character with a different font in a table
For linebreak, try \par instead. If you get to large space, you may try adding a negative \vspace, e.g.:
Can you send me that other font you're using to try to compile that file?
EDIT: I've found out what is causing the problem with line break. When entering a command, you must put immediately after it a space or finish it with {} because LaTeX must know where the command ends. E.g. This is wrong as you can see. In your .lyx file both \linebreak touch the text that is following it, so either put a space behind ERT box, or enter \linebreak{}. So the command should be:
Try it. Keep in mind that LaTeX eats the space after commands. E.g.:
will produce:
You may correct it (that is, to have a space after ellipsis) this way:
(notice the space after {}) or this way:
Both these last codes will produce:
Code: Select all
...some text\par\vspace{-2pt} the rest of the text... & ...
EDIT: I've found out what is causing the problem with line break. When entering a command, you must put immediately after it a space or finish it with {} because LaTeX must know where the command ends. E.g.
Code: Select all
\linebreaksome text
Code: Select all
\linebreak{}some text or
\linebreak some text
Code: Select all
Test\ldots test
Code: Select all
Test...test
Code: Select all
Test\ldots{} test
Code: Select all
Test\ldots\ test
Code: Select all
Test... test
Re: How do I insert a character with a different font in a table
Wow!
Thank you very much.
Here is the font, just in case
http://rapidshare.com/files/271910829/simsun.tcc.html
I have so many other questions
One is related to the front matter.
I put after the front page a table of contents and after it some more front matter such as an introduction with some subsections using the starred typologies (no numbers, chapter and sections) but in the table of contents these do not appear. Is there a way to do it?
How do I select backmatter apart from bibliography in memoir?
I would like to add some appendices
I was also wondering if there is a way to have a list of images at the end of the work (fig.1 NAME, fig.2 NAME), after the appendices and after that the images proper. In the main body I refer to those images (as fig. 1, fig.2 etc.), it would be nice to link them as well.
The last thing is, how do I enter bibliographies. I like the Harvard style (Author date. Title, etc (City:Publisher))
Thank you very much.
Here is the font, just in case
http://rapidshare.com/files/271910829/simsun.tcc.html
I have so many other questions

One is related to the front matter.
I put after the front page a table of contents and after it some more front matter such as an introduction with some subsections using the starred typologies (no numbers, chapter and sections) but in the table of contents these do not appear. Is there a way to do it?
How do I select backmatter apart from bibliography in memoir?
I would like to add some appendices
I was also wondering if there is a way to have a list of images at the end of the work (fig.1 NAME, fig.2 NAME), after the appendices and after that the images proper. In the main body I refer to those images (as fig. 1, fig.2 etc.), it would be nice to link them as well.
The last thing is, how do I enter bibliographies. I like the Harvard style (Author date. Title, etc (City:Publisher))
How do I insert a character with a different font in a table
Most of your questions are answered before on this forum, so you should search a little
However, some tips.
1. If you use frontmatter, you don't have to use starred version of sectioning command because they aren't numbered when in frontmatter. So, use normal \chapter, \section etc. Your document should have structure like in this example:
2. For referencing, use \label{some_label} and when you need to refer to it, use \ref{some_label}. For images and List of figures you'll have to use \caption{picture_name} too, as well for tables. When you follow this guideline, you simply enter \listoffigure and \listoftables commands where you want them to appear (they are similar to \tableofcontent). You should check out caption package for details about captions and some examples.
3. About all this you may learn some basics in LyX User's Guide and other literature. I'll repeat what I said before, you should consider obtaining LaTeX Companion, 2nd edition which is a must-have for serious LaTeXing. For basics, you may try with Not So Short Introduction to LaTeX or obtain "Guide to LaTeX", 4th edition. It's up to you. LaTeX is a very powerful system, arguably the most powerful typesetting system in the world, it has rules you'll have to learn and obey. That means you'll have to do a lot of reading if you want to use all its advantages. But consider it investment...

1. If you use frontmatter, you don't have to use starred version of sectioning command because they aren't numbered when in frontmatter. So, use normal \chapter, \section etc. Your document should have structure like in this example:
Code: Select all
\frontmatter
\tableofcontent
\chapter{Introduction}
...some text...
\mainmatter
\chapter{Some chapter}
...some text...
\backmatter
...Appendicies, Bibliography etc.
3. About all this you may learn some basics in LyX User's Guide and other literature. I'll repeat what I said before, you should consider obtaining LaTeX Companion, 2nd edition which is a must-have for serious LaTeXing. For basics, you may try with Not So Short Introduction to LaTeX or obtain "Guide to LaTeX", 4th edition. It's up to you. LaTeX is a very powerful system, arguably the most powerful typesetting system in the world, it has rules you'll have to learn and obey. That means you'll have to do a lot of reading if you want to use all its advantages. But consider it investment...
Re: How do I insert a character with a different font in a table
Thank you again for all the information and sorry for my laziness in searching
I am originally coming from the WYSIWYG world and now I am just at the basic Lyx level so all the direct Latex commands are still quite difficult and confusing (especially when there are many connected).
As soon as I can find the time I will start to seriously study Latex as well since I agree it is a real investment.
I have downloaded the free guide and as soon as possible I will order the Guide to Latex.
Cheers

I am originally coming from the WYSIWYG world and now I am just at the basic Lyx level so all the direct Latex commands are still quite difficult and confusing (especially when there are many connected).
As soon as I can find the time I will start to seriously study Latex as well since I agree it is a real investment.
I have downloaded the free guide and as soon as possible I will order the Guide to Latex.
Cheers
How do I insert a character with a different font in a table

As for the font, I really can't say anything, couldn't get it working. You may try on mailing list, maybe someone who works with Japanese or other East Asian languages can help. Generally, that crossed rectangle means that character isn't available, but you say you're sure it's correct. May be font or language issue.
BTW, here is a real quick guide with examples to test, may be useful. Still, don't hesitate to ask
