LaTeX forum ⇒ Fonts & Character SetsSpace before/after ---

Information and discussion about fonts and character sets (e.g. how to use language specific characters)
fred_o
Posts: 4
Joined: Mon Nov 16, 2015 1:26 pm

Space before/after ---

Postby fred_o » Mon Nov 16, 2015 1:29 pm

Hi,

I am typing a document in French and I need to automatically get a fine space (unbreakable) after opening emdash and before closing dash.

How can I do that.

Best,
Fred

Tags:

User avatar
Johannes_B
Site Moderator
Posts: 3906
Joined: Thu Nov 01, 2012 4:08 pm

Postby Johannes_B » Mon Nov 16, 2015 1:42 pm

Welcome,

babel helps you with punctuation in french. I am not sure,though, what you mean by opening em-dash. Can you elaborate a bit on that?
  1. \documentclass{article}
  2. \usepackage[T1]{fontenc}
  3. \usepackage[french]{babel}
  4. \usepackage{csquotes}
  5. \begin{document}
  6. French is nice; Isn't it?
  7.  
  8. Yes! See:
  9.  
  10. \enquote{This is supposed to be a french quote}
  11.  
  12. thinking about it--this is not worth to be thought about.
  13. \end{document}


EDIT: Crosspost
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

fred_o
Posts: 4
Joined: Mon Nov 16, 2015 1:26 pm

Postby fred_o » Mon Nov 16, 2015 1:50 pm

Thanks for your answer.

I have typed
blahblah ---quotehere--- blahblah
And I would like tex to understand
blahblah ---\,{}quotehere\,{}--- blahblah

-Fred
Last edited by cgnieder on Mon Nov 16, 2015 1:58 pm, edited 1 time in total.
Reason: added code markup

User avatar
cgnieder
Site Moderator
Posts: 1988
Joined: Sat Apr 16, 2011 7:27 pm

Postby cgnieder » Mon Nov 16, 2015 1:53 pm

Depending on what blahblah (from the example in the crosspost) semantically is supposed to mean I'd define a new macro or environment

  1. \newcommand\thought[1]{---\,#1\,---}


and then use \thought{blahblah} in the document.

Regards
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim

fred_o
Posts: 4
Joined: Mon Nov 16, 2015 1:26 pm

Postby fred_o » Mon Nov 16, 2015 2:08 pm

Ok thanks...
No automatic trick? I mean a package option that would do the job?

User avatar
cgnieder
Site Moderator
Posts: 1988
Joined: Sat Apr 16, 2011 7:27 pm

Postby cgnieder » Mon Nov 16, 2015 2:34 pm

No automatic trick. --- is just a ligature and not a macro. But even if it were: it wouldn't be easy to make it know when a thought starts and when it ends. Using a macro like I suggested is a much simpler solution.

Regards
Clemens
------------------------------
chemmacros · chemformula · leadsheets · xsim


Return to “Fonts & Character Sets”

Who is online

Users browsing this forum: No registered users and 2 guests